text
stringlengths
3.08k
10.4k
package transModel import ( "log" "gonum.org/v1/gonum/mat" "gonum.org/v1/gonum/spatial/kdtree" ) /* helper */ type nodes []node func (n nodes) Index(i int) kdtree.Comparable { return n[i] } func (n nodes) Len() int { return len(n) } func (n nodes) Pivot(d kdtree.Dim) int ...
package types import ( "bytes" "errors" sdk "github.com/cosmos/cosmos-sdk/types" ) const ( // ModuleName defines the module name ModuleName = "anconprotocol" // StoreKey defines the primary module store key StoreKey = ModuleName // RouterKey is the message route for slashing RouterKey = ModuleName // Qu...
// Package makefiles builds a directory structure with the required // number of files in of the required size. package makefiles import ( "io" "log" "math/rand" "os" "path/filepath" "time" "github.com/artpar/rclone/cmd" "github.com/artpar/rclone/cmd/test" "github.com/artpar/rclone/fs" "github.com/artpar/rc...
package todo import ( "context" "emperror.dev/errors" ) // +kit:endpoint:errorStrategy=service // Service manages a todo list. type Service interface { // AddItem adds a new item to the list. AddItem(ctx context.Context, newItem NewItem) (item Item, err error) // ListItems returns a list of items. ListItems(...
package main /// the required imports import ( "encoding/json" "fmt" "log" ) /// global variables var ( globalSourcepath string // define global variable for source file path globalSchemapath string // define global variable for own schema path globalOfficialschemapath string // define global va...
package media import ( "fmt" "os" "path" "path/filepath" "regexp" "strings" ptn "github.com/middelink/go-parse-torrent-name" "github.com/jeremiergz/nas-cli/util" ) // TVShow is the type of data that will be formatted as a TV show type TVShow struct { Name string Seasons []*Season } // Season holds inf...
package authclient import ( "fmt" "github.com/dgrijalva/jwt-go" "github.com/golang/glog" hfv1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" hfClientset "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned" hfInformers "github.com/hobbyfarm/gargantua/pkg/client/informers/externalversions" "...
package requeue_test import ( "context" "fmt" "io/ioutil" "os" "runtime" "sync" "sync/atomic" "testing" "time" natsserver "github.com/nats-io/nats-server/v2/test" "github.com/nats-io/nats.go" requeue "github.com/nickpoorman/nats-requeue" "github.com/nickpoorman/nats-requeue/internal/republisher" "github...
// Package creator contains the creator service that should create a new entry in the database for a github repo // that is not already in there. package creator import ( "fmt" "log" "sort" "strconv" "time" "github.com/evermax/stargraph/api" "github.com/evermax/stargraph/github" "github.com/evermax/stargraph/...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: yandex/cloud/endpoint/api_endpoint.proto package endpoint // import "github.com/yandex-cloud/go-genproto/yandex/cloud/endpoint" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if th...
package notebooks import ( "context" "database/sql" "database/sql/driver" "encoding/json" "github.com/cockroachdb/errors" "github.com/keegancsmith/sqlf" "github.com/sourcegraph/sourcegraph/internal/actor" "github.com/sourcegraph/sourcegraph/internal/database/basestore" "github.com/sourcegraph/sourcegraph/in...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: hello.proto package helloservice import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) // Reference imports to suppress errors if they are not other...
package main import ( "context" "fmt" "github.com/jackc/pgx/v4" "goTempM/globalCache" //"github.com/micro/go-micro/v2/service" //"github.com/micro/go-micro/v2" //"github.com/micro/go-micro/v2/client" //"github.com/micro/go-micro/v2/metadata" //"github.com/micro/go-micro/v2/server" microServ "github.com/mic...
// Copyright (c) 2017 Uber Technologies, Inc. // // 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...
package monotone_convex import ( m "../../measures" "github.com/google/go-cmp/cmp" "math" "testing" ) func absCmp(tol float64) cmp.Option { return cmp.Comparer(func(x, y float64) bool { return (math.IsNaN(x) && math.IsNaN(y)) || math.Abs(x-y) < tol }) } func TestMonotoneConvexGeneralCaseResults(t *testing.T)...
/* Copyright © 2020 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, sublicense, and/o...
// Copyright (c) 2017 Zededa, Inc. // SPDX-License-Identifier: Apache-2.0 // Types which feed in and out of the verifier package types import ( "github.com/google/go-cmp/cmp" "github.com/lf-edge/eve/pkg/pillar/base" ) // Types for verifying the images. // For now we just verify the sha checksum. // For defense-in...
// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
// Copyright (c) 2018 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided ‘as is’ and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
// Copyright 2014 The Gogs Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package process import ( "context" "runtime/pprof" "strconv" "sync" "time" ) // TODO: This pa...
/* * Copyright 2021 VMware, Inc. * SPDX-License-Identifier: Apache-2.0 */ package config_test import ( "fmt" "os" "path/filepath" "reflect" "runtime" "strings" "testing" "github.com/spf13/viper" "github.com/vmware/carbon-black-cloud-container-cli/internal" "github.com/vmware/carbon-black-cloud-container...
package shift import ( "fmt" "math" "time" "go.mongodb.org/mongo-driver/bson/primitive" "gopkg.in/mgo.v2/bson" "williamfeng323/mooncake-duty/src/domains/project" "williamfeng323/mooncake-duty/src/infrastructure/db" repoimpl "williamfeng323/mooncake-duty/src/infrastructure/db/repo_impl" validatorimpl "willia...
// Copyright 2020 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Package arcappcompat will have tast tests for android apps on Chromebooks. package arcappcompat import ( "context" "time" "chromiumos/tast/loca...
package rux import ( "encoding/json" "fmt" "os" "reflect" "runtime" "strconv" "strings" "github.com/gookit/color" ) /************************************************************* * global path params *************************************************************/ var globalVars = map[string]string{ "all":...
package main import ( "crypto/tls" "encoding/json" "flag" "fmt" "log" "net" "os" "github.com/assembla/cony" model "github.com/psavelis/goa-pos-poc/app" "github.com/streadway/amqp" mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) var ( url *string ) type posConnection struct { db *mgo.Database } func ge...
package world import ( "github.com/go-gl/glfw/v3.3/glfw" "github.com/go-gl/mathgl/mgl32" ) type Movement int var PlayerID = int32(1) const ( MoveForward Movement = iota MoveBackward MoveLeft MoveRight ) type AI interface { Think(p *Player) } type Physics interface { GetSpeed() mgl32.Vec3 Speed(a mgl32.Ve...
package interaction import ( "net/http" "time" "github.com/authgear/authgear-server/pkg/api/event" "github.com/authgear/authgear-server/pkg/api/model" "github.com/authgear/authgear-server/pkg/lib/authn" "github.com/authgear/authgear-server/pkg/lib/authn/authenticator" "github.com/authgear/authgear-server/pkg/l...
// Copyright 2016 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 agreed...
package main import ( "context" b64 "encoding/base64" "encoding/json" "io" "io/ioutil" "log" "net/http" "time" "github.com/go-redis/redis/v8" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" ) var ctx = context.Background() // Expiry of Redis keys for WireGuard key rotation. We expire the "uid" // key after th...
package storage_test import ( "flag" "io/ioutil" "log" "os" "sync" "testing" "time" . "github.com/quantcast/g2/pkg/runtime" . "github.com/quantcast/g2/pkg/storage" . "github.com/quantcast/g2/pkg/storage/leveldb" "github.com/stretchr/testify/assert" ) var ( db ItemQueue ) var testJobs = []*Job{ {Handle:...
/* Copyright 2020 The OpenEBS 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 import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/prometheus/client_golang/prometheus" ) var ( // Prometheus gauge for storing number of failed e...
package bitcoin import ( "backend/db" "fmt" "sort" "sync" "time" "runtime" ) // Very crude way to get data in parallel func GetHistoricalDataDescending(coin Coin, to, from, interval uint64) *[]*ChainAverage { data := make([]*ChainAverage, 0) lock := sync.Mutex{} var done uint64 = 0 target := (to - from) /...
// Peripheral: OPAMP_Periph Operational Amplifier (OPAMP). // Instances: // OPAMP mmap.OPAMP_BASE // Registers: // 0x00 32 CSR Control/status register. // 0x04 32 OTR Offset trimming register for normal mode. // 0x08 32 LPOTR Offset trimming register for low power mode. // Import: // stm32/o/l1xx_md/mmap ...
package frontman // a mock hub used in tests, similar to https://bitbucket.org/cloudradar/debug_hub/ import ( "encoding/json" "fmt" "io/ioutil" "log" "math/rand" "net/http" "strconv" ) type MockHub struct { address string // if set, responds with this status code on all requests. useful for testing 401 and...
// Copyright 2021 The Magma Authors. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WI...
package looli import ( "net/http" "os" "path" "strings" ) var ( default404Body = "404 page not found\n" default405Body = "405 method not allowed\n" ) // RouterPrefix is used internally to configure router, a RouterPrefix is associated with a basePath // and an array of handlers (middleware) type RouterPrefix s...
package clock import ( "database/sql/driver" "encoding/json" "errors" "fmt" "strconv" "strings" "time" ) // Time deals only with hours, minutes, and seconds. As opposed to the native // time.Time struct that deals also with dates & timezones. type Time struct { hours, minutes, seconds int } var ( // StartO...
package spaghetti import ( n "github.com/lachee/noodle" ) type SliceRender struct { shader *n.Shader buffVertex n.WebGLBuffer buffIndex n.WebGLBuffer a_Vertex n.WebGLAttributeLocation a_UV n.WebGLAttributeLocation a_Size n.WebGLAttributeLocation a_Offset n.WebGLAttributeLocation u_Sampler n.WebG...
package hades_test import ( "context" "fmt" "testing" "github.com/stretchr/testify/assert" "xorm.io/builder" "crawshaw.io/sqlite" "crawshaw.io/sqlite/sqlitex" "github.com/itchio/hades" "github.com/itchio/hades/mtest" ) func Test_HasMany(t *testing.T) { type Quality struct { ID int64 Programm...
package main import ( "fmt" "io/ioutil" "os" "strconv" ) type parser struct { source string current int } type literal struct { version int typ int value int64 } func (l literal) getVersionSum() int { return l.version } func (l literal) getValue() int64 { return l.value } type operator struct { ...
package main import ( "context" "flag" "fmt" "os" "os/user" "path/filepath" "time" "github.com/genuinetools/pkg/cli" "github.com/gizak/termui" "github.com/jessfraz/tdash/version" "github.com/sirupsen/logrus" ) var ( googleAnalyticsKeyfile string googleAnalyticsViewIDs stringSlice travisToken string ...
/* * 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...
/* Apache v2 license * Copyright (C) <2019> Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ package alert import ( "bytes" "encoding/base64" "encoding/json" "io/ioutil" "net/http" "time" "github.com/intel/rsp-sw-toolkit-im-suite-alert-service/app/config" "github.com/intel/rsp-sw-toolkit-im-su...
package torrent import ( "bytes" "encoding/hex" "fmt" "io" "net" "time" "github.com/anacrolix/missinggo" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/mse" pp "github.com/anacrolix/torrent/peer_protocol" ) type ExtensionBit uint const ( ExtensionBitDHT = 0 // http://www.bit...
/* * Copyright 2019 EPAM Systems * * 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 ...
// Copyright (C) 2016 <NAME> // See LICENSE for copying information package whmux import ( "net/http" "strconv" "golang.org/x/net/context" "gopkg.in/webhelp.v1" "gopkg.in/webhelp.v1/whcompat" "gopkg.in/webhelp.v1/wherr" "gopkg.in/webhelp.v1/whroute" ) // StringArg is a way to pull off arbitrary path element...
package strategies import ( "errors" v1 "github.com/lgarciaaco/machina-api/business/strategies/api/v1" "github.com/lgarciaaco/machina-api/business/strategies/financial" "go.uber.org/zap" ) var ( ErrPositionMissing = errors.New("position not found") ErrNotSufficientFund = errors.New("no enough fund to execu...
package pars import ( "bytes" "errors" "io" ) const ( bufferReadSize = 4096 ) // State represents a parser state, which is a convenience wrapper for an // io.Reader object with buffering and backtracking. type State struct { rd io.Reader buf []byte off int end int err error pos Position stk *stack } // ...
// (c) <NAME>. Licensed under the BSD license (see LICENSE). package cal import ( "time" ) // ObservanceType represents the type of holiday or special day being observed. type ObservanceType uint8 // Allowed values for ObservanceType const ( ObservancePublic ObservanceType = iota // public / national / regiona...
package templatex import ( "fmt" "strconv" "testing" "time" "github.com/teamlint/gox/stringx" "github.com/teamlint/gox/timex" ) type EnumMethod = string type EnumAction int type Foo struct { Name string Age int IsApproved bool } const ( EnumActionCreate EnumAction = 1 EnumActionRetrive Enum...
package main import ( "fmt" "os" "os/exec" "path/filepath" "regexp" "runtime" "strings" "io/ioutil" version "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclparse" ) const ( // VerConstraint is used as application level default, it's also used in unit tests...
/* Copyright 2017 Gravitational, 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, soft...
package hercules import ( "bufio" "bytes" "errors" "unicode/utf8" "github.com/sergi/go-diff/diffmatchpatch" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/plumbing/object" "gopkg.in/src-d/go-git.v4/utils/merkletrie" ) // FileDiff calculates the difference of files w...
package gemux import ( "context" "net/http" "strings" ) // ServeMux is an HTTP request multiplexer. It matches the URL and method of the incoming // request against a list of registered routes, and calls the matching route. type ServeMux struct { handlers map[string]http.Handler // methods describe actions...
package main import ( "bytes" "time" cmn "github.com/ockam-network/ockam/node/dynamic/common" ) // StatusResponse is type StatusResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id"` Error interface{} `json:"error"` Result Status `json:"result"` } // Status is type Sta...
package dtos import ( "encoding/json" "github.com/thedevsaddam/govalidator" "github.com/tryffel/fusio/storage/models" "github.com/tryffel/fusio/util" "time" ) const ( NotificationDefaultTemplateFire = "Alarm '{{.AlarmName}}' fired, value: {{.Value}}" NotificationDefaultTemplateClear = "Alarm '{{.AlarmName}}' ...
package optimisticlock import ( "database/sql/driver" "encoding/json" "fmt" "testing" "github.com/stretchr/testify/require" "gorm.io/driver/sqlite" "gorm.io/gorm" ) type User struct { ID int Name string Age uint Version Version } func TestVersion(t *testing.T) { DB, err := gorm.Open(sqlite.O...
package util import ( "fmt" "io/ioutil" "log" "os" "strconv" "strings" "time" ) /* * From https://www.kernel.org/doc/html/latest/power/power_supply_class.html * * Quoting include/linux/power_supply.h: * All voltages, currents, charges, energies, time and temperatures in µV, µA, µAh, µWh, seconds and tenths...
package socks5 import ( "context" "fmt" "github.com/meteorite/scope" "golang.org/x/sync/errgroup" "io" "log" "net" "os" "strings" ) type Handler interface { // Called, when Serve is called on socks server. Server will be really started only after returning from this func. // Returned error will abort socks...
// Code generated by entc, DO NOT EDIT. package turn import ( "time" ) const ( // Label holds the string label denoting the turn type in the database. Label = "turn" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldUserID holds the string denoting the user_id field in t...
package commands import ( "context" "errors" "sort" "strings" "github.com/keybase/client/go/chat/globals" "github.com/keybase/client/go/chat/types" "github.com/keybase/client/go/chat/utils" "github.com/keybase/client/go/protocol/chat1" "github.com/keybase/client/go/protocol/gregor1" ) var ErrInvalidCommand ...
package datastructures import ( "fmt" "math" "reflect" ) // HashTable represents a hash table data structure. // // this hash table data structure implementation uses // separate chaining technique to handle collisions. type HashTable struct { size int elementsCount int table []*DoublyLinkedLis...
/* Copyright 2020 Cortex Labs, 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, softwa...
package backend import ( "encoding/xml" "fmt" "math/rand" "net/http/cookiejar" "net/url" "strings" "time" "github.com/tstromberg/campwiz/pkg/cache" "github.com/tstromberg/campwiz/pkg/campwiz" "github.com/tstromberg/campwiz/pkg/geo" "k8s.io/klog/v2" ) var ( // San Mateo only has two camping sites availabl...
package main import ( "context" "encoding/csv" "fmt" "io" nurl "net/url" "os" "strings" "github.com/sirupsen/logrus" "github.com/spf13/viper" "github.com/urfave/cli/v2" "github.com/tagirmukail/ldtester/internal/config" "github.com/tagirmukail/ldtester/internal/logger" "github.com/tagirmukail/ldtester/in...
// Package shim contains implementations of internal types in terms of the external types package shim import ( "sync" "github.com/pkg/errors" "PhoenixOracle/lib/libocr/offchainreporting/internal/protocol" "PhoenixOracle/lib/libocr/offchainreporting/internal/serialization" "PhoenixOracle/lib/libocr/offchainrepor...
// Code generated by gnorm, DO NOT EDIT! package generated import ( "context" "database/sql" "database/sql/driver" "encoding/json" "strconv" "strings" "github.com/pkg/errors" ) // DB is the common interface for database operations. // // This should work with database/sql.DB and database/sql.Tx. type DB inte...
/* Copyright © 2020 <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, softwar...
// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: BSD-2-Clause // Auto generated code. DO NOT EDIT. // Interface file for service: Operation // Used by client-side stubs. package service import ( "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/metadata/authentication" "g...
// Package nodes provides a CLI to list nearby nodes. package nodes import ( "flag" "fmt" "io" "io/ioutil" "os" "regexp" "strings" "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" "github.com/leejones/kubectl-ne...
package batch import ( "encoding/json" "fmt" "github.com/pkg/errors" ) // DestinationOutput is used for displaying destinations as a table type DestinationOutput struct { Name string `json:"name" header:"Name"` ID string `json:"id" header:"Destination ID"` Type string `json:"type" header:"Type""`...
// Copyright 2017 Vector Creations 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 or agre...
package jsonrpc2 import ( "context" "encoding/json" "fmt" "reflect" ) var typeOfError = reflect.TypeOf((*error)(nil)).Elem() var typeOfContext = reflect.TypeOf((*context.Context)(nil)).Elem() // methodArgTypes returns the arg types and whether all the types are valid // (exported or builtin). func methodArgTypes...
package main import ( "encoding/json" "fmt" "io/ioutil" "os" "os/exec" "regexp" "strings" "github.com/ghodss/yaml" extensionsobj "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) const ( rolloutCrdPath = "manifests/crds/rollout-crd.yam...
package logutil import ( "encoding/json" "fmt" "log" "os" "strings" "sync" "time" ) const ( tagInfo = "INFO " tagNotice = "NOTICE " tagWarning = "WARNING " tagError = "ERROR " tagFatal = "FATAL " ) const ( infoColor = "\033[1;37m%s\033[0m" noticeColor = "\033[1;32m%s\033[0m" warnin...
package cmd import ( "context" "net/http" "strings" "bcdpkg.in/go-project/pkg/hasura" "bcdpkg.in/go-project/pkg/param" "bcdpkg.in/go-project/pkg/router" "github.com/coreos/go-oidc" "github.com/jmoiron/sqlx" "github.com/sirupsen/logrus" "github.com/spf13/viper" "github.com/cenk/backoff" "github.com/gin-go...
/* * Copyright (c) 2017-2020 The qitmeer developers */ package client import ( "bufio" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/json" "errors" "fmt" "github.com/Qitmeer/qitmeer/rpc/websocket" "net/http" "os" "strings" "time" ) var ( ErrInvalidAuth = errors.New("authentication failure...
package cdn import ( "bufio" "context" "crypto/md5" "crypto/sha512" "encoding/hex" "fmt" "io" "math/rand" "os" "time" "github.com/ovh/cds/engine/cdn/item" "github.com/ovh/cds/engine/cdn/redis" "github.com/ovh/cds/engine/cdn/storage" "github.com/ovh/cds/engine/gorpmapper" "github.com/ovh/cds/sdk" "gith...
// Copyright (c) 2014 The SurgeMQ Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required ...
package statedb import ( "encoding/json" "fmt" "reflect" "github.com/incognitochain/incognito-chain/common" "github.com/incognitochain/incognito-chain/dataaccessobject/rawdbv2" ) type Pdexv3ContributionState struct { value rawdbv2.Pdexv3Contribution pairHash string } func (pc *Pdexv3ContributionState) Pai...
// Copyright © 2009--2013 The Web.go Authors // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package web import ( "net/http" "reflect" ) // internal type for user defined handlers. handler of slightly differing // signatures are accepted but transformed (wrap...
/* The MIT License (MIT) https://github.com/ethpm/ethpm-go/blob/master/LICENSE THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYR...
// Copyright 2015 Keybase, Inc. All rights reserved. Use of // this source code is governed by the included BSD license. package libkb import ( "bufio" "bytes" "compress/gzip" "mime/multipart" "os" "strings" "github.com/keybase/client/go/logger" rogReverse "github.com/keybase/rog-go/reverse" ) // Logs is th...
// This file was ported from https://github.com/Microsoft/vscode/blob/c0bc1ace7ca3ce2d6b1aeb2bde9d1bb0f4b4bae6/src/vs/base/common/jsonFormatter.ts, // which is licensed as follows: // // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. package jsonx import ( "strings" ) // F...
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package rql import ( json "encoding/json" easyjson "github.com/mailru/easyjson" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" ) // suppress unused package warning var ( _ *json.RawMessage _ *jlexer...
package main import ( "fmt" "strings" ) type PKind struct { Pos Pos Name string Plural string Parent *PKind DefVal interface{} Props []*PVar ValidVals []string // Enum kind only } func (terp *Interp) addStandardKinds() { terp.addKind(&PKind{Name: "enum"}) terp.addKind(&PKind{Name: ...
// Copyright (c) 2019 <NAME> // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. // Package globalcfg contains configuration which must be available // anywhere in the project, do not import anything which is part of pktd. package globalcfg import ( "time" ) // ProofOf...
package main import ( "fmt" "math" ) // Node is a node in a tree type Node struct { value int freq int height int left *Node right *Node } // AVLTree is Avl tree implementation type AVLTree struct { root *Node } // Height returs the height of a node func Height(node *Node) int { if node == nil { re...
package fastsync import ( "bytes" "fmt" "testing" "github.com/stretchr/testify/assert" "github.com/icon-project/goloop/common/codec" "github.com/icon-project/goloop/common/log" "github.com/icon-project/goloop/consensus/internal/test" "github.com/icon-project/goloop/module" ) type clientTestSetUp struct { *...
package helpers import ( "fmt" got "html/template" "strings" "time" ) // ARRAYS // Array takes a set of interface pointers as variadic args, and returns a single array func Array(args ...interface{}) []interface{} { return []interface{}{args} } // CommaSeparatedArray returns the values as a comma separated str...
/* * Copyright 2019, <NAME>. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) */ // Package bindings provides bindings for values. // // Version 0.4.0. package bindings // Boolean is an observable...
// // Copyright 2019 Insolar Technologies 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 law...
package bidih import ( "github.com/apaxa-go/helper/unicodeh/bidih/internal/bidi" ) // BD8 // = LRI, RLI, or FSI func isIsolateInitiator(class bidi.Class) bool { return class == bidi.LeftToRightIsolate || class == bidi.RightToLeftIsolate || class == bidi.FirstStrongIsolate } // = L, R, or AL func isStrong(c bidi.Cl...
package main import ( "flag" "fmt" "html/template" "io" "os" "path" "runtime" "runtime/debug" "sort" "strings" "github.com/dmgk/portgrep/formatter" "github.com/dmgk/portgrep/grep" "github.com/mattn/go-isatty" ) func main() { if flag.NFlag() == 0 && flag.NArg() == 0 { flag.Usage() os.Exit(0) } if...
package secret import ( "context" "encoding/json" "errors" "fmt" "github.com/nais/jwker/pkg/tokendings" "gopkg.in/square/go-jose.v2" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" ) const O...
package yt import ( "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "net/url" "regexp" "strings" ) // ContentTypeXWWWFormURLEncoded is the preferred MIME-type for video info const ContentTypeXWWWFormURLEncoded = "application/x-www-form-urlencoded" // InfoID is the regular expression which video IDs mus...
/* Collects all access permission related stuff. */ package logbase import ( "fmt" "code.google.com/p/gopass" "crypto/sha256" "encoding/hex" "encoding/binary" "os" "path/filepath" ) const ( PERMISSION_CREATE uint8 = 1 PERMISSION_READ uint8 = 2 PERMISSION_UPDATE uint8 = 4 PERMISSION_DELETE uint8 = 8 ) t...
package main import ( "bytes" "fmt" "io/ioutil" "flag" "os" "unicode" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/pluginpb" "github.com/dave/jennifer/jen" // "github.com/xoe-labs/ddd-...
// Copyright 2020 cloudeng llc. All rights reserved. // Use of this source code is governed by the Apache-2.0 // license that can be found in the LICENSE file. package annotators import ( "context" "fmt" "go/ast" "regexp" "strings" "cloudeng.io/errors" "cloudeng.io/go/cmd/goannotate/annotators/internal" "clo...