text
stringlengths
3.08k
10.4k
package main import ( "crypto/rand" "encoding/json" "fmt" "io" "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer" ) const prefixCustomer = "customer" const prefixInsurance = "insurance" const prefixPhysician = "physician" const prefixProvider = "provider" const p...
package r import ( "reflect" ) type ( // Effect is the function type you pass to UseEffect. // // It must return an EffectCancel, even if there is nothing to clean up. // // In the Effect you can have a routine to do something (such as fetching // data), and then call SetState from a UseState hook, to update y...
///////////////////////////////////////////////////////////////////////// // Package for running jobs that make REST requests // // Note: With concurrecy the RestClient will open new TCP/IP connections for // each worker in a concurrecy set. This leads to many requests having // inflated time under concurrency. ...
package service import ( "context" "testing" "time" "github.com/fleetdm/fleet/v4/server/config" "github.com/fleetdm/fleet/v4/server/contexts/viewer" "github.com/fleetdm/fleet/v4/server/datastore/mysql" "github.com/fleetdm/fleet/v4/server/fleet" "github.com/fleetdm/fleet/v4/server/mock" "github.com/fleetdm/fl...
package wbnf import ( "fmt" "github.com/arr-ai/frozen" "github.com/arr-ai/wbnf/parser" ) /* Attempt to find and insert cutpoints into the generated parser.Grammar What is a cutpoint? A point in a rule which if the parse was successful past this point but fails at any point later the whole parse should fail ins...
/* 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, software distributed under the License i...
package swaggerizer import ( "encoding/json" "reflect" "strconv" "strings" "github.com/erikperez/go-swaggerize/pkg/swagger" ) // Swaggerize converts an array of Routes into a Swagger 2.0 model (swagger.Model) func Swaggerize(swag *swagger.Model, routes []Route) (string, error) { for _, route := range routes { ...
package bilibili import ( "bytes" "context" "errors" "fmt" "github.com/jinzhu/gorm" "go-bot/setting" "go-bot/utils/tools" "io/ioutil" "log" "net/http" "net/url" "time" ) var livers = []string{"6713974", "190331", "1934433723"} // Liver 主播 type Liver struct { Nickname string `json:"nickname,omitempty"...
// Copyright (C) 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 // protoc v3.12.3 // source: result.proto package pb import ( proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoim...
package metrics import ( "compress/gzip" "fmt" "io" "io/ioutil" "log" "os" "path" "path/filepath" "strings" "time" ) type Logger interface { Log(info *MetricsInfo) } type StdoutLogger struct{} func NewStdoutLogger() *StdoutLogger { return &StdoutLogger{} } func (l *StdoutLogger) Log(info *MetricsInfo) ...
package processors import ( "math/big" "github.com/stellar/go/services/horizon/internal/db2/history" "github.com/stellar/go/support/errors" "github.com/stellar/go/xdr" ) type assetStatKey struct { assetType xdr.AssetType assetCode string assetIssuer string } type assetStatValue struct { assetStatKey ba...
package mock /* * Copyright 2021 kloeckner.i GmbH * * 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 la...
package server_test import ( "bytes" "io/ioutil" "net" "os" "testing" "time" "github.com/Shopify/sarama" "github.com/stretchr/testify/assert" "github.com/travisjeffery/jocko/broker" "github.com/travisjeffery/jocko/protocol" "github.com/travisjeffery/jocko/raft" "github.com/travisjeffery/jocko/serf" "gith...
package schedulerd import ( "context" "fmt" "sort" "sync" time "github.com/echlebek/timeproxy" corev2 "github.com/sensu/sensu-go/api/core/v2" "github.com/sensu/sensu-go/backend/store" ) type entityCacheKey struct { Name string Namespace string } func getEntityCacheKey(entity *corev2.Entity) entityCach...
package BScanner import ( "bsTool/net/Bipv4" "errors" "fmt" "net" "strings" "sync" "time" ) type Scanner struct { Timeout time.Duration } func Ip2long(ip string) uint32 { return Bipv4.Ip2long(ip) } func Long2ip(proper uint32) string { return Bipv4.Long2ip(proper) } // 初始化一个扫描器 func New() *Scanner { retu...
package jsonbox import ( "bytes" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "net/url" "regexp" "strings" "time" ) // Errors returned when working with jsonbox package var ( ErrTODO = errors.New("functionality not implemented") ErrName = errors.New("invalid name for either BOX_ID or COLLECTION")...
package gui import ( "errors" "fyne.io/fyne" "fyne.io/fyne/dialog" "io/ioutil" "math/rand" "os" "path/filepath" "strconv" "strings" "time" ) type fixConf struct { lapse int mold string confine string } type renameConf struct { length int confine string } type config struct { workDir string ...
package controllers import ( comm "com.wangzhumo.lottery/common" "com.wangzhumo.lottery/models" "com.wangzhumo.lottery/services" "com.wangzhumo.lottery/web/viewmodels" "encoding/json" "fmt" "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/mvc" "time" ) type AdminGiftController struct { Ctx ...
package ldclient import ( "regexp" "strings" "github.com/blang/semver" ) // List of available operators const ( OperatorIn Operator = "in" OperatorEndsWith Operator = "endsWith" OperatorStartsWith Operator = "startsWith" OperatorMatches Operator = "matches" Operat...
package main import ( "context" "errors" "flag" "fmt" "log" "os" "strings" "github.com/jackc/pgx/v4/pgxpool" ) // Command Line Arguments var dsn = flag.String("dsn", "", "database connection string (required)") var workspaceDb = flag.String("workspaceDb", "", "workspace db path (required)") var lookupDb = fl...
package zdx import ( "errors" "fmt" "os" "github.com/brimsec/zq/pkg/bufwriter" "github.com/brimsec/zq/pkg/fs" "github.com/brimsec/zq/proc" "github.com/brimsec/zq/zio" "github.com/brimsec/zq/zio/zngio" "github.com/brimsec/zq/zng" "github.com/brimsec/zq/zng/resolver" ) // Writer implements the zbuf.Writer in...
package httpmod import ( "fmt" "regexp" "strings" "github.com/angrypie/tie/parser" "github.com/angrypie/tie/template" "github.com/angrypie/tie/template/modutils" . "github.com/dave/jennifer/jen" ) const echoPath = "github.com/labstack/echo" const echoMiddleware = "github.com/labstack/echo/middleware" const ht...
package stores import ( "context" "database/sql" "fmt" "strings" "time" "github.com/Masterminds/squirrel" "github.com/fatih/structs" "github.com/jackc/pgx/v4/pgxpool" "github.com/bnkamalesh/verifier" ) // structToMapStringWithTag converts a struct to map[string]interface{}, where keys are fetched from // p...
package service import ( "context" "sort" "strconv" "sync" "go-common/app/service/main/favorite/model" "go-common/library/log" "go-common/library/sync/errgroup" ) // Relations return relations info by fid. func (s *Service) Relations(c context.Context, typ int8, mid, uid, fid int64, tid, tv, pn, ps int, keywo...
package stringset_test import ( "fmt" "path/filepath" "regexp" "strings" "bitbucket.org/creachadair/stringset" ) func ExampleSet_Intersect() { a := stringset.New("one", "two", "three") b := stringset.New("two", "four", "six") fmt.Println(a.Intersect(b)) // Output: {"two"} } func ExampleSet_Union() { s := ...
package main import "os" import "io" import "fmt" import "flag" import "path" import "sync" import "bytes" import "strings" import "go/build" import "github.com/vbauerster/mpb" import "github.com/dustin/go-humanize" import "github.com/090809/marlow/marlow" import "github.com/090809/marlow/marlow/constants" func mai...
// Copyright 2019 The LUCI 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...
/* 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, software distributed under the License...
package proto import ( "encoding/json" "fmt" "strings" ) const ( // client to ion ClientJoin = "join" ClientLeave = "leave" ClientPublish = "publish" ClientUnPublish = "unpublish" ClientSubscribe = "subscribe" ClientUnSubscribe = "unsubscribe" ClientBroadcast = "broadcast" ClientTri...
// Code generated by protoc-gen-go. // source: srv/geo/proto/geo.proto // DO NOT EDIT! /* Package geo is a generated protocol buffer package. It is generated from these files: srv/geo/proto/geo.proto It has these top-level messages: Request Result */ package geo import proto "github.com/golang/protobuf/proto" im...
package spreadsheet /* * keywords contains the keyword identifier for different attributes. A keyword * is added to a header cell to identify the attribute type. For example: * process:Grain Size * In the above example the process: is the keyword and Grain Size is the Attribute. */ import ( "fmt" "strings" ...
// Copyright 2018 The ZikiChombo Authors. All rights reserved. Use of this source // code is governed by a license that can be found in the License file. package sndbuf import ( "fmt" "io" "github.com/zikichombo/sound" "github.com/zikichombo/sound/cil" "github.com/zikichombo/sound/freq" ) // Type Buf implemen...
package exec import ( "bufio" "fmt" "os" "regexp" "strings" "sync" "github.com/k0sproject/rig/log" ) var ( // DisableRedact will make redact not redact anything DisableRedact = false // Confirm will make all command execs ask for confirmation - this is a simplistic way for auditing what will be executed C...
package service import ( "encoding/json" "errors" "fmt" "github.com/gin-gonic/gin" "github.com/snowlyg/go-tenancy/g" "github.com/snowlyg/go-tenancy/model" "github.com/snowlyg/go-tenancy/model/request" "gorm.io/gorm" ) // GetExpressMap func GetExpressMap(id uint, ctx *gin.Context) (Form, error) { var form Fo...
package update import ( "biobtree/pbuf" "bufio" "net/http" "os" "path/filepath" "strings" "sync/atomic" "time" "github.com/pquerna/ffjson/ffjson" xmlparser "github.com/tamerh/xml-stream-parser" ) type ontology struct { source string idPrefix string prefixURL string d *DataUpdate } func (g ...
package command import ( "fmt" "strings" "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/helper/flag-kv" "github.com/hashicorp/vault/helper/flag-slice" "github.com/hashicorp/vault/meta" ) // TokenCreateCommand is a Command that mounts a new mount. type TokenCreateCommand struct { meta.Meta } fun...
// Copyright 2016 NetApp, Inc. All Rights Reserved. package ontap import ( "errors" "fmt" "runtime/debug" "strings" log "github.com/Sirupsen/logrus" "github.com/netapp/netappdvp/azgo" dvp "github.com/netapp/netappdvp/storage_drivers" "github.com/netapp/trident/storage" sa "github.com/netapp/trident/storage...
/* 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, software distributed under the License is ...
package get import ( "encoding/json" "errors" "flag" "fmt" "io" "os" "strings" "time" "github.com/brimsec/zq/cmd/zapi/cmd" "github.com/brimsec/zq/emitter" "github.com/brimsec/zq/pkg/fs" "github.com/brimsec/zq/pkg/nano" "github.com/brimsec/zq/zbuf" "github.com/brimsec/zq/zio" "github.com/brimsec/zq/zqd/...
package initialize import ( "path/filepath" "strings" "github.com/ActiveState/cli/internal/constants" "github.com/ActiveState/cli/internal/errs" "github.com/ActiveState/cli/internal/fileutils" "github.com/ActiveState/cli/internal/language" "github.com/ActiveState/cli/internal/locale" "github.com/ActiveState/c...
package main import ( "fmt" "github.com/pkg/profile" //"github.com/pkg/profile" "github.com/szymonkups/nesgo/core" "github.com/szymonkups/nesgo/ui" "github.com/veandco/go-sdl2/sdl" "os" ) const ( screenFPS uint32 = 60 screenTicksPerFrame = 1000 / screenFPS ) //func main() { // p := profile...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Retrieves the Project identified by the specified `project_id` (for e...
package main import ( "image/color" "time" "github.com/oakmound/oak/v3/alg/range/floatrange" oak "github.com/oakmound/oak/v3" "github.com/oakmound/oak/v3/collision" "github.com/oakmound/oak/v3/entities" "github.com/oakmound/oak/v3/event" "github.com/oakmound/oak/v3/key" "github.com/oakmound/oak/v3/render" ...
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT package cadvisor import ( "path" "strconv" "strings" "time" . "github.com/aws/amazon-cloudwatch-agent/internal/containerinsightscommon" "github.com/aws/amazon-cloudwatch-agent/plugins/inputs/cadvisor/extracto...
// 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 // "License"); you may...
// Copyright (c) 2016 The mccdaq developers. All rights reserved. // Project site: https://github.com/gotmc/mccdaq // Use of this source code is governed by a MIT-style license that // can be found in the LICENSE.txt file for the project. package main import ( "bytes" "encoding/binary" "encoding/json" "flag" "fm...
package model import ( "bytes" "fmt" "regexp" "strings" "time" ) type Article struct { ID int64 `json:"id" gorm:"primary_key;comment:'文章ID'"` CreatedAt time.Time `json:"created_at" gorm:"comment:'创建时间'"` UpdatedAt time.Time `json:"updated_at" gorm:"comment:'更新时间'"` Title string `json:"title...
package api import ( "database/sql" "fmt" "github.com/pkg/errors" ) var ( // ErrPasswordDoesNotMatch is an error when a user inputs an invalid password ErrPasswordDoesNotMatch = errors.New("Password does not match") // ErrAccountDoesNotExist is an error when a users account does not exist ErrAccountDoesNotEx...
// Copyright 2021 SpotHero // // 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...
package cmd import ( "errors" "fmt" "os" c "github.com/gbolo/go-util/lib/common" "github.com/gbolo/go-util/pkcs11-test/p11" "github.com/miekg/pkcs11" "github.com/spf13/cobra" "github.com/spf13/viper" ) // aesImport represents the aes command var ecdsaCmd = &cobra.Command{ Use: "ecdsa", Short: "Creates an...
// Package todo provides an example of stateful command that lets users input required arguments step by step in a conversational manner. // // On each valid input, the given argument is stashed to *args. // *args is passed around until all required arguments are filled. package todo import ( "context" "fmt" "githu...
// Copyright (c) 2018 The btcsuite developers // Copyright (c) 2018 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package testnode import ( "fmt" "io/ioutil" "path/filepath" "github.com/decred/dcrd/chaincfg" "github.com/decred/dcrd/dcrut...
package main import ( "ddfs-go/internal/comm/errno" "ddfs-go/internal/comm/utils" "encoding/json" "fmt" "io" "io/ioutil" "os" "path" "sync" "time" "github.com/sirupsen/logrus" ) var ( // StorageFile 用于存储文件系统的信息 StorageFile = "lfs.json" ) // Storage 对存储的抽象,能够根据blk hash获取对应的内容 type Storage interface { ...
package main import ( "fmt" ) type Player struct { hitpoint int armor int damage int } type Item struct { name string price int armor int damage int } var empty = Item{name: "empty", price: 0, armor: 0, damage: 0} var Dagger = Item{name: "Dagger", price: 8, armor: 0, damage: 4} var Shortsword = Item{name...
package integrationtests import ( "errors" "net/http" "os" "time" "github.com/mattermost/focalboard/server/api" "github.com/mattermost/focalboard/server/client" "github.com/mattermost/focalboard/server/server" "github.com/mattermost/focalboard/server/services/config" "github.com/mattermost/focalboard/server/...
package database import ( "database/sql" "fmt" "log" "strings" "time" "github.com/stellar/kelp/support/postgresdb" "github.com/stellar/kelp/support/utils" ) // sqlDbVersionTableInsertTemplate inserts into the db_version table const sqlDbVersionTableInsertTemplate1 = "INSERT INTO db_version (version, date_comp...
package main import ( "encoding/json" "fmt" "image" "image/png" "io" "io/ioutil" "net" "net/http" "os" "os/exec" "runtime" "strconv" "strings" "sync" "github.com/superp00t/etc" "github.com/gorilla/mux" "github.com/nfnt/resize" "github.com/superp00t/etc/yo" "github.com/zserge...
package main import ( "flag" "fmt" "log" "os" "github.com/vseledkin/gorpora" "github.com/vseledkin/gorpora/fb2" ) const ( stripHtml = "strip.html" normalizeHtmlEntities = "normalize.html.entities" tokenize = "word.tokenizer" unique = "unique" filterLanguage =...
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
package main import ( "fmt" "os" "strings" "testing" cv "github.com/smartystreets/goconvey/convey" ) func TestCaptureJobSuccessOrNotStatus(t *testing.T) { SetupFakeGoCdEnvVar() ws := NewWebServer("localhost:3000").Start() defer ws.Stop() cv.Convey("Given a pipeline job command to be run", t, func() { cv.C...
/* Copyright © 2019 Doppler <<EMAIL>> 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, soft...
package styx import ( "bytes" "encoding/binary" "fmt" badger "github.com/dgraph-io/badger/v2" rdf "github.com/underlay/go-rdfjs" ) // A constraint to an occurrence of a variable in a query type constraint struct { index int // The index of the triple within the query place Permutation // The t...
package TERMINUS import ( "gopkg.in/mgo.v2" log "github.com/sirupsen/logrus" "os" "gopkg.in/mgo.v2/bson" ) var Host = []string{ "mongodb", // replica set addrs... } const ( Database = "TERMINUS" Collection_MSC = "ALL_TESTS_MSC_PREDICTION" Collection_MSC_EXPERIMENTAL = "ALL_EXPERIMENTAL_MSC_CALCULATED" Coll...
package ipcall import ( "crypto/ecdsa" "crypto/rand" "fmt" "net" "sync" "github.com/navaz-alani/concord/core" "github.com/navaz-alani/concord/core/crypto" "github.com/navaz-alani/concord/core/throttle" "github.com/navaz-alani/concord/packet" "github.com/navaz-alani/concord/server" ) const ( KeyIPCallAlias...
// Copyright 2021 The PipeCD 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 agree...
// Copyright 2014,2015,2016,2017,2018,2019,2020,2021 <NAME> (<EMAIL>) // 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 a...
// Copyright 2018 SAP SE // // 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...
package api import ( "reflect" "strings" "github.com/fatih/structs" "github.com/go-apibox/utils" "xorm.io/core" "xorm.io/xorm" ) func Detail(c *Context, bean interface{}, params *Params) interface{} { return DetailJoin(c, bean, params, nil) } func SessionDetail(c *Context, session *xorm.Session, beans interf...
// Copyright 2015-present, Cyrill @ <EMAIL> and the CoreStore contributors // // 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 // // Unles...
package main import ( "fmt" "log" "strconv" "time" "golang.org/x/net/context" "../../ai" "../../playtak" "../../playtak/bot" "../../tak" ) const ( minThink = 5 * time.Second maxThink = time.Minute undoTimeout = 30 * time.Second defaultLevel = 2 docURL = "http://bit.ly/25h33rC" ) type Friendly stru...
package main import ( "fmt" "math/rand" "net/http" neturl "net/url" fp "path/filepath" . "strings" "sync" "time" "github.com/leesper/holmes" ) type Counts struct { sync.RWMutex page, mp3, download, html uint64 } func (n *Counts) Inc(key string) { n.Lock() defer n.Unlock() switch key { case "page": ...
// Copyright 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, ...
package main import ( "bufio" "errors" "fmt" "github.com/json-iterator/go" "github.com/luciferofwg/ESClient/global" "github.com/satori/go.uuid" "github.com/valyala/fasthttp" "io" "net/http" "os" "strings" "sync" "time" ) type Scan interface { Read() Write() } var ( host, template, typ string filespl...
/* Copyright © 2020 NAME HERE <EMAIL ADDRESS> 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 writi...
package functions import ( "fmt" "github.com/EMCECS/influx" "github.com/EMCECS/influx/query" "github.com/EMCECS/influx/query/execute" "github.com/EMCECS/influx/query/functions/storage" "github.com/EMCECS/influx/query/plan" "github.com/EMCECS/influx/query/semantic" "github.com/pkg/errors" ) const FromKind = "...
/* Copyright © 2021 <NAME> <<EMAIL>> 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, softw...
package ui import ( _ "github.com/bhollier/ui/pkg/ui/builtin" "github.com/bhollier/ui/pkg/ui/element" "github.com/faiface/pixel" "github.com/faiface/pixel/pixelgl" "log" "net/http" "sync" "time" ) // A UI design, built from an XML file type Design struct { sync.Mutex // The filesystem to use fs http.FileS...
/* Copyright 2015 - <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 writing, software distribute...
package conn import ( "net/http" "net/url" ) import ( "encoding/json" "fmt" "github.com/butlermatt/dslink/crypto" "github.com/butlermatt/dslink/log" "github.com/gorilla/websocket" "io/ioutil" "strings" "time" ) type dsResp struct { Id string `json:"id"` PublicKey string `json:"publicKey"` WsUri ...
package google import ( "errors" "fmt" "io/ioutil" "net/http" "strings" "time" c "authenticating-route-service/internal/configurator" h "authenticating-route-service/internal/httphelper" u "authenticating-route-service/internal/utils" . "authenticating-route-service/pkg/debugprint" "golang.org/x/oauth2" ...
package main import ( "bufio" "fmt" "io/ioutil" "net/http" "os" "os/exec" "path/filepath" "strings" "github.com/cbroglie/mustache" "gopkg.in/yaml.v2" ) // Template matches a base16 template file type Template struct { Name string Extension string Output string } func readTemplates(path string) ...
package monitor const ( // RedisPrefix 参数:business。参数1:bid;参数2:监控ID RedisPrefix = "monitor_stats_%d" // RedisDelArcInfo 稿件删除监控key RedisDelArcInfo = "monitor_stats_del_arc" // BusVideo 视频业务 BusVideo = 1 // BusArc 稿件业务 BusArc = 2 // NotifyTypeEmail 邮件通知 NotifyTypeEmail = 1 // NotityTypeSms 短信通知 NotityTypeSm...
package llrb // DeleteMin deletes the minimum-Key Node of the sub-Tree. func DeleteMin(nd *Node) (*Node, Interface) { if nd == nil { return nil, nil } if nd.Left == nil { return nil, nd.Key } if !isRed(nd.Left) && !isRed(nd.Left.Left) { nd = MoveRedFromRightToLeft(nd) } var deleted Interface nd.Left, del...
// Copyright 2016 <NAME> and The JoeFriday 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 o...
package main import ( "bufio" "bytes" "encoding/csv" "encoding/json" "errors" "fmt" "io/ioutil" "log" "net/http" "os" "strconv" "strings" ) const ( API_URL = "https://2swdepm0wa.execute-api.us-east-1.amazonaws.com/prod/NavaInterview/measures" CSV_NAME_INDEX = 0 CSV_WIDTH_INDEX = 1 CSV_DATA_T...
// Copyright 2022 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 ...
//go:build !nofuse && !(windows || plan9 || netbsd || openbsd) // +build !nofuse,!windows,!plan9,!netbsd,!openbsd package bazil import ( "context" "fmt" "path" "strings" "time" "bazil.org/fuse" "bazil.org/fuse/fs" "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/commands/filesystem/bazil/ipns" ...
// Copyright 2021, The Fuchsia 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 ag...
package prisma import ( "fmt" "net/http" "regexp" "time" "github.com/slover2000/prisma/trace" ) // Transport is an http.RoundTripper that traces the outgoing requests. // // Transport is safe for concurrent usage. type Transport struct { Client *InterceptorClient Base http.RoundTripper } // RoundTrip creat...
package loadbalancer import ( "github.com/1a1a11a/c2dnPrototype/src/myconst" "github.com/1a1a11a/graph" //"github.com/yourbasic/graph" "math" "strconv" ) type ParityBalancer struct { ChBalancer rebalance bool currParityMapping map[int]int prevParityMapping map[int]int } func (bl *ParityBalancer) re...
/* Copyright (C) THL A29 Limited, a Tencent company. All rights reserved. SPDX-License-Identifier: Apache-2.0 */ package chainedbft import ( "chainmaker.org/chainmaker-go/consensus/chainedbft/utils" "chainmaker.org/chainmaker-go/consensus/governance" "chainmaker.org/chainmaker/pb-go/v2/common" "chainmaker.org/ch...
package server import ( "context" "path/filepath" "grpc-csv-viewer/internal/pkg/csvreader" "grpc-csv-viewer/internal/pkg/csvviewer" "grpc-csv-viewer/internal/pkg/logger" "grpc-csv-viewer/internal/pkg/pathwalker" "github.com/pkg/errors" ) // NewCSVServer creates new CSV viewer gRPC server. func NewCSVServer(c...
package pcp import ( "fmt" "net" "os" "time" log "github.com/sirupsen/logrus" ) //Potentially add deviceAddr at a later stage func NewClient() (client *Client, err error) { gatewayAddr, err := client.GetGatewayAddress() if err != nil { return nil, err } udpAddr := &net.UDPAddr{IP: gatewayAddr, Port: 5351}...
package utilz import ( "regexp" "strings" ) /* The MIT License (MIT) Copyright (c) 2015 <NAME> Copyright (c) 2018 Ma_124, <github.com/Ma124> 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 wi...
// Package cmd defines all sub-commands of the command line interface // provided by mqtt-home-controller package cmd import ( "context" "encoding/json" "io/ioutil" "github.com/ghodss/yaml" "github.com/sirupsen/logrus" "github.com/spf13/cobra" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/ppacher/we...
/* Copyright 2016 <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 writing, software distribu...
package models import ( "fmt" "github.com/emirpasic/gods/sets/hashset" "github.com/kataras/golog" "wxapp/utils/conv" ) const ( SPECIAL_PAGE_SIZE int = 8 //专题页长度 ) //专题表 type Special struct { Id int64 `xorm:"not null pk autoincr BIGINT(20)"` //专题ID Title string `xorm:"VARCHAR(50)"` ...
package main import ( "bytes" "fmt" "os/exec" "strconv" "strings" "testing" "github.com/kelda/kelda/api/client" testerUtil "github.com/kelda/kelda/integration-tester/util" ) func TestRunShuffleJob(t *testing.T) { clnt, _, err := testerUtil.GetDefaultDaemonClient() if err != nil { t.Fatalf("couldn't get a...
/* Copyright 2021 The Knative 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, soft...