text stringlengths 3.08k 10.4k |
|---|
package data
import (
"context"
"fmt"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/hashicorp/go-hclog"
protos "github.com/nicholasjackson/building-microservices-youtube/currency/protos/currency"
)
// ErrProductNotFound is an error raised when a product can not be found in the dat... |
package proto
type GSkill struct {
Id int `json:"id"`
Lv int `json:"lv"`
CfgId int `json:"cfgId"`
}
type General struct {
Id int `json:"id"`
CfgId int `json:"cfgId"`
PhysicalPower int `json:"physical_power"`
Order int8 `json:"order"`
Level int8 `json:"level"`
... |
// This file is part of graze/golang-service
//
// Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
//
// license: https://github.com/graze/golang-service/blob/master/LICENSE... |
package vdisk
/**
* SPDX-License-Identifier: Apache-2.0
* Copyright 2020 vorteil.io Pty Ltd
*/
import (
"context"
"fmt"
"io"
"github.com/vorteil/vorteil/pkg/elog"
"github.com/vorteil/vorteil/pkg/gcparchive"
"github.com/vorteil/vorteil/pkg/qcow2"
"github.com/vorteil/vorteil/pkg/vcfg"
"github.com/vorteil/vo... |
// Copyright (c) 2019, The GoKi Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gi3d
import (
"github.com/goki/gi/gist"
"github.com/goki/ki/kit"
"github.com/goki/mat32"
)
// shapes define different standard mesh shapes
... |
/*
Copyright 2021 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package unused
import (
"fmt"
"go/parser"
"go/token"
"go/types"
"os"
"sort"
"strconv"
"strings"
"testing"
"text/scanner"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/analysistest"
"golang.org/x/tools/go/packages"
"honnef.co/go/tools/lint"
)
// parseExpectations parses the content of... |
package ps2
// https://wiki.osdev.org/%228042%22_PS/2_Controller
import (
"fmt"
)
const (
PS2_STAT_OBF = byte(0x01)
PS2_STAT_IBF = byte(0x02)
PS2_STAT_SYS = byte(0x04)
PS2_STAT_CMD = byte(0x08)
PS2_STAT_INH = byte(0x10)
PS2_STAT_TTO = by... |
package path
import (
"strings"
cid "github.com/ipfs/go-cid"
ipfspath "github.com/ipfs/go-path"
)
// Path is a generic wrapper for paths used in the API. A path can be resolved
// to a CID using one of Resolve functions in the API.
//
// Paths must be prefixed with a valid prefix:
//
// * /ipfs - Immutable unixfs... |
// ﷽
// (Bismillahirrahmanirrahim)
// NUSWhereBot Beta
// Author: <NAME> <<EMAIL>>
//
// A Telegram bot which retrieves the map for the queried location.
// When running, make sure to specify TELEGRAM_SECRET env variable
// with the bot's secret key.
//
// Retrieve the required libraries below via go get
package main
... |
package main
import (
"context"
"fmt"
"net"
"net/http"
"os"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/cresta/helm-s3-proxy/internal/handler"
"github.com/cresta/gotracing"
"github.com/cresta/gotracing/datadog... |
package fs
import (
"os"
"time"
)
/*
The below code contains portions of the Go standard library, specically
the os package.
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following ... |
package prettytable
import (
"bytes"
"strings"
"unicode"
)
type AlignmentType uint8
const (
AlignLeft AlignmentType = iota
AlignCenter
AlignRight
)
const TabWidth = 8
type ptColumn struct {
Title string
Align AlignmentType
}
type PrettyTable struct {
columns []ptColumn
}
func NewPrettyTable(fields []str... |
// Copyright 2020 Liquidata, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... |
/*
* Bulldozer Framework
* Copyright (C) DesertBit
*/
package router
import (
"github.com/desertbit/bulldozer/log"
"github.com/desertbit/bulldozer/utils"
"strings"
"sync"
)
//#############//
//### Types ###//
//#############//
type Params map[string]string
type Data struct {
Value interface{}
Path ... |
package eventqueue
import (
"database/sql"
"database/sql/driver"
"encoding/json"
"fmt"
"io/ioutil"
"math"
"time"
"github.com/pkg/errors"
)
const (
selectExternalIDRelationsQuery = `
SELECT id, external_id, table_name FROM pg2kafka.external_id_relations
`
selectUnprocessedEventsQuery = `
SELECT id, uu... |
package main
import (
"database/sql" // sql sorgularını çalıştırmak için
"io"
"net/http" // http statu kodları için kullanılacak
"os" //io ve os dosya upload işleri için gerekli
"github.com/labstack/echo" // echo yüksek hızlı bir web framework
"github.com/labstack/echo/middleware"
_ "github.com/mattn/go-... |
/*
* Copyright Go-IIoT (https://github.com/goiiot)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... |
// Copyright (C) 2020-2021 azumakuniyuki and sisimai development team, All rights reserved.
// This software is distributed under The BSD 2-Clause License.
package rfc1894
import "strings"
// FIELDTABLE() return pairs that a field name and key name defined in sisimai/lhost package
func FIELDTABLE() map[string]string {... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: auth/auth_service.proto
package auth
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// Reference im... |
package webserver
import (
"encoding/json"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
)
// LocateConfigFile determines where the config file should be found based on the location of the current executable
func LocateConfigFile(basename string) string {
var exePath, err = exec.LookPath(os.Args[... |
/*
Copyright (C) 2018 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"... |
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"sort"
"time"
"cloud.google.com/go/translate"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/gorilla/feeds"
"github.com/mmcdole/gofeed"
"golang.org/x/oauth2/google"
"golang.org/x/text/language"
"google.golang.org/api/op... |
package ring
import (
"fmt"
"math/bits"
"github.com/ldsec/lattigo/v2/utils"
)
// IsPrime applies a Miller-Rabin test on the given uint64 variable, returning true if the input is probably prime, and false otherwise.
func IsPrime(num uint64) bool {
if num < 2 {
return false
}
for _, smallPrime := range small... |
package pki
import (
"crypto"
"crypto/ecdsa"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"math/big"
"os"
"sync"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/feeltheajf/ztca/errdefs"
"github.com/feeltheajf/ztca/fs"
)
var (
ctx zerolog.Logger
lock sync... |
package main
import (
"errors"
"fmt"
"github.com/pboehm/series/index"
"github.com/pboehm/series/util"
"github.com/spf13/cobra"
"os"
"regexp"
"strconv"
"strings"
"text/tabwriter"
)
var seriesIndex *index.SeriesIndex
var newSeriesLanguage string
var newSeriesFirstEpisode string
func loadIndex() {
indexFileP... |
// Command modvanity generates HTML files containing <meta name="go-import">
// tags for Go modules in a GitHub repository.
package main
import (
"flag"
"fmt"
"html/template"
"log"
"os"
"path/filepath"
"strings"
"github.com/go-git/go-billy/v5/memfs"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5... |
// Package r3 implements some utility functionality related to three-dimensional geometry.
package r3
import (
"math"
"sort"
)
// Point represent a point in 3D space through cartesian coordinates.
type Point struct {
X, Y, Z float64
}
// Vector represent a vector in 3D space .
type Vector struct {
X, Y, Z float6... |
// Code generated from specification version 1.0.0: DO NOT EDIT
package findbytext
import (
"fmt"
"io"
"net/http"
"github.com/MakeNowJust/heredoc/v2"
"github.com/reubenmiller/go-c8y-cli/pkg/cmd/subcommand"
"github.com/reubenmiller/go-c8y-cli/pkg/cmderrors"
"github.com/reubenmiller/go-c8y-cli/pkg/cmdutil"
"git... |
package view
import (
"fmt"
"image"
"image/color"
_ "image/jpeg"
"image/png"
"io"
"math/rand"
"time"
"github.com/disintegration/imaging"
"github.com/nictuku/stardew-rocks/parser"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
const (
backLayer = 0.01
buildingsLayer = 0.02
flooringLayer = 0.0... |
package consumer
import (
"context"
"errors"
"sync"
"time"
"github.com/Shopify/sarama"
"github.com/inviqa/kafka-consumer-go/config"
failuremodel "github.com/inviqa/kafka-consumer-go/data/failure/model"
"github.com/inviqa/kafka-consumer-go/data/retry/model"
"github.com/inviqa/kafka-consumer-go/log"
)
// kaf... |
package tests
import (
"context"
"testing"
"github.com/project-flogo/rules/common/model"
"github.com/project-flogo/rules/ruleapi"
)
//2 rtcs, 1st rtc ->Asserted multiple tuple types and verify count, 2nd rtc -> Modified multiple tuple types and verify count.
func Test_T9(t *testing.T) {
rs, _ := createRuleSess... |
package controllers
import (
"encoding/json"
"fmt"
"github.com/astaxie/beego/orm"
"sdrms/enums"
"sdrms/models"
"strconv"
"strings"
"sdrms/utils"
"time"
)
type FabricController struct {
BaseController
}
func (c *FabricController) List() {
//直接反序化获取json格式的requestbody里的值(要求配置文件里 copyrequestbody=true)
var p... |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing... |
package oauth
import (
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"net/http"
"net/url"
"os/exec"
"runtime"
"strings"
"time"
"context"
"github.com/danielgtaylor/openapi-cli-generator/cli"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"golang.org/x/oauth2"
gcontext "gopkg.in/h2non/gen... |
package main
import (
"fmt"
"os"
"time"
)
const (
ACK = 0x79
NAK = 0x1F
GET_CMD = 0x00
GETID_CMD = 0x02
GO_CMD = 0x21
WRITE_CMD = 0x31
ERASE_CMD = 0x43
EXTERA_CMD = 0x44
WRUNP_CMD = 0x73
RDUNP_CMD = 0x92
)
var deviceMap = map[uint16]string{
0x410: "STM32F1, performance, medium... |
package zendesk
import (
"context"
"fmt"
"math/rand"
"net/http"
"testing"
"time"
. "github.com/golang/mock/gomock"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/nukosuke/go-zendesk/zendesk"
"github.com/nukosuke/go-zendesk/zende... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package recon
import (
"regexp"
"sort"
"strings"
"github.com/likexian/whois-go"
parser "github.com/likexian/whois-parser-go"
)
const SUBRE = "(([a-zA-Z0-9]{1}|[a-zA-Z... |
package targets
import "testing"
import "fmt"
var paramstr = `
{
"commands": {
"VolDown": {
"description": "Volume Down",
"parameters": []
},
"VolUp": {
"description": "Volume Up",
"parameters": []
},
"SetVolume": {
... |
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
the License. A copy of the License is located at
http://www.apache.org/licenses/LICENSE-2.0
or in the "license" file accompanying t... |
package drae
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"net/http"
"regexp"
"strings"
"sync"
"github.com/PuerkitoBio/goquery"
)
const raeAPI = "https://dle.rae.es/srv/"
// NotFoundError is a special error type that is returned when the word
// could not be found in the API.
type NotFoundError struct {
er... |
package payments
import (
"bytes"
"encoding/json"
"errors"
"net/http"
)
//PAYU API DATA
//payuCredentials define API credentials
type payuCredentials struct {
APIKey string `json:"apiKey"`
APILogin string `json:"apiLogin"`
}
//payuCredentials define a Card (credit or debit)
type payuCard struct {
Number ... |
package payflowpro
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
"os"
"runtime"
"strconv"
"strings"
"time"
)
var debug = false
var pfprohost = ""
var version = "0.9.0"
var agent = "MailerMailer PFPro/" + version
var numretries = 3
var timeout = 30
func init() {
Pftestmode(false)... |
package testdata
import (
"time"
"github.com/frk/isvalid/internal/testdata/mypkg"
)
type UserInput struct {
CountryCode string
SomeVersion int
SomeValue string
F0 string `is:"-"`
F1 string `is:"required"`
F2 string `is:"required:@create"`
F3 string `is:"-"`
F4 string `is:"-"`
F5 string `is:"email... |
// Copyright 2021 Intuitive Labs GmbH. All rights reserved.
//
// Use of this source code is governed by a source-available license
// that can be found in the LICENSE.txt file in the root of the source
// tree.
// TODO: encodings array ?
package httpsp
import (
// "fmt"
"github.com/intuitivelabs/bytescase"
)
// ... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"cmdb/ent/servicetree"
"fmt"
"strings"
"entgo.io/ent/dialect/sql"
)
// ServiceTree is the model entity for the ServiceTree schema.
type ServiceTree struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// Name holds the value o... |
//
// date : 2016-05-13
// author: xjdrew
//
package k1
import (
"net"
"sync"
"time"
"github.com/miekg/dns"
)
// hijacked domain
type DomainRecord struct {
Hostname string // hostname
Proxy string // proxy
IP net.IP // nat ip
RealIP net.IP // real ip
Hits int
Expires time.Time
answer *... |
package daas
import (
"bytes"
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"time"
"golang.org/x/net/http2"
)
type HTTPRequest struct {
client *http.Client
header map[string]string
}
type HTTPTransport struct {
AppName string
AppVersion string
Disabl... |
package disk
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
"time"
c "github.com/lzap/ufacter/facts/common"
"github.com/lzap/ufacter/lib/ufacter"
d "github.com/shirou/gopsutil/disk"
)
var (
reDevBlacklist = regexp.MustCompile("^(dm-[0-9]+|loop[0-9]+)$")
)
// getBlockDevices returns... |
package main
import (
"fmt"
"strconv"
"github.com/Gskartwii/roblox-dissector/peer"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
"github.com/robloxapi/rbxfile"
)
const (
COL_PHYSICS_NAME = iota
COL_PHYSICS_VALUE
)
type PhysicsPacketViewer struct {
mainWidget *gtk.ScrolledWindow
model *gt... |
package main
import (
"fmt"
"regexp"
"os/exec"
"strings"
"bytes"
"os"
"flag"
)
// these values are replaced by build parms in build.sh
var versionNumber string = "0.0.0"
var commitId string = "none"
// a list of the iptables table names that we care about, and abbreviations for the log-pr... |
package pgp
import (
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/binary"
"fmt"
"testing"
"time"
"github.com/joemiller/certin"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestParseAttestation(t *testing.T) {
root := fakeYubiRoot(t)
signer := fakeAttestS... |
package supply
import (
"context"
"fmt"
"testing"
"time"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
peer "github.com/libp2p/go-libp2p-core/peer"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/myelnet/pop/internal/testutil"
"github.com/stretchr/testify/require"
)
func TestMultiReques... |
package svc
import (
"log"
"os"
"strings"
"sync"
"github.com/BTBurke/vatinator/img"
"github.com/BTBurke/vatinator/ocr"
"github.com/dgraph-io/badger/v2"
"github.com/pkg/errors"
"github.com/rs/xid"
)
var cache map[string]Processor
type Processor interface {
Add(name string, image img.Image) error
Wait() er... |
package isotp
import "fmt"
func (t *Transport) process_tx() (Message, bool) {
m := Message{}
if t.pending_flow_control_tx {
t.pending_flow_control_tx = false
return t.make_flow_control(CONTINUE), true
}
flow_control_frame := t.last_flow_control_frame
if flow_control_frame != nil {
if flow_control_frame.... |
package handlers
import (
"encoding/json"
"errors"
"net/http"
"sort"
"strconv"
"github.com/sirupsen/logrus"
"github.com/ivan1993spb/snake-server/connections"
)
const URLRouteGetGames = "/games"
const MethodGetGames = http.MethodGet
const (
getFieldGamesLimit = "limit"
getFieldGamesSorting = "sorting"
)... |
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"github.com/mcuadros/go-gin-prometheus"
"github.com/sirupsen/logrus"
"mime"
"os"
"strconv"
"strings"
)
const (
// FormatHeader name of the header used to extract the format
FormatHeader = "X-Format"
// CodeHeader name of the... |
/*
MIT License
Copyright (c) 2020-2021 YPSI SAS
Centctl is developped by : <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to ... |
package syncgroups
import (
"context"
"fmt"
"net"
"time"
"gopkg.in/ldap.v2"
kapierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"github.com/go-logr/logr"
userv1 "github.com/openshift/api/user/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/openshift/library-go/pkg... |
package common
import (
"fmt"
"sync"
)
// PubkeyCache is shared between any state. However, if .Append(index, pubkey) conflicts, a new cache will be forked out.
type PubkeyCache struct {
parent *PubkeyCache
// The count up until the conflicting validator index (cause of the pubkey cache fork).
trustedParentCount... |
/*
MIT License
Copyright (c) 2021 Kubeshop
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... |
package hmacauth
import (
"bytes"
"crypto"
"crypto/hmac"
"encoding/base64"
"errors"
"io/ioutil"
"net/http"
"strconv"
"strings"
)
// HmacAuth signs outbound requests and authenticates inbound requests.
type HmacAuth interface {
// Produces the string that will be prefixed to the request body and
// used to ... |
package services
import (
"encoding/json"
"fmt"
"github.com/gorilla/websocket"
"lh-gin/constants"
"lh-gin/models"
"lh-gin/repositories"
"lh-gin/requests"
"lh-gin/tools"
"log"
"sync"
"time"
)
type chatService struct {
}
func NewChatService() *chatService {
return &chatService{}
}
func (r *chatService) Lo... |
// Package es implements a simple Elasticsearch client.
package es
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"time"
"go.uber.org/zap"
)
// Config
type Config struct {
Log *zap.Logger
HttpClient *http.Client
ElasticServer string
}
// Client
type Clien... |
package builders
import (
"context"
"fmt"
"strings"
"github.com/99designs/gqlgen/graphql"
"github.com/spf13/cast"
"github.com/vektah/gqlparser/v2/ast"
)
type fieldType string
const (
TypeScalar fieldType = "Scalar"
TypeRelation fieldType = "Relation"
TypeAggregate fieldType = "Aggregate"
TypeObject ... |
package testutils
import (
"database/sql"
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
"runtime"
"strconv"
"testing"
"time"
"github.com/getkin/kin-openapi/openapi3filter"
"github.com/ghodss/yaml"
"github.com/ory/dockertest"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"go.uber.org/zap/z... |
/*
Copyright © 2021 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, ... |
//
//Created by xuzhuoxi
//on 2019-03-15.
//@author xuzhuoxi
//
package manager
import (
"fmt"
"github.com/pkg/errors"
"github.com/xuzhuoxi/infra-go/encodingx"
"github.com/xuzhuoxi/infra-go/logx"
"github.com/xuzhuoxi/infra-go/netx"
"github.com/xuzhuoxi/snail/engine/mmo/basis"
"math"
"sync"
)
type IBroadcastMa... |
package boot
import (
"flag"
"fmt"
"github.com/2345tech/apollo-agent/common"
"github.com/2345tech/apollo-agent/util"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"strings"
"time"
)
const (
_defaultLogfile = "./logs/agent.log"
_defaultConfigFile = "./conf/app.yaml"
_defaultPprof = false
)
type Args struct ... |
package drugdose
import (
"context"
"fmt"
"github.com/hasura/go-graphql-client"
)
type Substances []struct {
Name graphql.String
Roas []struct {
Name graphql.String
Dose struct {
Units graphql.String
Threshold graphql.Float
Light struct {
Min graphql.Float
Max graphql.Float
}
... |
// Package json-lexer is based on the code from the book
// Writing an Interpreter in Go 1.7 by <NAME>
// https://thorstenball.com/books/
package json_lexer
import (
"io"
"io/ioutil"
"github.com/hultan/json-validator/internal/token"
)
type Lexer struct {
runeList []rune
position int // current positio... |
package elrpc
import (
"bufio"
"context"
"fmt"
"log"
"net"
"os"
"os/exec"
"strconv"
"sync"
"time"
)
/// log
type LogLevel int
const (
_ LogLevel = iota
LogLevelDebug
LogLevelInfo
)
var defaultLogLevel LogLevel = LogLevelInfo
func SetDefaultLogLevel(l LogLevel) {
defaultLogLevel = l
}
/// utility
f... |
package httputil
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"focus/util/file"
"github.com/valyala/fasthttp"
"io"
"net/http"
"os"
"strings"
"time"
)
const (
ApplicationJSONUtf8Value = "application/json;charset=utf-8"
)
type SimpleHttpClient interface {
PostJsonWithHeader(url string, headers map[strin... |
package executor
import (
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/common/address"
log "github.com/33cn/chain33/common/log/log15"
drivers "github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
evmxgotypes "github.com/33cn/plugin/plugin/dapp/evmxgo/types"
)
/*
* 执行器相关定义
* 重载基类相... |
package audit
import (
"bytes"
"context"
"encoding/json"
"io"
"net/http"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"kubegems.io/pkg/log"
"kubegems.io/pkg/service/aaa"
"kubegems.io/pkg/service/models"
"kubegems.io/pkg/utils/slice"
)
var normalActions = []string{
http.MethodGet,
http.MethodHead,
http.Met... |
package lexertoken
type TokenType int
const (
TOKEN_ERROR TokenType = iota
TOKEN_EOF
TOKEN_SUPERCLASS
TOKEN_VARIABLE
TOKEN_LEFT_PAREN
TOKEN_RIGHT_PAREN
TOKEN_METHOD_CALL
TOKEN_DEFINED_VALUE
TOKEN_CONDITIONAL_DEF
TOKEN_LEFT_BRACKET
TOKEN_RIGHT_BRACKET
TOKEN_NEWLINE
TOKEN_IFDEF
TOKEN_IFNDEF
TOKEN_DEFINE... |
package dmx
import (
"context"
"fmt"
"strings"
"sync"
"time"
"github.com/akualab/dmx"
"github.com/danesparza/fxdmx/data"
"github.com/danesparza/fxdmx/event"
)
type PlayTimelineRequest struct {
ProcessID string
RequestedTimeline data.Timeline
}
type timelineProcessMap struct {
m map[string]f... |
package dhcp
import (
"encoding/xml"
"github.com/willhu-commit/pango/util"
"github.com/willhu-commit/pango/version"
)
// Entry is a normalized, version independent representation of a DHCP
// relay and server.
type Entry struct {
Name string
Relay *Relay
//Server *Server
raw map[string]string
}
type Relay ... |
package dbft
import (
"fmt"
cl "github.com/Ontology/account"
. "github.com/Ontology/common"
"github.com/Ontology/common/log"
ser "github.com/Ontology/common/serialization"
"github.com/Ontology/core/ledger"
tx "github.com/Ontology/core/transaction"
"github.com/Ontology/crypto"
"github.com/Ontology/net"
msg "g... |
/*
Copyright 2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright 2022 PayPal Inc.
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT License was not distributed with this file,
// you can obtain one at https://mit-license.org/.
// Package web enables Honeydipper to make outbound web requests.
package main
import (
"bytes"
"... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"github.com/daymenu/goadmin/internal/ent/admin"
"github.com/facebook/ent/dialect/sql"
)
// Admin is the model entity for the Admin schema.
type Admin struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
... |
// Copyright (c) 2019 Perlin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distri... |
package v2
import (
"strconv"
"time"
)
type VirtualDiskAttach struct {
UUID string `json:"uuid,omitempty"`
VMDisks []*VMDisk `json:"vm_disks,omitempty"`
}
type VirtualDiskList struct {
Metadata *Metadata `json:"metadata,omitempty"`
Entities []*VirtualDisk `json:"entities,omitempty"`
}
type Metadata... |
package cmd
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
"github.com/log-events/collect/rfc5424"
"github.com/spf13/cobra"
"gopkg.in/mcuadros/go-syslog.v2"
"gopkg.in/olivere/elastic.v5"
"gopkg.in/yaml.v2"
)
var rootCmd = &cobra.Command{
Use: "collect",
Short: "... |
package steps
import (
gohttp "net/http"
"github.com/Shopify/sarama"
broker "github.com/consensys/orchestrate/pkg/broker/sarama"
orchestrateclient "github.com/consensys/orchestrate/pkg/sdk/client"
"github.com/consensys/orchestrate/pkg/toolkit/app/http"
"github.com/consensys/orchestrate/pkg/toolkit/app/log"
"gi... |
// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package main
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"regexp"
"sync"
"github.com/kr/s3/s3util"
)
type CxDownload struct {
Version string `json:"version"`
Platform string `json:"platform"`
Arch string `json:"architect... |
package sqlite
import (
"context"
"database/sql"
"fmt"
"os"
"strings"
"github.com/fortytw2/lounge"
"github.com/fortytw2/trek"
_ "github.com/mattn/go-sqlite3"
)
const asyncIDLength = 12
// shared sqlite3 settings
var stdDSN = "&cache=shared&_vacuum=2&_rt=0&_foreign_keys=1&_journal_mode=WAL"
type SQLiteWrap... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
return i
}
... |
package actions
import (
"context"
"errors"
"fmt"
"github.com/treeverse/lakefs/pkg/graveler"
"github.com/treeverse/lakefs/pkg/kv"
)
// Store is an abstraction layer for operating with a concrete postgres DB or a
// KV store abstraction.
type Store interface {
// UpdateCommitID will update an already stored run... |
// An implementation of in-memory operations supported by a B+ Tree.
package bplustree
import "fmt"
type Tree struct {
Root *Node
dbPath string
index map[int]int
}
type Node struct {
n int // number of keys currently stored
t int // degree of a node. TODO: Rename to m.
leaf bool // indicates if ... |
package dag
import (
"fmt"
)
// subDAGGenerator is the state machine used to get a subDAG from a DAG
type subDAGGenerator struct {
// RootIndex is the index of a node the Manifest that is to be the root the new dag
RootIndex int
// Conversion is a map keeping track of a previous index and its new counterpart
Con... |
package packages
const (
URL_PACKAGES_LIST = "/ark/open_api/v0/packages" // 订单列表路由
METHOD_PACKAGES_LIST = "package.getPackageList"
)
// TimeType startTime/endTime对应的时间类型
type TimeType int
const (
CREATED TimeType = iota + 1 // 创建时间
UPDATED // 更新时间
)
// Int ...
func (t TimeType) Int() int ... |
package main
import (
"fmt"
"github.com/BurntSushi/toml"
"github.com/bwmarrin/discordgo"
"github.com/caylorme/pubgopgg"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
)
var config = Config{
Trigger: "!",
Status: "Rolyac",
}
type Config struct {
Token string
Status string
Trigger string
}
func main... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... |
// +build rpi
// +build !darwin
package rpi
import (
"fmt"
"regexp"
"strconv"
"strings"
"sync"
"unsafe"
// Frameworks
"github.com/djthorpe/gopi/v3"
)
////////////////////////////////////////////////////////////////////////////////
// CGO
/*
#cgo pkg-config: bcm_host
#include "bcm_host.h"
#include <stdio.h>... |
package core
import (
"context"
"errors"
"sync"
"github.com/guojiangli/picasso/pkg/klog"
"github.com/guojiangli/picasso/pkg/server"
"github.com/guojiangli/picasso/pkg/signals"
"github.com/guojiangli/picasso/pkg/utils/kcycle"
"github.com/guojiangli/picasso/pkg/utils/kdefer"
"github.com/guojiangli/picasso/pkg/... |
package http
import (
"fmt"
"regexp"
"strings"
"time"
errorConfigAVA "github.com/ver13/ava/pkg/common/config/error"
httpModelConfigAVA "github.com/ver13/ava/pkg/common/config/model/http"
errorAVA "github.com/ver13/ava/pkg/common/error"
errorGeneralAVA "github.com/ver13/ava/pkg/common/error/general"
serializ... |
package cli
import (
"fmt"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"text/template"
"github.com/binqry/binq/schema"
"github.com/binqry/binq/schema/item"
"github.com/progrhyme/go-lv"
"github.com/spf13/pflag"
)
type registerCmd struct {
*indiceCmd
option *registerOpts
}
type registerOpts struct {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.