text
stringlengths
3.08k
10.4k
package paillier import ( "crypto/rand" "fmt" "math/big" ) // PublicKey is used to perform encryption and homomorphic operations type PublicKey struct { N *big.Int g *big.Int N2 *big.Int } // PrivateKey is used to perform decryption type PrivateKey struct { mu *big.Int lambda *big.Int pk *PublicKe...
/* * Copyright (c) 2020, Oracle and/or its affiliates. * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ package utils import ( "context" "encoding/json" "fmt" coh "github.com/oracle/coherence-operator/api/v1" "github.com/pkg/errors" corev1 "k8s.io/...
// Copyright 2014 Wandoujia Inc. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package main import ( "encoding/json" "flag" "fmt" "os" "os/signal" "path" "syscall" "github.com/ngaut/go-zookeeper/zk" "github.com/ngaut/zkhelper" "github.com/siddontang/xcodis/utils" "net/http" _...
package _package import ( "sync" "time" "github.com/Ishan27g/go-utils/mLogger" "github.com/emirpasic/gods/trees/avltree" "github.com/gin-gonic/gin" "github.com/hashicorp/go-hclog" "github.com/jedib0t/go-pretty/v6/table" ) func Clear() { if reg != nil { reg.clear() } } type MetaData interface{} type PingM...
// MIT License // // Copyright (c) 2018 <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, c...
package service import ( "context" "io" "io/ioutil" "os" "path" "strings" "testing" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/swarm/runtime" "github.com/docker/docker/integrati...
package api import ( "errors" "net/http" "strconv" "time" "github.com/mafanr/juz/api/filter" "github.com/mafanr/juz/api/manage" "github.com/mafanr/juz/api/req" "github.com/mafanr/juz/api/stats" "github.com/mafanr/juz/misc" "github.com/mafanr/g" "go.uber.org/zap" "github.com/prometheus/client_golang/pro...
// // MIT License // // Copyright (c) 2020-2021 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, mod...
/* Copyright 2021 The KodeRover 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, s...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ec2 import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogsRequest type DescribeFlowLogsInput str...
package logrus_fluent import ( "github.com/fluent/fluent-logger-golang/fluent" "github.com/sirupsen/logrus" ) const ( // TagName is struct field tag name. // Some basic option is allowed in the field tag, // // type myStruct { // Value1: `fluent:"value_1"` // change field name. // Value2: `fluent:"...
package provision import ( "bytes" "fmt" "text/template" "github.com/docker/machine/libmachine/auth" "github.com/docker/machine/libmachine/drivers" "github.com/docker/machine/libmachine/engine" "github.com/docker/machine/libmachine/log" "github.com/docker/machine/libmachine/mcnutils" "github.com/docker/machi...
package main import ( "io/ioutil" "os" "github.com/gabstv/ecs/v2" "github.com/gabstv/primen" "github.com/gabstv/primen/core" "github.com/gabstv/primen/core/debug" "github.com/gabstv/primen/io" "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/ebitenutil" "github.com/urfave/cli" ) var ( colorT...
package handler import ( "bytes" "encoding/json" "fmt" "github.com/go-chi/chi" "github.com/nlopes/slack" "github.com/spf13/viper" "go.uber.org/zap" "io/ioutil" "log" "net/http" "net/url" "os" "strings" ) func init() { // Logger logger, _ := zap.NewProduction() defer logger.Sync() viper.SetDefault("S...
// Package proxy is a cli proxy package proxy import ( "os" "strings" "time" "github.com/micro/cli" "github.com/micro/go-micro" "github.com/micro/go-micro/client" "github.com/micro/go-micro/config/options" "github.com/micro/go-micro/proxy" "github.com/micro/go-micro/proxy/grpc" "github.com/micro/go-micro/pr...
package remote import ( "encoding/json" "errors" "fmt" "io" "io/ioutil" "os" "sort" "time" "github.com/Masterminds/semver" "github.com/cnabio/cnab-go/bundle" ) const ( // APIVersionV1 is the v1 API version for index and repository files. APIVersionV1 = "v1" // IndexPath is the name of the index file fo...
package services import ( "errors" "github.com/jfrog/jfrog-client-go/artifactory/auth" rthttpclient "github.com/jfrog/jfrog-client-go/artifactory/httpclient" "github.com/jfrog/jfrog-client-go/artifactory/services/utils" clientutils "github.com/jfrog/jfrog-client-go/utils" "github.com/jfrog/jfrog-client-go/utils/...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package config import ( "testing" "github.com/stretchr/testify/require" "github.com/trustbloc/fabric-peer-ext/pkg/config/ledgerconfig/config" peermocks "github.com/trustbloc/sidetree-fabric/pkg/peer/mocks" ) c...
package main import ( "encoding/base64" "errors" "fmt" "github.com/kardianos/service" "log" "net/http" "net/http/cookiejar" "net/url" "os" "strings" "time" ) var logger service.Logger func PreventCheckRedirect(req *http.Request, via []*http.Request) error { return errors.New("stopped redirects") } type ...
package tilepack import ( "bytes" "compress/gzip" "errors" "fmt" "io" "io/ioutil" "log" "math/rand" "net/http" "os" "strings" "time" ) type HTTPError struct { Code int Status string } func (e *HTTPError) Error() string { return e.String() } func (e *HTTPError) String() string { return e.Status } ...
package api import ( "github.com/devtron-labs/lens/pkg" "encoding/json" "go.uber.org/zap" "net/http" "strconv" ) type RestHandler interface { GetDeploymentMetrics(w http.ResponseWriter, r *http.Request) ProcessDeploymentEvent(w http.ResponseWriter, r *http.Request) ResetApplication(w http.ResponseWriter, r *h...
package cfdtunnel import ( "os" "os/exec" "strings" "time" log "github.com/sirupsen/logrus" "gopkg.in/ini.v1" ) const ( localClientDefaultUrl = "127.0.0.1" localClientDefaultPort = "5555" ) var ( // LogLevel sets the level of each log LogLevel = log.WarnLevel // IniConfigFile sets the path of config fil...
/* Copyright 2021 The routerd 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, sof...
package confirmer import ( . "github.com/iotaledger/iota.go/trinary" "github.com/op/go-logging" "github.com/unioproject/tanglebeat/lib/multiapi" "github.com/unioproject/tanglebeat/lib/utils" "nanomsg.org/go-mangos" "nanomsg.org/go-mangos/protocol/sub" "nanomsg.org/go-mangos/transport/tcp" "strings" "sync" "t...
package main import ( "encoding/json" "io/ioutil" "log" "os" "strconv" "strings" "github.com/aws/aws-sdk-go/aws/session" "github.com/awslabs/goformation/cloudformation" ) /** The Environment Variable Saga.. There are two types of environment variables - Lambda runtime variables starting with "AWS_" and ...
// Package qpack provides fast data (de)serializing. // Maintainer: <NAME> / Transceptor Technology package qpack import ( "encoding/binary" "encoding/json" "fmt" "reflect" ) // Pack returns a byte array containing the serialized data for argument v. func Pack(v interface{}) ([]byte, error) { b := make([]byte, 0...
package syntax import "testing" func TestStrSplit(t *testing.T) { t.Parallel() AssertCodesEvalToSameValue(t, `[[], "B", "CD"] `, `//seq.split("A","ABACD")`) AssertCodesEvalToSameValue(t, `["ABAC", []] `, `//seq.split("D","ABACD")`) AssertCodesEvalToSameValue(t, `["this", "is", "a", "test"]`, `//seq.spli...
package ssi import ( "sync" "time" "github.com/findy-network/findy-agent/agent/accessmgr" "github.com/findy-network/findy-agent/agent/managed" "github.com/golang/glog" ) var maxOpened = 10 // SetWalletMgrPoolSize sets pool size, i.e. how many wallets can kept open in // the same time. This should be set at the...
package txscript_test import ( "errors" "fmt" "testing" "github.com/btcsuite/btcd/btcec" "github.com/fatzero/mass-core/config" "github.com/fatzero/mass-core/consensus" "github.com/fatzero/mass-core/massutil" "github.com/fatzero/mass-core/txscript" "github.com/fatzero/mass-core/wire" "github.com/stretchr/tes...
package modules // The Skynet Backup subsystem handles persistence for creating and reading // skynet backup data. These backups contain all the information needed to // restore a Skyfile with the original Skylink. import ( "bytes" "fmt" "io" "path/filepath" "strings" "gitlab.com/NebulousLabs/Sia/persist" "gi...
package sftest import structform "github.com/urso/go-structform" var Samples = concatSamples( SamplesPrimitives, SamplesArr, SamplesObj, SamplesCombinations, ) var SamplesPrimitives = []Recording{ // simple primitives {NilRec{}}, // "null" {BoolRec{true}}, // "true" {BoolRec{false}}, // "false" {Stri...
package regx import ( "bytes" "regexp" ) var ( /** "CREATE TABLE `position` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',", "CREATE TABLE `mydb.position`(`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',", "CREATE TABLE `mydb`.`position`(`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',...
// Copyright 2018-2020 CERN // // 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 wr...
package main import ( "strings" "fmt" "log" "github.com/jmoiron/sqlx" ) type InOutType struct { Name string Type string } type summary struct { Enums []Enum Tables []Table Views []Table Functions []Function } func NewSummaryFromDB(db *sqlx.DB) (*summary, error) { s := &summary{} // Populat...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package clouddirectory import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) // Please also see https://docs.aws.amazon.com/goto/WebAPI/clouddire...
package composition import ( "errors" "github.com/veandco/go-sdl2/sdl" "strconv" "strings" ) var malformed error = errors.New("malformed expression") /* top-left: 0 top-mid: 1 top-right 2 mid-left 3 mid-mid 4 mid-right 5 bottom-left 6 bottom-mid 7 bottom-right 8 */ type Vector2D struct { X ...
package sfu import ( "encoding/json" "sync" "time" "github.com/pion/webrtc/v3" "github.com/rs/zerolog" ) type mixer struct { sync.RWMutex sliceIndex map[string]*mixerSlice // per remote track id r *room } type signalingState int const ( signalingOk signalingState = iota signalingRetryNow signal...
package api import ( "context" "fmt" "os" "time" "github.com/go-logr/logr" "github.com/labstack/echo" "github.com/labstack/echo/middleware" "github.com/nats-io/nats.go" nmsdk "gitlab.com/timeterm/timeterm/nats-manager/pkg/sdk" authn "gitlab.com/timeterm/timeterm/backend/auhtn" "gitlab.com/timeterm/timete...
/* MIT License Copyright (c) 2019 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distrib...
// Copyright 2017 CoreOS 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 ...
package main import ( "context" "flag" "fmt" "io" "io/ioutil" "log" "os" "regexp" "runtime" "strings" "time" "github.com/insidersec/insider" "github.com/insidersec/insider/engine" "github.com/insidersec/insider/rule" ) const ( npmAdvisoryURL string = "https://registry.npmjs.org/-/npm/v1/security/audit...
package filter import ( "fmt" "kubesphere.io/fluentbit-operator/api/fluentbitoperator/v1alpha2/plugins" ) // +kubebuilder:object:generate:=true // Kubernetes filter allows to enrich your log files with Kubernetes metadata. type Kubernetes struct { // Set the buffer size for HTTP client when reading responses fro...
// Copyright (c) 2017 Cisco and/or its affiliates. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
package csscomp import ( "fmt" "regexp" "strconv" "strings" ) func minColor(hexCol string) string { if hexCol[1] == hexCol[2] && hexCol[3] == hexCol[4] && hexCol[5] == hexCol[6] { return "#" + string(hexCol[1]) + string(hexCol[3]) + string(hexCol[5]) } return hexCol } func quitQuotes(str string) string { s...
// Copyright 2016 Keybase, Inc. All rights reserved. Use of // this source code is governed by the included BSD license. package service import ( "encoding/json" "fmt" "strings" "golang.org/x/net/context" "github.com/keybase/client/go/gregor" "github.com/keybase/client/go/libkb" gregor1 "github.com/keybase/c...
// Copyright 2015 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...
// // Copyright (c) 2018- yutopp (<EMAIL>) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // package amf0 import ( "time" ) type testCase struct { Name string Value interface{} Binary []byte } var n...
// +build gocv package main import ( "fmt" "image" "image/color" "log" "net/http" "os" "time" "github.com/hybridgroup/mjpeg" "github.com/jakefau/rpi-devices/dev" "github.com/jakefau/rpi-devices/util" "github.com/stianeikeland/go-rpio" "gocv.io/x/gocv" ) const ( pinIn1 = 17 pinIn2 = 23 pinIn3 = 27 pi...
package committeestate import ( "fmt" "github.com/incognitochain/incognito-chain/common" "math/rand" "sort" ) type AssignRuleProcessor interface { Process(candidates []string, numberOfValidators []int, randomNumber int64) map[byte][]string Version() int } //VersionByBeaconHeight get version of committee engine...
// Package vbptc implements the Variable length BPTC for embedded signalling package vbptc import ( "errors" "fmt" ) var ( // See page 136 of the DMR AI. spec. for the generator matrix. hamming_16_11_generator_matrix = []byte{ 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, ...
package chem import ( "database/sql" "fmt" "reflect" "strings" ) type nullableInt struct { value int valid bool } type SelectStmt struct { columns []Column filters []Filter orderings []Ordering limit nullableInt offset nullableInt } func Select(columnThings ...Columnser) SelectStmt { columns ...
// Package repository hold actions on the Bitbucket repositories package repository import ( "errors" "fmt" "github.com/daeMOn63/bitadmin/helper" "github.com/daeMOn63/bitadmin/settings" "github.com/urfave/cli" ) // BranchingModelCommand define base struct for BranchingModel actions type BranchingModelCommand str...
// Copyright 2021 The Audit 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 ...
package exasol import ( "database/sql/driver" "fmt" "strings" "testing" "github.com/stretchr/testify/assert" ) func TestNamedValuesToValues(t *testing.T) { namedValues := []driver.NamedValue{{Name: ""}, {Name: ""}} values, err := namedValuesToValues(namedValues) assert.Equal(t, []driver.Value{driver.Value(ni...
package driver import ( "fmt" "log" "strconv" "time" "github.com/stardustapp/dustgo/lib/base" "github.com/stardustapp/dustgo/lib/extras" "github.com/stardustapp/dustgo/lib/inmem" "github.com/stardustapp/dustgo/lib/toolbox" "github.com/nlopes/slack" ) func buildArrayFolder(in ...string) base.Folder { folde...
// Copyright © 2021 Alibaba Group Holding Ltd. // // 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 refs import ( "fmt" "io" "sort" "github.com/charmbracelet/bubbles/list" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/soft-serve/git" "github.com/charmbracelet/soft-serve/internal/tui/style" "github.com/charmbracelet/soft-serve/tui/common" ) type RefMsg = *git.Reference type ite...
// Copyright 2019 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 ...
package gcppubsub import ( "bytes" "context" "encoding/json" "errors" "fmt" "sync" "time" "cloud.google.com/go/pubsub" "github.com/RichardKnop/machinery/v1/brokers/iface" "github.com/RichardKnop/machinery/v1/common" "github.com/RichardKnop/machinery/v1/config" "github.com/RichardKnop/machinery/v1/log" "g...
// @Author : Lik // @Time : 2021/2/1 package main import ( "GCSprout/grpc/user" "context" "fmt" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "io" "log" "os" "testing" "time" ) const ( addr...
// documentation: // https://dev.mysql.com/doc/internals/en/table-map-event.html package mysql import ( "bytes" "encoding/binary" "fmt" "io" ) type Bitfield []byte func (bits Bitfield) isSet(index uint) bool { return bits[index/8]&(1<<(index%8)) != 0 } type ColumnType struct { column_type FieldType name ...
package monitorapi import ( "fmt" "strings" "k8s.io/apimachinery/pkg/util/sets" corev1 "k8s.io/api/core/v1" ) func LocatePod(pod *corev1.Pod) string { return fmt.Sprintf("ns/%s pod/%s node/%s uid/%s", pod.Namespace, pod.Name, pod.Spec.NodeName, pod.UID) } func LocatePodContainer(pod *corev1.Pod, containerName...
//(C) Copyright [2020] Hewlett Packard Enterprise Development LP // //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...
package store import ( "fmt" "os" "sync" "time" "github.com/douban/gobeansdb/cmem" ) const ( MaxNumChunk = 998 MaxNumSplit = 998 ) type DataStore struct { writeLock sync.Mutex flushLock sync.Mutex id int home string chunks [MaxNumChunk]DataChunk //块列表:ID从0到997 oldHead int newHead int write...
package tiger import ( "fmt" "io" "strings" "testing" "unsafe" ) type Test struct { out string in string } var golden = []Test{ {"3293ac630c13f0245f92bbb1766e16167a4e58492dde73f3", ""}, {"77befbef2e7ef8ab2ec8f93bf587a7fc613e247f5f247809", "a"}, {"2aab1484e8c158f2bfb8c5ff41b57a525129131c957b5f93", "abc"}, ...
package main import ( "bufio" "fmt" "io" "os" "os/exec" "sync" "time" "strings" ) func NewPackages(update bool, pkgs string) (*Packages, error) { p := &Packages{ pkgs: make(map[string]bool), nodes: make([]*Node, 0), names: make(map[string]bool), update: update, } if !update { os.RemoveAll("...
package planner import ( "../gnn" "../miris" "../predicate" "fmt" "log" "sort" ) const QThreads int = 8 func GetQSamplesSegment(ppCfg miris.PreprocessConfig, segment miris.Segment, freq int, modelPath string, predFunc predicate.Predicate) []float64 { log.Printf("[plan-q] begin %s @ %d", segment.FramePath, fr...
package main import ( "context" "flag" "fmt" "log" "net" "unsafe" pgx "github.com/jackc/pgx/v4" "github.com/jackc/pgx/v4/pgxpool" "github.com/valyala/fasthttp" "fasthttp/src/common" "fasthttp/src/templates" ) var ( db *pgxpool.Pool ) const worldSelectSQL = "SELECT id, randomNumber FROM World WHERE id =...
package serve import ( "net/http" "strconv" "strings" "github.com/openshift/ocm-agent/pkg/consts" "github.com/openshift/ocm-agent/pkg/ocm" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" kcmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg...
/* 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...
/* Copyright 2021 Adobe. All rights reserved. This file is licensed to you 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 processing // DCSO FEVER // Copyright (c) 2018, 2020, DCSO GmbH import ( "bufio" "net" "os" "sync" "github.com/DCSO/fever/types" "github.com/DCSO/fever/util" log "github.com/sirupsen/logrus" "github.com/yl2chen/cidranger" ) // IPAlertJSONProviderSrcIP is an AlertJSONProvider for source IP address m...
/* Copyright 2021 The KubeOne 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, sof...
package main // // manages miner information // import "log" import "math/big" import "time" // the queues are no longer used. // it turns out that it is more accurate to estimate // hashrate using the current easing technique const QUEUE_LEN = 8 type AverageQueue struct { entries []float64 } func (self *Average...
/* Copyright 2018 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 ot import ( "fmt" "github.com/fmpwizard/go-quilljs-delta/delta" "github.com/google/uuid" ) type deltaWithClient struct { d delta.Delta clientId *uuid.UUID } type File struct { id uint32 d delta.Delta version uint32 // Reverts serve 2 purposes: // // * Provide revert function //...
package prober import ( "context" "crypto/tls" "net" "net/http" "net/http/httptrace" url2 "net/url" "strconv" "time" "github.com/prometheus/client_golang/prometheus" klog "k8s.io/klog/v2" ) var ( httpRequests = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "health_http_requests_total", H...
package geometry import ( "encoding/json" "errors" "fmt" "github.com/skelterjohn/geom" "github.com/tidwall/gjson" "github.com/whosonfirst/go-whosonfirst-geojson-v2" "github.com/whosonfirst/go-whosonfirst-geojson-v2/utils" _ "log" ) type Polygon struct { geojson.Polygon `json:",omitempty"` Exterior ge...
/** * Copyright (c) 2019 - Present – Thomson Licensing, SAS * All rights reserved. * * This source code is licensed under the Clear BSD license found in the * LICENSE file in the root directory of this source tree. */ package cmd import ( "context" "errors" "fmt" "os" "os/signal" "syscall" "time" "gith...
// Copyright 2021 IBM Corp. // SPDX-License-Identifier: Apache-2.0 package builder import ( "embed" "errors" "fmt" "io/fs" "os" "path/filepath" "strings" "text/template" "github.com/Masterminds/sprig/v3" "github.com/mesh-for-data/crdoc/pkg/functions" log "github.com/sirupsen/logrus" "k8s.io/apiextensions...
package version import ( "fmt" "math" "reflect" "regexp" "strconv" "strings" "unicode" ) type rpmVersion struct { epoch *int version string release string } func newRpmVersion(raw string) (rpmVersion, error) { epoch, remainingVersion, err := splitEpochFromVersion(raw) if err != nil { return rpmVersio...
// Package gotdict parses GOTDict (https://github.com/wjdp/gotdict). package gotdict import ( "bytes" "fmt" "io/ioutil" "os" "path/filepath" "regexp" "sort" "strings" "unicode" "gopkg.in/yaml.v2" ) // Dict represents the Dict. type Dict []*Def // Def represents a definition. type Def struct { // Title is...
// Copyright 2018 The WPT Dashboard Project. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package query import ( "encoding/json" "fmt" "io/ioutil" "net/http" "net/url" "sort" "strconv" "strings" time "time" "github.com/web-plat...
package virtualmachineimage import ( "context" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/klog" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) co...
/* Package config helps generically manage configuration data in YAML files (and, by extension JSON, which is a YAML subset) using the gopkg.in/yaml.v3 package (v2 is not compatible with encoding/json creating unexpected marshaling errors). The package provides the high-level functions called by the Bonzai™ branch com...
package cron import ( "fmt" "regexp" "strconv" "strings" ) var monthMap = map[string]string{ "JAN": "1", "FEB": "2", "MAR": "3", "APR": "4", "MAY": "5", "JUN": "6", "JUL": "7", "AUG": "8", "SEP": "9", "OCT": "10", "NOV": "11", "DEC": "12", } var weekdayMap = map[string]string{ "SUN": "0", "MON": "1...
package template import ( "fgame/fgame/core/template" "fgame/fgame/core/template/validator" chesstypes "fgame/fgame/game/chess/types" "fmt" "sort" ) //苍龙棋局配置 type ChessTemplate struct { *ChessTemplateVO chessType chesstypes.ChessType dropByTimesMap map[int32]int32 //按次数必定掉落map timesList []int ...
// Unit test for CoinMarketCap API package crypto import ( "fmt" "net/http" "net/http/httptest" "testing" "github.com/eftakhairul/crypto-terminal-watch/crypto" "github.com/stretchr/testify/assert" ) func TestGetCoinDataForCoinMarketCap(t *testing.T) { testServer := httptest.NewServer(http.HandlerFunc(func(w h...
// Code generated by go-swagger; DO NOT EDIT. package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "encoding/json" "fmt" "io" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/g...
// Copyright 2017 <NAME>, Inc. All rights reserved. // Licensed under the Apache License, version 2.0: // http://www.apache.org/licenses/LICENSE-2.0 package nomdl import ( "io" "strings" "text/scanner" "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/types" ) // Parser provides ways to parse No...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: address.proto package coin_extender import ( fmt "fmt" proto "github.com/golang/protobuf/proto" timestamp "github.com/golang/protobuf/ptypes/timestamp" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.M...
package main import ( "bytes" "fmt" "io" "net/http" log "github.com/sirupsen/logrus" bx24 "github.com/vilamslep/bx24sync" scheme "github.com/vilamslep/bx24sync/scheme/bitrix24" ) type gettingData func(io.Reader) ([][]byte, error) type commit struct { fields log.Fields message string level string } fun...
/* Copyright (c) 2014 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicen...
package presenter import ( "bytes" "fmt" "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/text" "html/template" "io" "log" "strings" "time" ) // ParseMode represents flags for the Parse function. type ParseMode int const ( // TitlesOnly mode parse only the title and subtitle. TitlesOnly ParseMode ...
package block import ( "github.com/df-mc/dragonfly/server/block/cube" "github.com/df-mc/dragonfly/server/block/model" "github.com/df-mc/dragonfly/server/entity" "github.com/df-mc/dragonfly/server/internal/nbtconv" "github.com/df-mc/dragonfly/server/item" "github.com/df-mc/dragonfly/server/world" "github.com/df-...
// +build linux /* Copyright 2014 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 agree...
package etcdserver import ( "time" "go.etcd.io/etcd/raft" "go.etcd.io/etcd/raft/raftpb" "go.uber.org/zap" ) type draftReadyHandler struct { ShouldTickNow func() bool SendMessages func(ms []raftpb.Message) } // startDRaft prepares and starts disk-raft raftNode in a new goroutine. It is no longer safe // to mo...
package main import ( "encoding/base64" "encoding/json" "fmt" "github.com/DATA-DOG/godog" "github.com/DATA-DOG/godog/gherkin" db "github.com/xmidt-org/codex-db" "github.com/xmidt-org/voynicrypto" "github.com/xmidt-org/wrp-go/wrp" "github.com/yugabyte/gocql" "io/ioutil" "net/http" "reflect" "strconv" "tim...
// Copyright 2018 github.com/ucirello // // 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 qq import ( "encoding/json" "fmt" "io/ioutil" "net/http" "regexp" "strconv" "strings" ) func GetQQInfo(t QQType) (*User, error) { var user = &User{} user.Title = t.Title() client := http.Client{} // 1. 获取pt_local_token req, _ := http.NewRequest("GET", "https://xui.ptlogin2.qq.com/cgi-bin/xlogin?s_...