text
stringlengths
3.08k
10.4k
package script import ( "bytes" "time" "github.com/btcsuite/btcd/txscript" "github.com/transmutate-io/atomicswap/hash" ) type generatorBTC struct{} // NewGeneratorBTC returns a new bitcoin generator func NewGeneratorBTC() Generator { return generatorBTC{} } // If implement Generator func (gen generatorBTC) If(...
package main import ( "fmt" "github.com/jessevdk/go-flags" "github.com/jessevdk/go-operators/types" "go/ast" "go/build" "go/format" "go/parser" "go/token" "os" "path" "strings" ) type TypeCheck struct { Path string ImportPath string Package *types.Package FileSet *token.FileSet Par...
package img import ( "bytes" "github.com/psilva261/opossum" "github.com/psilva261/opossum/logger" "image" "image/png" "net/url" "testing" ) func init() { log.Debug = true } func TestParseDataUri(t *testing.T) { srcs := []string{"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP//yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",...
// Copyright © 2016 <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...
// Licensed to LinDB under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. LinDB licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compli...
package useragent type UserAgent struct { deviceID int platformID int browserID int browserVersion string botID int botVersion string osID int osVersion string partsMap map[string]string input string } var Devices = []string{ "Unknow...
package main import ( "flag" "fmt" "go/ast" "go/parser" "go/token" "log" "os" "path/filepath" "regexp" "strings" "unicode/utf8" "golang.org/x/tools/go/packages" "github.com/phelmkamp/metatag/directive" "github.com/phelmkamp/metatag/meta" ) const ( accessTemplate = "%s.%s" ) var ( goFileRegEx = reg...
/* Copyright 2021 <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 router import ( "net/http" "strings" "github.com/kataras/iris/v12/context" "github.com/kataras/iris/v12/core/netutil" ) type subdomainRedirectWrapper struct { // the func which will give us the root domain, // it's declared as a func because in that state the application is not configurated neither ran...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: webhook.proto package github import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import google_protobuf "github.com/golang/protobuf/ptypes/empty" import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) ...
package main import ( "context" "fmt" "math/rand" "sync" "time" "code.cloudfoundry.org/lager" "github.com/cloudfoundry-community/go-cfclient" "github.com/pivotal-cf/perm-test/cf" "github.com/pivotal-cf/perm-test/cmd" "github.com/satori/go.uuid" "golang.org/x/sync/semaphore" ) type DesiredExternalEnvironme...
// rtcchat2 calleePersistKey.go // Copyright 2013 <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package rtcchat2 import ( "bytes" "encoding/gob" "fmt" "github.com/steveyen/gkvlite" // see: https://github.com/steveyen/gkvlite...
package azurerm import ( "fmt" "log" "github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provide...
package tools import ( "crypto" "encoding/base64" "fmt" "github.com/miekg/dns" ) // ErrNoValidKeys represents an error returned when the session does not have valid keys var ErrNoValidKeys = fmt.Errorf("no valid keys") // SignSession represents an abstract signing session type SignSession interface { Context()...
// Package config validates flag values and command line arguments and // converts them to read-only type-safe values for mdrip. package config import ( "errors" "flag" "fmt" "os" "strconv" "time" "unicode" "github.com/golang/glog" "github.com/monopole/mdrip/base" ) const ( usageText = ` Extracts code bloc...
// Copyright 2020 MatrixOrigin. // // 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 ( "bufio" "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 } func rea...
// Package xheap contains extensions to the standard library package container/heap. package xheap import ( "github.com/bradenaw/juniper/internal/heap" "github.com/bradenaw/juniper/iterator" "github.com/bradenaw/juniper/xsort" ) // Heap is a min-heap (https://en.wikipedia.org/wiki/Binary_heap). Min-heaps are a col...
package common import ( "bytes" "net" "regexp" "strconv" "strings" "github.com/absolute8511/redcon" ) const ( // api used by data node APIAddNode = "/cluster/node/add" APIAddLearnerNode = "/cluster/node/addlearner" APIRemoveNode = "/cluster/node/remove" APIGetMembers = "/cluster/members" A...
package main import ( "github.com/samuelyuan/go-quake2/q2file" "sort" ) const ( clusterInvalidId = ClusterId(65535) ) type ClusterId uint16 type TreeLeaf struct { LeafIndex int // index in bsp leaf array Faces []int // contains face index in face array } type BSPTree struct { TreeLeaves []TreeLeaf } f...
package command import ( "flag" "fmt" "math" mathrand "math/rand" "os" "strings" codec "github.com/da-moon/go-codec" model "github.com/da-moon/go-dare/model" primitives "github.com/da-moon/go-primitives" stream "github.com/da-moon/go-stream" cli "github.com/mitchellh/cli" stacktrace "github.com/palantir/...
package v2 import ( "bytes" "context" "fmt" "io" tempo_io "github.com/grafana/tempo/pkg/io" "github.com/grafana/tempo/tempodb/backend" "github.com/grafana/tempo/tempodb/encoding/common" "github.com/klauspost/compress/zstd" ) type dataReader struct { contextReader backend.ContextReader pageBuffer []byte ...
package main import ( "fmt" "math" "github.com/icemanblues/advent-of-code/pkg/util" ) const ( dayNum = "23" dayTitle = "Crab Cups" ) const input string = "974618352" const test1 string = "389125467" func ParseCups(s string) []int { cups := make([]int, 0, len(s)) for _, r := range s { cups = append(cups,...
package pppoe import ( "fmt" ) // Code is the PPPoE msg code type Code uint8 const ( pppoeVerType byte = 0x11 ) // list of PPPoE msg code const ( CodeSession Code = 0 CodePADO Code = 7 CodePADI Code = 9 CodePADR Code = 25 CodePADS Code = 101 CodePADT Code = 167 ) // String return a string re...
// rssdld is a daemon which watches RSS feeds for new files and downloads them // to a specified directory. package main import ( "context" "flag" "fmt" "io" "io/ioutil" "log" "net/http" "net/url" "os" "path" "path/filepath" "sort" "strings" "time" "github.com/BranLwyd/rssdl/alert" "github.com/BranLwy...
package controller import ( "fmt" log "github.com/golang/glog" "github.com/soulseen/ks-scheduler/pkg/prioritize" "github.com/soulseen/ks-scheduler/pkg/sqlite" apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "...
package postgres import ( "fmt" "strings" v1 "github.com/stackrox/rox/generated/api/v1" "github.com/stackrox/rox/pkg/postgres/walker" "github.com/stackrox/rox/pkg/set" ) type joinTreeNode struct { currNode *walker.Schema children map[*joinTreeNode][]walker.ColumnNamePair } // addPathToTree adds the path to t...
/* Copyright 2011 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, software di...
package constants import ( "errors" "fmt" "math/big" "github.com/ethereum/go-ethereum/common" // Side-effect import to support DNS multiaddresses. _ "github.com/multiformats/go-multiaddr-dns" ) /** * General */ // TestChainID is the test (Ganache) chainId used for testing const TestChainID = 1337 // Ganac...
package fixtures import ( "os" "path/filepath" "strings" "testing" "time" "github.com/stretchr/testify/assert" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) var ( testVersionsDir string testVersionPSMDB string testVersionPSMDBStatic string = "3.4.13" testBSONMessage string = "test123" t...
package main import ( "fmt" "strconv" "strings" "github.com/jroimartin/gocui" ) type Question struct { ID string Title string Content string CodeFunc string Ex string } type Example struct { Ex string } var QP []Question var QP_EX []Example // var codeStr map[string]string var CODE_STR [...
package main import ( "math" "strconv" "github.com/gopherjs/gopherjs/js" ) type Editor struct { ele *js.Object ctx *js.Object defaultFont string wheelScrollSpeed float64 mousemoveRateLimit float64 textBuffer []string mouseDown bool scroll ...
package runners import ( "fmt" "strconv" "sync" "time" log "github.com/sirupsen/logrus" "github.com/twitter/scoot/runner" ) const UnknownRunIDMsg = "unknown run id %v" // NewStatusManager creates a new empty StatusManager func NewStatusManager(capacity int) *StatusManager { return &StatusManager{runs: make(m...
/* * MIT License * * Copyright (c) 2017 Milad (Mike) Taghavi <mitghi[at]me/gmail.com> * * 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 r...
/* * Copyright 2018 The NATS 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...
package common import ( "bytes" "crypto/hmac" "crypto/sha256" "encoding/hex" "errors" "fmt" "io/ioutil" "log" "net/http" "net/url" "regexp" "sort" "strings" "time" ) //RequestSigner holds request signer object type RequestSigner struct { UpdatedReq *http.Request RequestedDateTime string SignQu...
package gasprice import ( "context" "log" "sync" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) var zeroHash = common.Hash{} var pollWait = 5 * time.Second type trackerSubscription struct { ch <-chan struct{} unsubscribe func() } type Tracker interfa...
// MS Cognitive Services - Computer Vision API // OCR service package main import ( "bytes" "flag" "fmt" "log" "os" "strings" "encoding/json" "github.com/BurntSushi/toml" "github.com/mondora/cvision-go/cvision" "gopkg.in/resty.v0" //"./cvision" ) // FlagParams cmdline params type FlagParams struct { cmd...
package nvidia import ( "fmt" "os/exec" "strconv" "strings" log "github.com/golang/glog" "github.com/NVIDIA/gpu-monitoring-tools/bindings/go/nvml" "golang.org/x/net/context" pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1" ) var ( gpuMemory uint metric MemoryUnit ) type GPUStatus s...
// Copyright (c) 2020 The Bluge 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 agr...
// Copyright 2020-2022 Buf Technologies, 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...
package planar import ( "log" "math/big" "github.com/go-spatial/geom" ) const ( // Experimental testing produced this result. // For finding the intersect we need higher precision. // Then geom.PrecisionLevelBigFloat PrecisionLevelBigFloat = 110 ) func AreLinesColinear(l1, l2 geom.Line) bool { x1, y1 := l1...
package output import ( "bufio" "encoding/json" "fmt" "io" "strings" ) type jsonHandler struct { level Level yes bool out io.Writer ops int } type jsonObject struct { Type string `json:"type"` Label string `json:"label,omitempty"` Operation int `json:"operation,omitempty"...
// Based on https://github.com/labstack/echo/blob/v1/binder.go package binder import ( "encoding/json" "encoding/xml" "errors" "net/http" "reflect" "strconv" "strings" "github.com/labstack/echo/v4" ) func New() *binder { return &binder{} } type binder struct { maxMemory int64 } const ( defaultMaxMemory ...
package bux import ( "errors" ) // ErrCannotConvertToIDs is the error when the conversion fails from interface into type IDs var ErrCannotConvertToIDs = errors.New("cannot convert value to type IDs") // ErrMissingFieldID is an error when missing the id field var ErrMissingFieldID = errors.New("missing required fiel...
package cmdline import ( "sync" "unicode" "github.com/itchyny/bed/event" "github.com/itchyny/bed/mathutil" ) // Cmdline implements editor.Cmdline type Cmdline struct { cmdline []rune cursor int completor *completor completionResults []string completionIndex int typ ...
package partition import ( "log" "sync" "github.com/go-sif/sif" "github.com/hashicorp/go-multierror" ) // createOperablePartition creates a new Partition containing an empty byte array and a schema func createOperablePartition(maxRows int, schema sif.Schema) sif.OperablePartition { return createPartitionImpl(ma...
package session import ( "bytes" "crypto/rand" "encoding/gob" "encoding/hex" "encoding/json" "errors" "fmt" "github.com/wuciyou/dogo/common" "github.com/wuciyou/dogo/dglog" "github.com/wuciyou/dogo/session/handle" "os" "strings" "sync" "time" ) type SessionHandle interface { Open() error Close() Read...
package app import ( "os" "time" "github.com/joho/godotenv" "github.com/domgolonka/foretoken/pkg/utils/ip" "github.com/domgolonka/foretoken/app/data" "github.com/domgolonka/foretoken/config" "github.com/domgolonka/foretoken/lib/scrapers/email/disposable" "github.com/domgolonka/foretoken/lib/scrapers/email/f...
/** * @Time : 2019-07-04 16:17 * @Author : <EMAIL> * @File : transport * @Software: GoLand */ package pod import ( "context" "github.com/dgrijalva/jwt-go" kitjwt "github.com/go-kit/kit/auth/jwt" "github.com/go-kit/kit/endpoint" "github.com/go-kit/kit/log" kithttp "github.com/go-kit/kit/transport/http" "gi...
package core import ( "bytes" "fmt" "log" "os" "reflect" "strconv" "strings" "time" "github.com/Wariie/go-woxy/com" "github.com/gin-contrib/logger" "github.com/gin-gonic/gin" "github.com/rs/zerolog" zLog "github.com/rs/zerolog/log" ) func launchServer() { fmt.Println("GO-WOXY Core - Starting") //AUTH...
package main import ( "encoding/json" "fmt" "io/ioutil" "net/url" "os" "path/filepath" "github.com/ChimeraCoder/anaconda" ) const TWEET_MAX_CHARS = 280 type savedata struct { LatestId int64 `json:"latest_id"` } type Twitter struct { api *anaconda.TwitterApi //startedAt time.Time hashtag string savefil...
package blockchain import ( "encoding/json" "errors" "net/http" "sync" "time" "github.com/YushinJung/NomadCoin/utils" "github.com/YushinJung/NomadCoin/wallet" ) const ( minerReward int = 50 ) type mempool struct { Txs map[string]*Tx m sync.Mutex } var m *mempool = &mempool{} var memOnce sync.Once func...
/* 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 log import ( "fmt" "io" "log" "os" "github.com/TwinProduction/go-color" ) // Level is a log level type Level uint8 // Available log levels const ( LevelDebug Level = iota LevelInfo LevelWarn LevelError levelCount ) // A Logger wraps multiple loggers (one per log level). // Individual loggers may ...
package xformer import ( "encoding/json" "fmt" "regexp" awsEvents "github.com/aws/aws-lambda-go/events" jmesPath "github.com/jmespath/go-jmespath" ) type xformRegexpResults struct { re *regexp.Regexp reErr error capturedNames map[string]string } // XFormableData is the struct that support...
// Copyright Istio 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 wri...
// Copyright 2019 dfuse Platform 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 agre...
package main import ( "testing" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var defaultName = "defaultIngressName" var defaultNamespace = "defaultIngressNamespace" var defaultSecret = "defaultSecret" var collisionName = "collisionName" var testNamespace = "testNamespace" ...
package defs const ( SkillIDNone = 0x00 SkillIDBrawling = 0x01 SkillIDClimb = 0x02 SkillIDClipPistol = 0x03 SkillIDKnifeFight = 0x04 SkillIDPugilism = 0x05 SkillIDRifle = 0x06 SkillIDSwim = 0x07 SkillIDKnifeThrow = 0x08 SkillIDPerception ...
/* Package fuzzydice provides a mechanism for searching fields within structures using the Sørensen–Dice coefficient. */ package fuzzydice import ( "errors" "fmt" "reflect" "sort" "strings" ) // FuzzyDice describes a FuzzyDice instance with loaded objects. A single FuzzyDice instance can contain structures of //...
package hashpipe import ( "bytes" "crypto/rand" "crypto/sha256" "fmt" "io" "net/http/httptest" "testing" "github.com/stretchr/testify/assert" ) var testcases = []string{ "foo", "bar", "", "eyjafjallajökull", `Q[F$AAxEdyk<H*|U!Ef}T1Za>_s=fRO~)akWdQb%mu^qxuO06+`, `R)cZ;mPYigAS&3H9&;98iv{i/VmFqlv7SZd7=&)>...
package dbs import ( "database/sql" ) type dbPlatform interface { getDriverName() string getDBConnectionString(server string, port int, user string, password string, dbName string) string chainCommands(commands ...string) string // Column attributes declarations getTypeDeclaration(col *Column) string getUniqu...
/* Copyright 2017 The Nuclio 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...
package xray import ( "encoding/json" "net" "net/http" "strings" "time" ) // replacer is used to remove `(`, `)`, `*` from segment's name. // only `)` is not allowed on X-Ray though. var replacer = strings.NewReplacer("(", "", ")", "", "*", "") // Segment is span data for AWS X-Ray. type Segment struct { ser...
package main import ( "context" "os" "time" "github.com/namsral/flag" "github.com/govirtuo/kube-ns-suspender/engine" "github.com/govirtuo/kube-ns-suspender/metrics" "github.com/govirtuo/kube-ns-suspender/pprof" "github.com/govirtuo/kube-ns-suspender/webui" "github.com/rs/zerolog/log" "k8s.io/client-go/kube...
package formatter import ( "bytes" "fmt" "sort" "strings" "github.com/sirupsen/logrus" ) const ( FieldTime = "time" FieldLevel = "level" FieldCalledFile = "called_file" FieldCalledFunction = "called_function" FieldMessage = "message" ) // Formatter - logrus formatter, impleme...
package renter import ( "fmt" "path/filepath" "strings" "sync" "gitlab.com/NebulousLabs/errors" "gitlab.com/SkynetLabs/skyd/skymodules" "go.sia.tech/siad/types" ) // managedUpdateFilesInDir will update all of the files in the directory to have // recent health information, then it will update the metadata of ...
// Copyright 2021 iLogtail 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 ...
// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2019 Intel Corporation package rsu import ( "errors" "fmt" "io" "os" "os/exec" "path/filepath" "time" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // copy image func copyRTLFile(node string, fil...
// Copyright 2020 Envoyproxy 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...
package common import "time" import "github.com/aws/aws-sdk-go/service/ec2" const ConfigNotSetError = "This feature hasn't been configured correctly. Please contact the CLP Team" type ProjectName struct { Project string `json:"project"` } type OpenshiftBase struct { Project string `json:"project"` ClusterId st...
// https://docs.microsoft.com/zh-cn/windows/win32/controls/combo-boxes?view=vs-2017 package wingui import ( "errors" "github.com/lxn/win" "log" "syscall" "unsafe" ) // ComboBox a ComboBox widget for Dialog. type ComboBox struct { WindowBase // OnSelChange OnSelChange func() // TOxDO: notify method } // Wnd...
package ayd_test import ( "bytes" "fmt" "net/url" "regexp" "testing" "time" "github.com/macrat/ayd/lib-ayd" ) func ExampleLogger() { target, _ := url.Parse("foobar:your-plugin-url") logger := ayd.NewLogger(target) logger.Healthy("hello world") } func ExampleLogger_setExtraValues() { logger := ayd.NewLo...
package transcoder import ( "bytes" "context" "errors" "io" "net/http" "time" "github.com/ericxtang/m3u8" "github.com/golang/glog" "github.com/livepeer/lpms/stream" "github.com/nareix/joy4/av" joy4rtmp "github.com/nareix/joy4/format/rtmp" cmap "github.com/orcaman/concurrent-map" ) var ErrTranscoderConnRe...
package index import ( "bytes" "context" "encoding/json" "errors" "flag" "fmt" "github.com/cenkalti/backoff/v4" es "github.com/elastic/go-elasticsearch/v7" // "github.com/elastic/go-elasticsearch/v7/estransport" "github.com/elastic/go-elasticsearch/v7/esutil" "github.com/sfomuseum/go-flags/flagset" "github...
package powerlogger import ( "context" "log" "time" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/baggage" "go.opentelemetry.io/otel/exporters/otlp" // "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/metric/controller/push" "go.opente...
package code import ( "fmt" "path" ice "github.com/shylinux/icebergs" "github.com/shylinux/icebergs/base/mdb" "github.com/shylinux/icebergs/base/nfs" "github.com/shylinux/icebergs/base/web" kit "github.com/shylinux/toolkits" ) func _volcanos(file ...string) string { return path.Join(ice.USR_VOLCANOS, path.Jo...
package main import ( "flag" "image/color" _ "image/jpeg" _ "image/png" "log" "math" "github.com/unixpickle/model3d/model2d" "github.com/unixpickle/model3d/model3d" "github.com/unixpickle/model3d/toolbox3d" "github.com/unixpickle/essentials" "github.com/unixpickle/model3d/render3d" ) func main() { var o...
package csvutil import ( "encoding" "encoding/csv" "fmt" "io" "reflect" "regexp" "strconv" "strings" ) // Decoder manages reading data from a CSV into tagged structs. type Decoder struct { r *csv.Reader mappings []csvField numColumns int } // NewDecoder initializes itself with the headers of th...
package ehloader import ( "fmt" "github.com/firefoxchan/local-ehentai/pkg/cache" "strconv" "strings" "time" ) func Search(searchTags map[TagK]map[TagV]struct{}, offset, limit int) []*Gallery { indexMu.RLock() defer indexMu.RUnlock() matches := make([][]int, 0) for k, vs := range searchTags { switch k { c...
package gooh import ( "regexp" "strings" ) type RouteHandler func(*App, *Request, *Response, map[string]string) error type Route struct { Version *Version Method string Path string } func (r Route) String() string { var v string if r.Version != nil { v = r.Version.String() } return strings.Trim(v+" ...
// Package datachannel handles the // data sink between the FTP Server and the client package datachannel import ( "crypto/tls" "fmt" "io" "net" log "github.com/sirupsen/logrus" "github.com/mindflavor/ftpserver2/ftp/portassigner" ) // SinkFunction is the function that will be called // when the client connects...
package secp256k1 import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "fmt" "github.com/centrifuge/go-centrifuge/config" "github.com/centrifuge/go-centrifuge/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github....
package main /* MIT License Copyright (c) 2019 <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, cop...
//go:build linux // +build linux package posix import ( "errors" "os" "reflect" "syscall" "unsafe" ) type Flag int // https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipc.h const ( /* resource get request flags */ IPC_CREAT Flag = 00001000 /* create if key is nonexistent */ //nolint:golint,s...
package models type Bill struct { ID string `json:"rqestNo"` // "6474270" Result string `json:"oppSeNm"` // "비공개" Status string `json:"prcsStsNm"` // "통지완료" Requester string `json:"bllrNm"` // "투명사회를위한정보공개센터" ChargeYn string `json:"chargeYn"` // "N" ChkrNmpn string `json:"chkrN...
package syscalls import ( "syscall" "unsafe" ) var ( modiphlpapi = syscall.NewLazyDLL("iphlpapi.dll") procCreateIpForwardEntry = modiphlpapi.NewProc("CreateIpForwardEntry") procDeleteIpForwardEntry = modiphlpapi.NewProc("DeleteIpForwardEntry") procGetIpForwardTable = modiphlpapi.NewProc("GetIpForwardTable")...
package add import ( "fmt" "io" "github.com/spf13/cobra" "k8s.io/client-go/tools/clientcmd" kconf "k8s.io/kubectl/pkg/cmd/config" cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/util/i18n" "k8s.io/kubectl/pkg/util/templates" ) var ( createAuthInfoLong = fmt.Sprintf(templates.LongDesc(` Sets a us...
package main import ( // "github.com/axamon/nefertiti/algoritmi" "context" "github.com/gonum/matrix/mat64" "gonum.org/v1/plot" "gonum.org/v1/plot/plotter" "gonum.org/v1/plot/plotutil" "gonum.org/v1/plot/vg" "fmt" "log" "math/rand" "time" kalman "github.com/ryskiwt/go-kalman" ) func nefer(ctx context.Co...
// Copyright (c) 2021 Terminus, 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 agree...
package protocol import ( "diceserver/pkg/constant" ) type EnterDeskInfo struct { DeskPos int `json:"deskPos"` Uid int64 `json:"acId"` Nickname string `json:"nickname"` IsReady bool `json:"isReady"` Sex int `json:"sex"` IsExit bool `json:"isExit"` HeadUrl string `json:"headURL"` Sco...
package pkg import ( "errors" "fmt" "net/http" "net/url" "strconv" "github.com/artifacthub/hub/cmd/hub/handlers/helpers" "github.com/artifacthub/hub/internal/api" "github.com/artifacthub/hub/internal/hub" "github.com/artifacthub/hub/internal/pkg" "github.com/go-chi/chi" "github.com/rs/zerolog" "github.com...
package handler import ( "context" "github.com/gin-gonic/gin" "github.com/pkg/errors" "github.com/whereabouts/sdk/httpserver/handler/result" "github.com/whereabouts/sdk/logger" "net/http" "reflect" ) func init() { } type requestKey struct{} type responseKey struct{} type ginContextKey struct{} var ( context...
package dice import ( "fmt" "log" "math/rand" "regexp" "sort" "time" ) //DiceInfo contains the information about a roll type DiceInfo struct { NumberOfDice int TypeOfDice int HighRoll bool LowRoll bool KeepDice int Explodes bool ExplodesOn []int } func newDiceInfo() DiceInfo { di :...
package recipes import ( "os" "time" "github.com/coreos/go-etcd/etcd" "gopkg.in/errgo.v1" ) // Lock wraps all the metadata for a lock. type Lock struct { Expired chan bool Options LockOptions client *etcd.Client key string node *etcd.Node } // LockOptions specifies the options set for a lock. type ...
package rrpubsub import ( "context" "fmt" "sync" "time" "github.com/gomodule/redigo/redis" ) type state int const ( initial state = iota disconnected connected ) type eventType int const ( connectedEvent eventType = iota disconnectedEvent messageEvent ) type command struct { cmd string args []strin...
package restapi import ( "errors" "runtime" "strings" "github.com/go-openapi/swag" "github.com/minio/console/models" "github.com/minio/madmin-go" k8sErrors "k8s.io/apimachinery/pkg/api/errors" ) var ( // Generic error messages errorGeneric = errors.New("an error occurred, please try again") e...
// Package generic provides code generator that takes go sources of a generic-like go code and // generates concrete implementation by substituting predefined type variables (T1,.., T5) to a given type names package generic import ( "errors" "fmt" "go/ast" "go/parser" "go/printer" "go/token" "io" "strings" ) ...
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package runner import ( "os" "reflect" "github.com/tedsuo/ifrit" "github.com/tedsuo/ifrit/grouper" ) /* NewParallel starts it's members simultaneously. Use a parallel group to describe a set of concurrent but independent proces...