text
stringlengths
3.08k
10.4k
// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT. package serumgo import ( "encoding/binary" "errors" ag_binary "github.com/gagliardetto/binary" ag_solanago "github.com/gagliardetto/solana-go" ag_format "github.com/gagliardetto/solana-go/text/format" ag_treeout "github.com/gagliardet...
// Copyright 2015-2016, 2018-2019 <NAME> // // 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 ag...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: proto/TransactionResponse.proto package proto import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // ...
// Package godaemon runs a program as a Unix daemon. package godaemon // Copyright (c) 2013 VividCortex, Inc. All rights reserved. // Please see the LICENSE file for applicable license terms. import ( "crypto/sha1" "encoding/hex" "fmt" "io" "os" "strconv" "strings" "syscall" "time" ) // The name of the env ...
package main import ( "context" "crypto/rand" "encoding/hex" "math" "math/big" "os" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/...
package sdk import ( "fmt" "sync" "github.com/hyperledger/fabric-sdk-go/pkg/client/channel" "github.com/hyperledger/fabric-sdk-go/pkg/client/event" "github.com/hyperledger/fabric-sdk-go/pkg/common/errors/status" "github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab" "github.com/hyperledger/fabric-sdk-...
package logger import ( stdlog "log" "os" "time" "github.com/yomorun/yomo/core/log" "go.uber.org/zap" "go.uber.org/zap/zapcore" "gopkg.in/natefinch/lumberjack.v2" ) const ( timeFormat = "2006-01-02 15:04:05.000" ) // zapLogger is the logger implementation in go.uber.org/zap type zapLogger struct { level ...
package cmd import ( "github.com/rsteube/carapace" "github.com/rsteube/carapace-bin/completers/hwinfo_completer/cmd/action" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "hwinfo", Short: "Probe for hardware", Long: "https://github.com/openSUSE/hwinfo", Run: func(cmd *cobra.Command, args []...
package currency import ( "bufio" "fmt" "strconv" "strings" "unicode" "github.com/mmcdole/gofeed" "github.com/pkg/errors" ) // Currency is currency code & symbol set. type Currency struct { Code string Symbol string RateToJPY float64 } // e.g https://www.fx-exchange.com/jpy/usd.html const feedURLB...
package auth import ( "context" "errors" "strings" "time" "github.com/spaceuptech/space-cloud/config" "github.com/spaceuptech/space-cloud/model" "github.com/spaceuptech/space-cloud/utils" "github.com/spaceuptech/space-cloud/modules/crud" ) func (m *Module) matchRule(ctx context.Context, project string, rule...
package diff import ( "encoding/json" "fmt" "io" "strconv" "strings" ) type stream struct { diffs []Differ indices []int lhs []interface{} rhs []interface{} } type streamMissing struct { value interface{} } type streamExcess struct { value interface{} } type Stream interface { NextValue() (interface...
// Code generated by github.com/efritz/go-mockgen 0.1.0; DO NOT EDIT. package prometheusutil import ( "context" v1 "github.com/prometheus/client_golang/api/prometheus/v1" model "github.com/prometheus/common/model" "sync" ) // MockPrometheusQuerier is a mock impelementation of the PrometheusQuerier // interface (...
package APILog_test import ( "bytes" "encoding/json" "fmt" . "github.com/publitsweden/APIUtilityGoSDK/APILog" "strings" "testing" "os" "log" ) func TestCanWriteLog(t *testing.T) { t.Run( "using default json format", func(t *testing.T) { tests := map[string]func(a *APILog, message interface{}){ LEV...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: user.proto /* Package user_agent is a generated protocol buffer package. It is generated from these files: user.proto It has these top-level messages: Error ReqMsg ResMsg */ package user_agent import proto "github.com/golang/protobuf/proto" import fmt ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: defaultcmd.proto package cmdpb 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 imports ...
package main import ( "fmt" "strings" "github.com/fsnotify/fsnotify" "github.com/skeswa/sparkplug/lib" "gopkg.in/urfave/cli.v1" "log" "os" "os/signal" "path/filepath" "strconv" "syscall" "time" ) var ( startTime = time.Now() logger = log.New(os.Stdout, "⚡ ", 0) immediate = false buildError er...
package jsoni import ( "context" "reflect" "unsafe" ) type arrayLazyAny struct { baseAny cfg *frozenConfig buf []byte err error } func (a *arrayLazyAny) ValueType() ValueType { return ArrayValue } func (a *arrayLazyAny) MustBeValid() Any { return a } func (a *arrayLazyAny) LastError() error { return a...
package main import ( "flag" "fmt" "strings" "github.com/fatih/color" ) func declareFlags(prefix string) *flags { desc := func(message string) string { if prefix == "" { return fmt.Sprintf("%s.", message) } return fmt.Sprintf("%s for std%s.", message, prefix) } name := func(x string) string { if p...
/* Package shutdown helps controlling app shutdown and graceful termination of goroutines. It listens for SIGTERM (e.g. kill command) and SIGINT (e.g. CTRL+C) signals, and also provides a manual way to trigger shutdown. It publishes a single, shared shutdown channel which is closed when shutdown is about to happen. ...
package main import ( "fmt" "io/ioutil" "log" _ "image/jpeg" _ "image/png" "github.com/jpeinelt/gocmd" "github.com/jpeinelt/gocui" "github.com/jpeinelt/image2ascii/convert" "github.com/jpeinelt/skit/model" "github.com/jpeinelt/skit/parser" termbox "github.com/jpeinelt/termbox-go" ) var ( currentSlide ...
package mqtt import ( "crypto/rsa" "crypto/tls" "crypto/x509" "encoding/json" "fmt" "log" "sync" "time" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/mainflux/mainflux/tools/mqtt-bench/res" mat "gonum.org/v1/gonum/mat" stat "gonum.org/v1/gonum/stat" ) // Client - represents mqtt client type Clie...
package goscreenmonit import ( "encoding/json" "log" "net" "net/http" "os" "path" "strconv" "github.com/gobwas/ws" "github.com/gobwas/ws/wsutil" "github.com/gorilla/mux" ) // Runs a web server front-end for the monitor server backend type WebServer struct { address string certPath string keyPath strin...
package p2p import ( "fmt" "net" "strconv" "strings" "time" log "github.com/sirupsen/logrus" cmn "github.com/tendermint/tmlibs/common" cfg "github.com/bytom/config" "github.com/bytom/errors" "github.com/bytom/p2p/upnp" ) const ( numBufferedConnections = 10 defaultExternalPort = 8770 tryListenTimes ...
package uic import ( "errors" "fmt" "encoding/base64" "encoding/json" "net/http" "net/url" h "github.com/Cepave/open-falcon-backend/modules/f2e-api/app/helper" "github.com/Cepave/open-falcon-backend/modules/f2e-api/app/model/uic" "github.com/gin-gonic/gin" "github.com/masato25/resty" log "github.com/sirup...
// Copyright 2019 <NAME> // // 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 writ...
/* Copyright 2020 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, ...
package wasabihttps import ( "fmt" "io/ioutil" "net/http" "strconv" "strings" "time" "github.com/cloudkucooland/WASABI" "github.com/gorilla/mux" ) func uploadRoute(res http.ResponseWriter, req *http.Request) { var err error doc := wasabi.SimpleDocument{} exp := "14d" // Parse form and get content req.B...
package cmd /* Copyright © 2020 <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follo...
package pipe import ( "context" "fmt" "pipelined.dev/signal" "pipelined.dev/pipe/internal/pool" "pipelined.dev/pipe/internal/runner" "pipelined.dev/pipe/internal/state" "pipelined.dev/pipe/metric" ) // Pipe controls the execution of multiple chained lines. Lines might be chained // through components, mixer ...
package main import ( "bytes" "encoding/json" "flag" "fmt" "io/ioutil" "log" "net/http" "net/url" "os" "path/filepath" "strings" "github.com/gofrs/uuid" "github.com/leaf-ai/studio-go-runner/pkg/studio" "github.com/karlmutch/errors" "github.com/karlmutch/stack" ) const ( // Version defines the app ve...
package monitor import ( "strconv" "sync" "time" "github.com/prometheus/common/log" parser "github.com/zairza-cetb/bench-routes/src/lib/config" "github.com/zairza-cetb/bench-routes/src/lib/filters" "github.com/zairza-cetb/bench-routes/src/lib/request" "github.com/zairza-cetb/bench-routes/src/lib/utils" "gith...
// Copyright 2018 ETH Zurich // // 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 wri...
// Copyright (c) 2015-2017 The Decred developers // Copyright (c) 2018-2020 The Hc developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. // NOTE: This file is intended to house the RPC websocket notifications that are // supported by a chain server. pac...
// Copyright 2012 <NAME>. All rights reserved. // Use of this source code is governed by a license // that can be found in the LICENSE file. package vars import ( "fmt" "strings" "time" ) // Type of value. func (v Value) Type() Type { return v.vtype } // Bool returns boolean representation of the var Value. fun...
package concourse_test import ( "net/http" "net/http/httptest" "testing" "github.com/apoydence/onpar" "github.com/bradylove/concourse-monitor/pkg/concourse" . "github.com/apoydence/onpar/expect" . "github.com/apoydence/onpar/matchers" ) func TestConcourseClient(t *testing.T) { o := onpar.New() defer o.Run(...
package wl import ( "errors" "io" "log" "net" "os" "sync" "time" sys "github.com/neurlang/wayland/os" //"reflect" ) func init() { log.SetFlags(0) } // Context wraps the wayland connection together with the map of all Context objects (proxies) type Context struct { mu sync.RWMutex conn *net.U...
// Code generated by the Pulumi SDK Generator DO NOT EDIT. // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** package appsync import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Resource Type definition for AWS::AppSync::A...
/* Copyright 2021 The OpenYurt 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, so...
package platformclientv2 import ( "time" "github.com/leekchan/timeutil" "encoding/json" "strconv" "strings" ) // Analyticssurvey type Analyticssurvey struct { // EventTime - Specifies when an event occurred. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z EventTime *time...
package app import ( "bytes" "code.google.com/p/go-uuid/uuid" "fmt" "github.com/ngerakines/preview/common" "github.com/ngerakines/preview/config" "github.com/ngerakines/preview/render" "github.com/ngerakines/preview/util" "github.com/ngerakines/testutils" "io/ioutil" "log" "net/http" "net/http/httptest" "...
// Package tmpl handles loading and rendering HTML templates. package tmpl // import "code.soquee.net/tmpl" import ( "html/template" "io" "net/http" "net/url" "path" "strconv" "strings" "time" "golang.org/x/net/xsrftoken" "golang.org/x/text/language" "golang.org/x/text/message" "golang.org/x/text/message/...
package compiler import ( "fmt" "strings" "github.com/alecthomas/protobuf/parser" pb "google.golang.org/protobuf/types/descriptorpb" ) // types contains all known proto custom types with their fully // qualified name (fullname) and serves as a lookup table to get // fully qualified names for relative names and g...
package log import ( "context" "fmt" stdlog "log" "runtime" "strings" "sync/atomic" ) // Logger is the default instance of the log package var ( atomicLogger = new() // ErrorHandler is called whenever handler fails to write an event on its // output. If not set, an error is printed on the stderr. This handl...
package datarepo // Defines a new Builder used to create a new CachedRepository type Builder interface { // Adds a new Unique Key cache to the builder. // // Unique Key caches are used when a key in the cache refers to a single element. // For example, when the cache key represents a Primary Key of a database tabl...
package main import ( "container/list" ) /* 127 word ladder I A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words such that: The first word in the sequence is beginWord. The last word in the sequence is endWord. Only one letter is different between e...
package treetop import ( "net/http" "net/url" "strconv" "strings" "unicode/utf8" ) const ( // TemplateContentType is used for content negotiation within template requests TemplateContentType = "application/x.treetop-html-template+xml" ) // Writer is an interface for writing HTTP responses that conform to the ...
package gateproxy import ( "context" "io" "net" "net/http" "net/url" "time" "github.com/ddosakura/ghost" "golang.org/x/net/proxy" ) // HTTPConfig for Gateway type HTTPConfig struct { Addr string // 监听地址 HTTPS *TLS // 启用 HTTPS BasicAuth *BasicAuth // 启用 Basic 认证 // 连接配置 Proxy func(*http...
// // (C) Copyright 2019-2021 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // package server import ( "fmt" "github.com/pkg/errors" "github.com/daos-stack/daos/src/control/common" "github.com/daos-stack/daos/src/control/logging" "github.com/daos-stack/daos/src/control/server/engine" "...
package check import ( "database/sql" "fmt" "os" "strconv" "strings" "github.com/JaySon-Huang/tiflash-ctl/pkg/options" "github.com/JaySon-Huang/tiflash-ctl/pkg/tidb" "github.com/olekukonko/tablewriter" "github.com/spf13/cobra" ) func NewDistributionCmd() *cobra.Command { var opt checkDistributionOpts c :=...
// Copyright 2014 Auburn University. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package dataflow import ( "go/ast" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/types" "github.com/godoctor/godoctor/analysis/cfg" "github.co...
package ops import ( "encoding/json" "fmt" "time" pf "github.com/estuary/flow/go/protocols/flow" log "github.com/sirupsen/logrus" ) // Logger is an interface for publishing log messages that relate to a specific task. // This is used so that logs can be published to Flow ops collections at runtime, but can be /...
package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "net/http/httptest" "os" "github.com/joyrexus/buckets" mux "github.com/julienschmidt/httprouter" ) const verbose = false // if `true` you'll see log output func main() { // Open a buckets database. bx, err := buckets.Open(t...
package geom import ( "fmt" "math" "github.com/peterstace/simplefeatures/rtree" ) // Distance calculates the shortest distance (using the Euclidean metric) // between two geometries. If either geometry is empty, then false is returned // and the distance is not calculated. func Distance(g1, g2 Geometry) (float64,...
package ec2 //----------------------------------------------------------------------------- // Package factored import statement: //----------------------------------------------------------------------------- import ( // Stdlib: "encoding/json" "strings" "time" // Community: log "github.com/Sirupsen/logrus" ...
package ehcli import ( "context" "errors" "fmt" "io/fs" "log" "strings" "time" "github.com/function61/eventhorizon/pkg/ehevent" "github.com/function61/eventhorizon/pkg/policy" "github.com/function61/eventhorizon/pkg/randomid" "github.com/function61/eventhorizon/pkg/system/ehcred" "github.com/function61/ev...
package http import ( "reflect" "net/http" "fmt" "strconv" "encoding/json" "regexp" "github.com/mskoroglu/golaxy/http/request/path" "github.com/mskoroglu/golaxy/http/request" "github.com/mskoroglu/golaxy/view" "github.com/mskoroglu/golaxy/config" ) type handlerFunc struct { path string method stri...
package main import "fmt" var lang = map[string]map[string]string{ "tw": map[string]string{ "": "未預期的錯誤: ", "btn_switch_lang_en": "Switch to English", "btn_switch_lang_tw": "切換至正體中文", "btn_inst_trademacro": "執行 TradeMacro", "btn_inst_pob": "執行 ...
/* 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, ...
// Copyright (c) 2019, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. // This test sets singularity image specific environment var...
package gasprice import ( "context" "errors" "math/big" "sync" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) var ErrBlockNotFound = errors.New("could not get block") type trackerMock struct { lastHead common.Hash subs map[chan<- struct{}]struc...
package blog_classification import ( "github.com/gogf/gf/errors/gerror" "github.com/gogf/gf/frame/g" "goShop/gfast/app/service/cache_service" ) // AddReq 用于存储新增记录请求参数 type AddReq struct { ClassificationName string `p:"classificationName" v:"required#名称不能为空"` // 名称 ClassificationSort uint `p:"classi...
package ui import ( "github.com/Bios-Marcel/tview" "github.com/atotto/clipboard" "github.com/gdamore/tcell" "os" ) const splashText = ` ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ███████╗███████╗███████╗ ██╔════╝██╔═══██╗██╔══██╗██╔══██╗██║ ██╔════╝██╔════╝██╔════╝ / \ ██║ ██║ ██║█...
package sybil import "fmt" import "path" import "bytes" import "encoding/gob" import "io/ioutil" import "time" import "os" type RowSavedInt struct { Name int16 Value int64 } type RowSavedStr struct { Name int16 Value string } type RowSavedSet struct { Name int16 Value []string } type SavedRecord struct { ...
package shadow import ( "github.com/go-gl/mathgl/mgl32" "github.com/lakal3/vge/vge/vk" "github.com/lakal3/vge/vge/vmodel" "github.com/lakal3/vge/vge/vscene" ) // NewSpotLight will construct a spot light that has a shadow. MapSize parameter sets size of parabloid shadow map. // Higher resolution will produce more...
package graph import ( "fmt" "github.com/jjzcru/elk/pkg/primitives/ox" "github.com/jjzcru/elk/pkg/server/graph/model" ) func mapElk(elk *ox.Elk) (*model.Elk, error) { elkModel := model.Elk{ Version: elk.Version, Env: map[string]interface{}{}, Vars: map[string]interface{}{}, Tasks: []*model.Task{...
package cloudwatch import ( "bytes" "log" "os" "strconv" "strings" "text/template" "time" docker "github.com/fsouza/go-dockerclient" "github.com/gliderlabs/logspout/router" ) func init() { router.AdapterFactories.Register(NewAdapter, "cloudwatch") } const defaultMaxRetries = 5 // Adapter is an adapter th...
// Copyright (c) 2021 <NAME> <<EMAIL>>. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // Package logger provides an interface for logging. It wraps awesome existing go loggers with that interface. // In that case, it is easy to change the l...
/* * Copyright 2013–2020 Kullo GmbH * * This source code is licensed under the 3-clause BSD license. See LICENSE.txt * in the root directory of this source tree for details. */ package challenges import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "errors" "strconv" "time" ) var ErrUserExists = errors.Ne...
package util import ( "bytes" "fmt" ) type OpenBitSet struct { bits []int64 wlen int // number of words (elements) used in the array numBits int64 // for assert only } /* Constructs an OpenBitSet large enough to hold numBits. */ func NewOpenBitSetOf(numBits int64) *OpenBitSet { assert(numBits > 0) bit...
package main import ( "crypto/tls" "crypto/x509" "fmt" "net/url" "os" "time" "code.cloudfoundry.org/tlsconfig" "github.com/nats-io/nats.go" "gopkg.in/yaml.v2" ) const USAGE = `Usage: /var/vcap/jobs/gorouter/bin/nats_client [COMMAND] [SUBJECT] [MESSAGE] COMMANDS: subscribe (Default) Streams NATS messag...
package wrk3 import ( "context" "flag" "fmt" "log" "sync" "time" "github.com/HdrHistogram/hdrhistogram-go" "golang.org/x/time/rate" ) type RequestFunc func() error type Benchmark struct { Concurrency int Throughput float64 Duration time.Duration SendRequest RequestFunc } type BenchResult struct { ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/type/money.proto package google_type import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // Th...
package orm // Copyright (c) 2018 Bhojpur Consulting Private Limited, India. All rights reserved. // 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 l...
package credentials import ( "errors" "fmt" "github.com/privacybydesign/gabi" "github.com/privacybydesign/gabi/big" "github.com/privacybydesign/gabi/pkg/common" ) // UserIssuanceSession stores information which are used only by the user during // the attestation of claims type UserIssuanceSession struct { Cb ...
// Copyright 2017 Google 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wri...
package handlers import ( "encoding/json" "fmt" "net/http" "net/http/httptest" "strings" "testing" "time" "github.com/stretchr/testify/assert" "github.com/gorilla/websocket" "github.com/stretchr/testify/mock" "github.com/id-tarzanych/lets-go-chat/api/wss" "github.com/id-tarzanych/lets-go-chat/mocks" "g...
package api import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "net/http/httptest" "strings" "time" "github.com/jgolang/api/core" ) var ( // DefaultInvalidAuthHeaderMsg doc .. DefaultInvalidAuthHeaderMsg = "Invalid Authorization header!" // DefaultUnauthorizedTitle doc ... DefaultUnauthorized...
package memory import ( "errors" "fmt" "reflect" cloneUtils "github.com/mycontroller-org/server/v2/pkg/utils/clone" filterUtils "github.com/mycontroller-org/server/v2/pkg/utils/filter_sort" storageTY "github.com/mycontroller-org/server/v2/plugin/database/storage/types" "go.uber.org/zap" ) // Close Implementat...
// MIT License // // Copyright (c) 2021-2022 <NAME> AG // // 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, modi...
// +build wasm,electron package model import ( "bytes" "encoding/gob" "github.com/gontikr99/chutzparse/internal/eqspec" "github.com/gontikr99/chutzparse/internal/iff" "github.com/gontikr99/chutzparse/internal/model/boosts" "github.com/gontikr99/chutzparse/internal/model/fight" "github.com/gontikr99/chutzparse/...
package okex import ( dc_exchanges_api "dc-exchanges-api" "fmt" "sort" "time" ) type SpotOKEXClient struct { client *dc_exchanges_api.Client } func NewSpotOKEXClient(apiKey, secretKey, passphrase string, endPoint string) *SpotOKEXClient { return &SpotOKEXClient{client: newOKExClient(apiKey, secretKey, passphra...
// Copyright (c) 2019-2020 <NAME> // Package godatatables implements a function to handle a DataTables request. package godatatables import ( "database/sql" "encoding/json" "fmt" "log" "net/http" "strconv" "strings" "time" "github.com/jmoiron/sqlx" ) // Column represents an SQL column. // Name is the name ...
// Copyright (c) 2014 Couchbase, 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 in writin...
package main import ( "encoding/json" "fmt" "strconv" "cuckoo/cuckoo" ) // processReportInfo extracts all the data from the info // section of the cuckoo report struct. func processReportInfo(i *cuckoo.TasksReportInfo) []*CrtResult { if i == nil { return []*CrtResult{} } // i.machine can be string or struc...
package main import ( "time" "util/logs" "util/run" "core/net" "core/net/dispatcher" "core/net/lan" "core/net/msg/protobuf" "core/net/socket" "share/pipe" ) var _ = logs.Debug // 来自玩家的连接管理// to do 心跳 type Client struct { *dispatcher.BaseUnit NetId int // user's msg AccId int64 // account id Load i...
package main import ( db "github.com/fclairamb/m2mp/go/m2mp-db" ent "github.com/fclairamb/m2mp/go/m2mp-db/entities" mq "github.com/fclairamb/m2mp/go/m2mp-messaging" "github.com/gocql/gocql" es "github.com/olivere/elastic" stdlog "log" "os" "strings" "sync" "time" ) type IndexService struct { mqClient ...
package vit import ( "fmt" "math" "os" "strings" ) // position describes a specific position in a file type Position struct { FilePath string Line int // line inside the file starting at 1 Column int // column inside the line starting at 1 (this is pointing to the rune, not the byte) } // String returns...
package concourse import ( "encoding/json" "net/http" "net/http/httptest" "net/url" "reflect" "strings" "testing" ) const tokenType = "Bearer" func TestNewClient(t *testing.T) { cases := map[string]struct { version string public bool username string password string token string idToken stri...
package gorgonia import ( "fmt" "testing" "github.com/chewxy/hm" "github.com/stretchr/testify/assert" "gorgonia.org/tensor" ) func TestDtypeBasics(t *testing.T) { assert := assert.New(t) var t0 tensor.Dtype var a hm.TypeVariable t0 = Float64 a = hm.TypeVariable('a') assert.True(t0.Eq(Float64)) assert....
package golisp2 import ( "strings" "testing" "github.com/stretchr/testify/require" ) func Test_cell(t *testing.T) { v, e := NewCallExpr( NewIdentLiteral("cons"), NewStringLiteral("a"), NewStringLiteral("b"), ).Eval(BuiltinContext()) require.NoError(t, e) assertAsCell(t, v) left, leftErr := carFn( B...
package pay import ( "context" "git.900sui.cn/kc/rpcinterface/client" "git.900sui.cn/kc/rpcinterface/interface/pay" ) type Pay struct { client.Baseclient } func (p *Pay) Init() *Pay { p.ServiceName = "rpc_pay" p.ServicePath = "Pay" return p } // 获取支付二维码 func (p *Pay) PayQr(ctx context.Context, args *pay.PayI...
package minhash import ( "container/heap" "fmt" "sort" "github.com/will-rowe/hulk/src/helpers" ) // KMVsketch is the bottom-k MinHash sketch of a set type KMVsketch struct { algo string KmerSize uint `json:"ksize"` Md5sum string `json:"md5sum"` Sketch []uint64 `json:...
package worker import ( "cron-manage/common" "fmt" "log" "time" ) //调度协程 type Scheduler struct { EventChan chan *common.Event //任务队列 SchedulePlan map[string]*common.JobSchedulePlan //任务调度计划表 每个任务的下次执行时间 ExcuteInfo map[string]*common.JobExecuteInfo //任务调度执行表 每个任务的执行结果 ResultChan chan *c...
package eksconfig import ( "errors" "fmt" "github.com/aws/aws-k8s-tester/pkg/randutil" "github.com/aws/aws-k8s-tester/pkg/timeutil" ) // AddOnHollowNodesRemote defines parameters for EKS cluster // add-on hollow nodes remote. // It generates loads from the remote workers (Pod) in the cluster. // Each worker writ...
package main import ( "io/ioutil" "log" "os" "os/exec" "os/signal" "strconv" "strings" "sync" "syscall" "time" "github.com/spf13/cobra" ) func main() { runCmd := &cobra.Command{ Use: "run [command]", Run: run, } runCmd.Flags().String("pid-file", "/tmp/volleyd.pid", "File to write the volleyd pid wh...
package app import ( "fmt" "sort" "time" "github.com/MVPWorkshop/electionr/x/staking" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" distr "github.com/cosmos/cosmos-sdk/x/distribution" "github.com/cosmos/cosmos-sdk/x/mint" "github.com/cos...
package v1alpha1 import ( "reflect" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" ) // MMESimSpec defines the desired state of MMESim type MMESimSpec struct { KubedgeSpec `json:",inline"` // LCs describes the set of LC depl...
package mr // lab01代码 import ( "log" "net" "net/http" "net/rpc" "os" "sync" "time" ) type Master struct { // Your definitions here. nReduce int files []string mu sync.Mutex done bool taskCh chan Task //任务,有多少个服务器 fileTaskStats []FileTaskStat //文件队列 phase int //阶段 workerId int } // Your code here -- RP...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: wrapped.proto package wrapped import ( context "context" fmt "fmt" math "math" proto "github.com/golang/protobuf/proto" wrappers "github.com/golang/protobuf/ptypes/wrappers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "...
// +build ignore // SILVER - Service Wrapper // // Copyright (c) 2014 PaperCut Software http://www.papercut.com/ // Use of this source code is governed by an MIT or GPL Version 2 license. // See the project's LICENSE file for more information. // // This Go make file builds Silver directly from a code checkout, bypas...