text
stringlengths
3.08k
10.4k
//+build linux // Copyright 2020 Antrea 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 ...
package core import ( "encoding/json" "fmt" "strconv" "time" "github.com/desertbit/grumble" ) // Session - defines a session structure composed of: // // id - unique identifier that is autoincremented on creation of a new session // // protocol - the protocol to use when listening for incoming connections. Curr...
package migration23 import ( "fmt" "github.com/ltcsuite/lnd/kvdb" ) var ( // paymentsRootBucket is the name of the top-level bucket within the // database that stores all data related to payments. paymentsRootBucket = []byte("payments-root-bucket") // paymentHtlcsBucket is a bucket where we'll store the infor...
// +build ignore package main // Examples taken from: https://wiki.postgresql.org/wiki/Crosstabview import ( "bytes" "context" "flag" "fmt" "io/ioutil" "log" "os" "os/exec" "strings" "unicode" ) func main() { dsn := flag.String("dsn", "postgres://postgres:P4ssw0rd@localhost", "dsn") out := flag.String("...
// Copyright (c) 2019 PaddlePaddle 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 main import ( "bytes" "context" "fmt" "os" "os/exec" "strconv" "strings" "syscall" "time" "github.com/gosimple/slug" log "github.com/sirupsen/logrus" mondash "github.com/Luzifer/mondash/client" "github.com/Luzifer/rconfig/v2" ) var ( cfg = struct { MondashHost string `flag:"host,h"...
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
// Copyright 2019 Google Inc. 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 by applicabl...
// Copyright (c) 2004-present Facebook All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package server import ( "context" "fmt" "net/http" "net/http/pprof" "path" "sync" "time" "github.com/facebookincubator/symphony/pkg/server/driver...
package util import ( "bufio" "bytes" "context" "fmt" "io" "io/ioutil" "net/http" "os" "os/exec" "path" "path/filepath" "regexp" "strings" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "sigs.k8s.io/controller-runtime/pk...
package tdigest import ( "fmt" "math" "sort" ) type centroid struct { mean float64 count uint32 index int } func (c centroid) isValid() bool { return !math.IsNaN(c.mean) && c.count > 0 } func (c *centroid) Update(x float64, weight uint32) { c.count += weight c.mean += float64(weight) * (x - c.mean) / floa...
package main import ( "fmt" "strings" "sync" "time" "github.com/LightningTipBot/LightningTipBot/internal/storage" "github.com/LightningTipBot/LightningTipBot/internal/lnurl" log "github.com/sirupsen/logrus" "github.com/LightningTipBot/LightningTipBot/internal/lnbits" "gopkg.in/tucnak/telebot.v2" tb "gopk...
package hackvm import ( "errors" "fmt" ) // ErrBadInstruction error returned while executing invalid instructions. var ErrBadInstruction = errors.New("invalid instruction") // CPU implements the HackVM instruction set. type CPU struct { ram ReadWriteMemory rom ReadOnlyMemory a int d int pc int } // NewC...
package fsdriver import ( "encoding/binary" "io" Error "github.com/zavla/upload/errstr" ) // startstructver2 is a header of version 2 journal type startstructver2 struct { VersionBytes uint32 TotalExpectedFileLength int64 Sha1 [20]byte VersionBytesEnd uint32 } // univers...
package metrics import ( "github.com/packethost/pkg/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var ( DHCPTotal *prometheus.CounterVec CacherDuration prometheus.ObserverVec CacherCacheHits *prometheus.CounterVec CacherTot...
/* * Copyright (c) 2019 QLC Chain Team * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ package commands import ( "encoding/hex" "fmt" "github.com/abiosoft/ishell" rpc "github.com/qlcchain/jsonrpc2" "github.com/spf13/cobra" "github.com/qlcchain/go-qlc/cmd/util...
/* * (c) 2014-2016, <NAME> <<EMAIL>>, * Starship Factory. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * ...
// Copyright (c) 2019, The Emergent 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 popcode import ( "fmt" "log" "github.com/chewxy/math32" "github.com/emer/etable/etensor" "github.com/goki/gi/mat32" ) // popcode.TwoD...
// Copyright 2019 The Cockroach 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 a...
package ui import ( "strings" ) // Styling specifies how to change a Style. It can also be applied to a Segment // or Text. type Styling interface{ transform(*Style) } // StyleText returns a new Text with the given Styling's applied. It does not // modify the given Text. func StyleText(t Text, ts ...Styling) Text {...
package compiler // Opcode represents a single byte operation code. type Opcode byte // List of opcodes const ( OpConstant Opcode = iota // Load constant OpAdd // Add OpSub // Sub OpMul // Multiply OpDiv ...
/* 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 agreed to in writing, ...
// Copyright ©2015 The Gonum 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 plot_test import ( "bytes" "fmt" "image/color" "math" "os" "testing" "time" "gonum.org/v1/plot" "gonum.org/v1/plot/cmpimg" "gonum.org/v1...
package report import ( "crypto/x509" "encoding/pem" "fmt" "testing" "github.com/OpenBankingUK/conformance-suite/pkg/test" "github.com/dgrijalva/jwt-go" "github.com/pkg/errors" ) const exampleRawJWT = "<KEY>" const samplePrivateKey = `-----<KEY>` const samplePublicKey = `-----<KEY>` func TestReportSigning(...
package main import ( "context" "encoding/json" "fmt" "log" "net/http" "os" "testing" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" ) type ServerTestSuite struct { suite.Suite Log *log.Logger RWMock *ResponseWriterMock SLMock *SwarmListeningMock } func TestServerUnitTestSuit...
// Copyright 2020 MongoDB 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 writer import ( "sync" osm "github.com/omniscale/go-osm" "github.com/omniscale/imposm3/cache" "github.com/omniscale/imposm3/database" "github.com/omniscale/imposm3/expire" geomp "github.com/omniscale/imposm3/geom" "github.com/omniscale/imposm3/geom/geos" "github.com/omniscale/imposm3/log" "github.com...
package main import ( "github.com/stretchr/testify/require" "io/ioutil" "os" "os/exec" "path/filepath" "testing" "time" ) func TestGetEnvOrDefault(t *testing.T) { require.Equal(t, os.Getenv("HOME"), getEnvOrDefault("HOME", "test")) require.Equal(t, "test", getEnvOrDefault("NON_EXISTENT_ENV", "test")) } func...
// Copyright 2021 The Prometheus 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...
package podnodeconstraints import ( "fmt" "io" "reflect" "github.com/golang/glog" kapierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" admission "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/authorization/authorizer" kapi "k8s...
// Copyright 2010 The Go 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 runtime import "unsafe" const ( _PAGE_SIZE = _PhysPageSize _EACCES = 13 ) // NOTE: vec must be just 1 byte long here. // Mincore returns ENOMEM...
package api import ( "context" "encoding/json" cass "github.com/hellofresh/janus/cassandra" "github.com/hellofresh/janus/cassandra/wrapper" "github.com/opentracing/opentracing-go" log "github.com/sirupsen/logrus" "strconv" "strings" "time" ) // CassandraRepository represents a cassandra repository type Cassa...
package main import ( "context" "flag" "fmt" "log" "math/rand" "os" "path" "time" "github.com/mpawlowski/r2modman-headless/r2modman" "github.com/mpawlowski/r2modman-headless/zip" "go.uber.org/fx" ) const VERSION = "v0.0.1" type flags struct { installDir string profileZip ...
package main import ( "doveclient/config" "encoding/json" "flag" "fmt" "math" "net" "os" "os/signal" "runtime" rDebug "runtime/debug" "strconv" "strings" "syscall" "time" ) var tc int64 var st time.Time var chs []*chan int64 var ppo int const ( NET_READ_TIMEOUT = time.Second * 10 ) func processSysSig...
// Copyright 2019 Yunion // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writi...
// Package config - Configuration for Cloud-Barista's GRPC and provides the required process package config import ( "fmt" "log" "os" "strings" "time" ) // ===== [ Constants and Variables ] ===== const ( // ConfigVersion - 설정 구조에 대한 버전 ConfigVersion = 1 ) // ===== [ Types ] ===== // Grpc...
package main import ( "github.com/mattermost/mattermost-server/v5/model" "os" "os/signal" "time" ) const ( AlertsUrl = "https://source-alerts.ynet.co.il/alertsRss/YnetPicodeHaorefAlertFiles.js?callback=jsonCallback" ) var /* const */ CitiesResponseTime = map[string]int{ "אשדוד - יא,יב,טו,יז,מרינה": 45, "...
package hbbft import ( "testing" "github.com/stretchr/testify/assert" ) // Testing BBA should cover all of the following specifications. // // 1. If a correct node outputs the value (b), then every good node outputs (b). // 2. If all good nodes receive input, then every good node outputs a value. // 3. If any good...
// +build linux package fastudp import ( "net" "os" "runtime" "sync" "sync/atomic" "unsafe" "github.com/shaoyuan1943/fastudp/netpoll" "github.com/shaoyuan1943/fastudp/netudp" "golang.org/x/sys/unix" ) var ( MsgHdrSize = 128 ReadEventSize = 128 WriteEventSize = 128 ) type eventLoop struct { intern...
// The rbxdhist package is used to parse logs involving the deployment of // Roblox builds. package rbxdhist import ( "regexp" "time" ) // Notes about build process (as deduced by examining the log file) // // When a job starts (New/Revert), it writes a message to the log file // with the current time (time indicat...
// Copyright Suneido Software Corp. All rights reserved. // Governed by the MIT license found in the LICENSE file. package meta import ( "github.com/apmckinlay/gsuneido/db19/index" "github.com/apmckinlay/gsuneido/db19/stor" "github.com/apmckinlay/gsuneido/util/hash" ) type Info struct { Table string Nrows ...
package conf import ( "errors" "flag" "go-common/app/job/main/member/model/block" "go-common/library/cache/memcache" "go-common/library/cache/redis" "go-common/library/conf" "go-common/library/database/sql" "go-common/library/log" "go-common/library/log/infoc" bm "go-common/library/net/http/blademaster" "g...
package engine import ( "context" "fmt" goKitDynamo "github.com/infralight/go-kit/db/dynamo" "github.com/infralight/pulumi/refresher" "github.com/infralight/pulumi/refresher/common" "github.com/infralight/pulumi/refresher/utils" "github.com/pulumi/pulumi/pkg/v3/backend" "github.com/pulumi/pulumi/pkg/v3/backend...
package backend import ( "context" "fmt" "time" "go.uber.org/zap" "github.com/conservify/sqlxcache" "github.com/fieldkit/cloud/server/common/logging" "github.com/fieldkit/cloud/server/common/jobs" "github.com/fieldkit/cloud/server/data" "github.com/fieldkit/cloud/server/files" "github.com/fieldkit/cloud/...
// Package config contains functions and structs related to config package config import ( "encoding/json" "fmt" "io/ioutil" "strings" "github.com/editorconfig-checker/editorconfig-checker/pkg/logger" "github.com/editorconfig-checker/editorconfig-checker/pkg/utils" ) // DefaultExcludes is the regular expressio...
/* Copyright AppsCode Inc. and Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
package project_test import ( "archive/zip" "bytes" "context" "io" "io/ioutil" "net/http" "os" "path/filepath" "testing" "time" "github.com/graphql-editor/stucco/pkg/providers/azure/project" "github.com/graphql-editor/stucco/pkg/providers/azure/vars" "github.com/graphql-editor/stucco/pkg/utils" "github....
// Code Generated By gen-enumer For "Enum Type: SNSEndpointAttribute" - DO NOT EDIT; /* * Copyright 2020 Aldelo, 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....
package limitrange import ( "fmt" "k8s.io/klog" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/tools/cache" kapi "k8s.io/kubernetes/pkg/apis/core" imagev1 "github.com/openshift/api/image/...
// Copyright 2016 The Periph Authors. All rights reserved. // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. // Specification // // Motorola never published a proper specification. // http://electronics.stackexchange.com/questions/30096/spi-specifica...
package cronicle import ( "fmt" "path/filepath" "time" homedir "github.com/mitchellh/go-homedir" "github.com/go-git/go-git/v5" c "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/transport" "githu...
// Package dmap implements a Brogue-style Dijkstra Map data structure // based on the map it is given. For more information on this data // structure, read the article on RogueBasin: // http://www.roguebasin.com/index.php?title=The_Incredible_Power_of_Dijkstra_Maps package dmap import ( "bytes" "fmt" "math" ) // P...
// Copyright (c) 2011-2015, HL7, Inc & The MITRE Corporation // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, ...
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
package cmd import ( "strings" "github.com/AlecAivazis/survey/v2" "github.com/spf13/cobra" "github.com/tkmcclellan/kocha/internal/models" "github.com/tkmcclellan/kocha/pkg/kocha" ) // addCmd represents the add command var addCmd = &cobra.Command{ Use: "add", Short: "Add manga", Long: `Add manga to kocha. ...
package commands import ( "fmt" "sort" "strings" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/buildpacks/pack/internal/config" "github.com/buildpacks/pack/internal/stringset" "github.com/buildpacks/pack/internal/style" "github.com/buildpacks/pack/logging" ) var mirrors []string func Config...
package integration import ( "context" "fmt" "github.com/Pallinder/go-randomdata" "github.com/masseelch/elk/internal/integration/pets/ent" "github.com/masseelch/elk/internal/integration/pets/ent/badge" "github.com/masseelch/elk/internal/integration/pets/ent/pet" "github.com/masseelch/elk/internal/integration/pe...
package subcmd import ( "context" "errors" "fmt" "os" "path/filepath" "strings" "github.com/segmentio/kubeapply/pkg/cluster" "github.com/segmentio/kubeapply/pkg/cluster/apply" "github.com/segmentio/kubeapply/pkg/cluster/diff" "github.com/segmentio/kubeapply/pkg/cluster/kube" "github.com/segmentio/kubeapply...
package g import ( "fmt" "bytes" "errors" "strings" "reflect" "encoding/json" "html/template" // "github.com/fatih/structs" ) var funcMap template.FuncMap // template helper functions func divideFF(a, b float64) float64 { return a / b } func percentageFF(a, b float64) float64 { return (a / b) ...
package api import ( "encoding/json" "net/http" "github.com/gin-gonic/gin" "github.com/tdewolff/minify" "github.com/tdewolff/minify/css" "github.com/tdewolff/minify/html" "github.com/tdewolff/minify/js" jm "github.com/tdewolff/minify/json" "strings" "io/ioutil" "github.com/mundipagg/boleto-api/bank" "g...
package server import ( "fmt" "net/http" "os" "github.com/Sirupsen/logrus" "github.com/codegangsta/negroni" "github.com/gorilla/mux" "github.com/hamfist/artifacts-service/auth" "github.com/hamfist/artifacts-service/metadata" "github.com/hamfist/artifacts-service/store" "github.com/meatballhat/negroni-logrus...
package v4 import ( "context" "database/sql" "fmt" "strconv" "strings" "github.com/keegancsmith/sqlf" "github.com/sourcegraph/sourcegraph/internal/codeintel/bundles/persistence/serialization" jsonserializer "github.com/sourcegraph/sourcegraph/internal/codeintel/bundles/persistence/serialization/json" "github...
// Copyright (c) 2021 PaddlePaddle 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 by...
package mgr import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "sync" "github.com/redNixon/certmgr/cert" "github.com/pkg/errors" log "github.com/sirupsen/logrus" yaml "gopkg.in/yaml.v2" ) // MgrSpecOptions is a compatibility shim for mapping old manager configurables into // the common names used by...
package cqrs import ( "errors" "reflect" "time" ) // EventSourcingRepository is a repository for event source based aggregates type EventSourcingRepository interface { GetEventStreamRepository() EventStreamRepository GetTypeRegistry() TypeRegistry Save(EventSourced, string) ([]VersionedEvent, error) Get(string...
package routers import ( "fmt" "go-eth/routers/api/soul" "net/http" "net/http/httputil" //"github.com/gin-contrib/sessions" //"github.com/gin-contrib/sessions/cookie" "github.com/gin-gonic/gin" cors "github.com/rs/cors/wrapper/gin" ginSwagger "github.com/swaggo/gin-swagger" "github.com/swaggo/gin-swagger/s...
package http import ( "context" "errors" "fmt" "net/http" "os" "os/signal" "syscall" "time" "github.com/rs/cors" "github.com/urfave/negroni" "github.com/defineiot/keyauth/api/global" "github.com/defineiot/keyauth/api/http/router" "github.com/defineiot/keyauth/internal/cache" "github.com/defineiot/keyau...
package main import ( "context" "fmt" "net/http" "os" "strconv" "github.com/gin-gonic/gin" "github.com/go-redis/redis/v8" ) const locationIdFormat = "location:%s" type Location struct { Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Longitude ...
package trafficstats /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (t...
package notify import ( "context" "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "strings" "sync" "time" "github.com/eudore/eudore" "github.com/fsnotify/fsnotify" ) var notifyArgs = []string{ fmt.Sprintf("%s=%d", eudore.EnvEudoreIsNotify, 1), fmt.Sprintf("%s=%d", eudore.EnvEudoreDisablePidf...
// Copyright 2018 <NAME> / HEIA-FR // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
// Copyright © 2017 <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...
package main import ( "context" "database/sql" "expvar" "flag" "fmt" "log" "os" "runtime" "strings" "sync" "time" _ "github.com/lib/pq" "github.com/shakilbd009/go-greenlight-api/internal/data" "github.com/shakilbd009/go-greenlight-api/internal/jsonlog" "github.com/shakilbd009/go-greenlight-api/internal...
package mat import ( "github.com/eriklupander/rt/internal/pkg/identity" "math" ) type Camera struct { Width int Height int Fov float64 Transform Mat4x4 Inverse Mat4x4 PixelSize float64 HalfWidth float64 HalfHeight float64 Aperture float64 FocalLength float64 } func NewCam...
package api import ( "fmt" "github.com/sacloud/libsacloud/sacloud" "github.com/sacloud/libsacloud/sacloud/ostype" "strings" "time" ) // ArchiveAPI アーカイブAPI type ArchiveAPI struct { *baseAPI findFuncMapPerOSType map[ostype.ArchiveOSTypes]func() (*sacloud.Archive, error) } var ( archiveLatestStableCentOSTags ...
package genesyscloud import ( "fmt" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/mypurecloud/platform-client-sdk-go/v56/platformclientv2" "math/rand" "strconv" "strings" "testing" "time" ) type iv...
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this fi...
package krpc import ( "bytes" "crypto/rand" "encoding/binary" "fmt" denet "github.com/hlandau/degoutils/net" "github.com/hlandau/xlog" "github.com/hlandauf/bencode" "net" "reflect" "sync/atomic" ) var log, Log = xlog.New("dht.krpc") // KRPC message. type Message struct { TxID string `bencode:"t"` // For c...
package main import ( "fmt" "github.com/jacobsa/go-serial/serial" "time" "hash/crc32" "math/rand" "strings" "strconv" ) var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") func randSeq(n int) string { b := make([]rune, n) for i := range b { b[i] = ...
// Copyright (c) 2016 Western Digital Corporation or its affiliates. All rights reserved. // SPDX-License-Identifier: MIT package raft import ( "time" "github.com/prometheus/client_golang/prometheus" log "github.com/golang/glog" ) // Update from the main loop about leadership changes. type leadershipUpdate str...
/* Copyright 2013 The Perkeep 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 ( "flag" "io/ioutil" "log" "math/rand" "net/http" "strings" "time" evdev "github.com/gvalkov/golang-evdev" yaml "gopkg.in/yaml.v2" ) // Config contains the parameters for the listener. type Config struct { Zone string `yaml:"zone"` Gateway string `yaml:...
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this fi...
package ossaccesscontrol import ( "context" "errors" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/infra/usagestats" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/g...
// Copyright 2021 The Go 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 vta import ( "go/types" "github.com/polaris1119/tools/go/ssa" "github.com/polaris1119/tools/go/types/typeutil" ) // scc computes strongly connect...
package goh4 import ( "fmt" // "github.com/metakeule/template" "html" "regexp" "strings" ) // type Context string // func (ø Context) String() string { return string(ø) } type Comment string func (ø Comment) String() string { return string(ø) } type Class string func (ø Class) String() string { return strin...
package middleware import ( "bytes" "context" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "strings" "github.com/blacklane/go-libs/logger" "github.com/blacklane/go-libs/logger/internal" "github.com/blacklane/go-libs/tracking" "github.com/rs/zerolog" ) // HTTPAddLogger adds the logger into the reque...
package main import ( "bytes" "flag" "fmt" "html/template" "log" "net/http" "path/filepath" "regexp" "strconv" "strings" ) var numNodes = flag.Int("n", 0, "number of nodes") var attrs = make(perNodeAttribute) var localities = make(perNodeAttribute) var tmpls = map[string]*template.Template{} // stringStri...
// Copyright 2016-2019 DutchSec (https://dutchsec.com/) // // 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...
/* Copyright 2016 The Rook 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 by applicable law or agreed to ...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Creates an instance group in the specified project using the paramete...
package rest import ( "bytes" "context" "encoding/binary" "encoding/json" "errors" "fmt" "github.com/gorilla/websocket" "github.com/ovrclk/akash/util/wsutil" mtypes "github.com/ovrclk/akash/x/market/types/v1beta2" "io" "k8s.io/client-go/tools/remotecommand" "net/url" "sync" ) var ( errLeaseShell ...
package main import ( "crypto/tls" "flag" "html/template" "log" "net/http" "os" "time" "github.com/519seven/cs610/battleship/pkg/models/sqlite3" "github.com/golangcollege/sessions" ) // Custom application struct // - Makes objects available to our handlers type application struct { debug bool errorLog ...
// Code generated by "esc"; DO NOT EDIT. package js import ( "bytes" "compress/gzip" "encoding/base64" "fmt" "io" "io/ioutil" "net/http" "os" "path" "sync" "time" ) type _escLocalFS struct{} var _escLocal _escLocalFS type _escStaticFS struct{} var _escStatic _escStaticFS type _escDirectory struct { f...
package spotifydl import ( "errors" "fmt" "github.com/buger/jsonparser" "io" "io/ioutil" "net/http" "net/url" "strconv" "strings" ) var httpClient = &http.Client{} var durationMatchThreshold = 5 type SearchResult struct { Title, Uploader, URL, Duration, ID string Live bool S...
package main import ( "bytes" "fmt" "io" "io/ioutil" "net" "net/http" "net/url" "os" "os/exec" "path" "path/filepath" "time" "github.com/AlexanderThaller/logger" "github.com/juju/errgo" "github.com/julienschmidt/httprouter" "github.com/spf13/viper" ) const ( // Name is the name of the application. U...
package bertybridge import ( "context" "fmt" "net" "strings" "sync" "time" "berty.tech/berty/v2/go/internal/grpcutil" "berty.tech/berty/v2/go/pkg/errcode" ma "github.com/multiformats/go-multiaddr" "github.com/oklog/run" "github.com/pkg/errors" "go.uber.org/zap" "google.golang.org/grpc" ) type Config str...
/* Copyright 2022 The KubeEdge Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
package gdcHmac import ( "net/http" "strings" "testing" ) var testMethods = map[string]string{ "GET": "61f76cd119862b250b56abe88d00c58cf8a9bf571091313d3a46cbe6093675a7", "POST": "<KEY>", "PUT": "20f75ef1def6b0fa11ccf4f542fd9628559692edb3670069bd892b45764cac3a", "DELETE": "e8496bd6200b3a93380e22c7d56345...
package qc import ( "fmt" "errors" "strconv" "bufio" "os" "github.com/Arafatk/glot" "github.com/spf13/cobra" "github.com/wangkui0508/float128" ) const ( MaxArea = int64(900)*int64(10000_0000)*int64(10000_0000) ) var ( oneThird = float128.F128FromF64(float64(1)/3.0) half = float128.F128FromF64(0.5) maxA...