text
stringlengths
3.08k
10.4k
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright Project Contour 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...
// Copyright 2018, OpenCensus Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
/* * Copyright 2020 National Library of Norway. * * 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 drain import ( "context" "fmt" "github.com/sirupsen/logrus" "k8s.io/api/core/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes" ) // Config configures a Drainer. ty...
package logs import ( "bufio" "fmt" "io" "math/rand" "os" "strings" "time" "github.com/fsnotify/fsnotify" "github.com/jjzcru/elk/pkg/file" "github.com/jjzcru/elk/pkg/utils" "github.com/logrusorgru/aurora" "github.com/spf13/cobra" ) var usageTemplate = `Usage: elk logs [tasks] [flags] Flags: -f, --fi...
// Package errcode defines the error codes for error messages and an explanation // of what the error signifies. package errcode import ( "fmt" ) type errCode int const ( // Kind defines the kind for the error code constants Kind = "error_code" ) // Range 1000-1050 is reserved for errors related to application s...
package handlers import ( "encoding/json" "fmt" "net/http" "github.com/GMcD/ts-serverless/micros/comments/database" domain "github.com/GMcD/ts-serverless/micros/comments/dto" models "github.com/GMcD/ts-serverless/micros/comments/models" service "github.com/GMcD/ts-serverless/micros/comments/services" "github....
/* * Copyright 2019 The Knative Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
// Code generated by entc, DO NOT EDIT. package migrate import ( "entgo.io/ent/dialect/sql/schema" "entgo.io/ent/schema/field" ) var ( // CategoriesColumns holds the columns for the "categories" table. CategoriesColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "name", Ty...
/* 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 device import ( "fmt" "strings" deviceConfig "github.com/lxc/lxd/lxd/device/config" pcidev "github.com/lxc/lxd/lxd/device/pci" "github.com/lxc/lxd/lxd/instance" "github.com/lxc/lxd/lxd/instance/instancetype" "github.com/lxc/lxd/lxd/resources" "github.com/lxc/lxd/shared" "github.com/lxc/lxd/shared/api...
// Copyright 2015 The rkt 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...
// Copyright (c) 2013-2017 The ltcsuite developers // Copyright (c) 2015-2016 The Decred developers // Heavily inspired by https://github.com/ltcsuite/ltcd/blob/master/signal.go // Copyright (C) 2015-2017 The Lightning Network Developers package signal import ( "errors" "fmt" "os" "os/signal" "sync/atomic" "sys...
package helpers import ( "errors" "log" "os" "os/exec" "path/filepath" "strings" ) type Include struct { ParentPath string Path string } //Equal to os/exec Expand but changed ${} to $() func replaceDollar(s string, mapping func(string) string) string { var buf []byte // $() is all ASCII, so bytes are...
package compactor import ( "context" "fmt" "hash/fnv" "time" "github.com/cortexproject/cortex/pkg/ring" "github.com/cortexproject/cortex/pkg/util" "github.com/cortexproject/cortex/pkg/util/services" "github.com/go-kit/kit/log/level" "github.com/grafana/tempo/modules/storage" tempo_util "github.com/grafana/t...
package main /* * Copyright 2021 ConsenSys Software 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...
package relations import ( "bytes" "io" "sort" "github.com/oleiade/lane" "github.com/s2gatev/hcache" ) // pair is used in the construction of the subsequential transducer. // It contains a transducer state and the symbols that remain to be // added to the output. type pair struct { state *tState remaining...
/* Copyright 2021 k0s 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, software dis...
package main import ( "fmt" "os" "os/exec" "os/user" "path" "path/filepath" "regexp" "strconv" "strings" "github.com/lxc/lxd/lxc/config" "github.com/lxc/lxd/shared" "github.com/lxc/lxd/shared/i18n" ) var numberedArgRegex = regexp.MustCompile(`@ARG(\d+)@`) // defaultAliases contains LXC's built-in comman...
package main import ( "bufio" "flag" "fmt" "github.com/borevitzlab/go-timestreamtools/utils" "io/ioutil" "log" "os" "path" "path/filepath" "strings" "time" ) var ( errLog *log.Logger interval time.Duration rootDir, outputDir, infmt, outfmt string ) fu...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kms import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type DescribeKeyInput struct { _ struct{} `type:"structure"` // A list of grant tokens. // // For more information, see Gra...
/* * 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 types import ( "bytes" "fmt" "math" "math/big" "math/rand" "github.com/lianxiangcloud/linkchain/libs/common" "github.com/lianxiangcloud/linkchain/libs/crypto" ) // Candidate the base info about candidate type Candidate struct { Address crypto.Address `json:"address"` PubKey crypto.PubKey `...
package statedb import ( "encoding/json" "fmt" "reflect" "github.com/incognitochain/incognito-chain/common" ) type RewardRequestState struct { // tokenid => amount epoch uint64 shardID byte tokenID common.Hash amount uint64 } func (rr RewardRequestState) Amount() uint64 { return rr.amount } func (rr *...
package test import ( "context" "fmt" "net" "net/http" "sync" "testing" "github.com/livekit/protocol/auth" livekit "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/logger" "github.com/livekit/protocol/utils" "github.com/livekit/protocol/webhook" "github.com/stretchr/testify/require" "go...
/* Copyright IBM Corp All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package runner import ( "encoding/json" "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "github.com/hyperledger/fabric/integration/pvtdata/helpers" "github.com/hyperledger/fabric/protos/discovery" . "github.com/onsi/gomega" ...
package main import ( "fmt" "github.com/spf13/cobra" "gitlab.com/NebulousLabs/Sia/build" "gitlab.com/NebulousLabs/Sia/modules" "gitlab.com/NebulousLabs/errors" ) var ( alertsCmd = &cobra.Command{ Use: "alerts", Short: "view daemon alerts", Long: "view daemon alerts", Run: wrap(alertscmd), } st...
package core import ( "bytes" "encoding/json" "errors" "strings" "sync" "time" "github.com/stunndard/cocosmail/message" ) // QMessage represents a message in queue type QMessage struct { sync.Mutex Id int64 Uuid string // Unique ID common to all QMessage, representin...
// Copyright (c) 2020 Tigera, 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 applicable law or agree...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* Copyright 2021 The Crossplane Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package main import ( //"encoding/json" // "net" "reflect" "runtime" "sync" "sync/atomic" "time" "github.com/lxt1045/geocache/msg" "github.com/lxt1045/kits/io/gob" "github.com/lxt1045/kits/log" ) var ( goN int goroutineMax int exitFlags int32 sendPkgN int64 recvPkgN in...
package roberta import ( "fmt" "github.com/sugarme/gotch" "github.com/sugarme/gotch/nn" ts "github.com/sugarme/gotch/tensor" "github.com/andrewyang17/transformer/bert" "github.com/andrewyang17/transformer/util" ) // RobertaEmbeddings holds embedding struct for Roberta model. // It also implements `BertEmbeddi...
package kafka /** * Copyright 2016 Confluent 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 la...
package main import ( "bufio" "bytes" "fmt" "os" ) func main() { reader := bufio.NewReader(os.Stdin) var buf bytes.Buffer tc := readNum(reader) for tc > 0 { tc-- n, q := readTwoNums(reader) A := readNNums(reader, n) solver := NewSolver(n, A) for q > 0 { q-- s, _ := reader.ReadBytes('\n') ...
///usr/bin/env go run ${0} ${@} ; exit ${?} // the line above is a shebang-like line for golang // chmod +x battleship.go // ./battleship.go package main /* H u m a n C o m p u t e r +------------------------------------------------------------------------+ | A B C D E ...
package envtest import ( "context" "fmt" "path" "path/filepath" goruntime "runtime" "strings" "testing" etcdv1 "github.com/mrajashree/etcdadm-controller/api/v1beta1" admissionv1beta1 "k8s.io/api/admission/v1beta1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/ap...
package goproxy import ( "crypto/tls" "fmt" "net/http" "strings" "time" //"net/http/httptrace" "context" "github.com/winstonprivacyinc/winston/shadownetwork" //"errors" //"net/http/httputil" ) type RoundTripper interface { RoundTrip(req *http.Request, ctx *ProxyCtx) (*http.Response, error) } type RoundTri...
/*--------------------------------------------------------------------------------------------- * Copyright (c) IBAX. All rights reserved. * See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ package queryBuilder ...
package syntax import ( "fmt" "reflect" "testing" ) func TestParser(t *testing.T) { tests := map[string]struct { wantExpr ParseTree wantString string wantErr *ParseError }{ "": {wantExpr: []*Expr{}}, " ": {wantExpr: []*Expr{}, wantString: ""}, " ": {wantExpr: []*Expr{}, wantString: ""}, "a...
package golinkedin import ( "encoding/json" "net/url" "strconv" ) type PeopleNode struct { Metadata Metadata `json:"metadata,omitempty"` Elements []People `json:"elements,omitempty"` Paging Paging `json:"paging,omitempty"` Keywords string `json:...
package cacheutil import ( "fmt" "log" "sync" "time" "github.com/redhat-service-assurance/smart-gateway/internal/pkg/incoming" ) // MAXTTL to remove plugin is stale for 5 var MAXTTL int64 = 300 var freeList = make(chan *IncomingBuffer, 1000) var quitCacheServerCh = make(chan struct{}) var debugc = func(format s...
/* * Copyright (c) 2017, MegaEase * 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 ap...
package streaming import ( "context" "net/http" "net/url" "strconv" "time" "github.com/inconshreveable/log15" otlog "github.com/opentracing/opentracing-go/log" "github.com/sourcegraph/sourcegraph/internal/database" streamhttp "github.com/sourcegraph/sourcegraph/internal/search/streaming/http" "github.com/s...
package main import ( "./lib" "github.com/mitroadmaps/gomapinfer/common" "bytes" "fmt" "io/ioutil" "math" "os" ) const TILE_SIZE = 4096 const ROAD_WIDTH = 30 const D = 20 type GraphContainer struct { Graph *common.Graph Index common.GridIndex RoadSegments []common.RoadSegment EdgeToSegment map[int]common...
// schannel_nc is a netcat-like program that communicates with secure channels. package main import ( "flag" "fmt" "io" "log" "net" "os" "path/filepath" "github.com/kisom/die" "github.com/kisom/go-schannel/schannel" ) var ( idPriv *[64]byte idPub *[32]byte ) func usage() { progName := filepath.Base(os....
/* 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 znet import ( "net" "net/http" "net/http/httptest" "strconv" "testing" "github.com/sohaha/zlsgo" "github.com/sohaha/zlsgo/ztype" ) func TestNetIP(tt *testing.T) { t := zlsgo.NewTest(tt) r := newServer() r.GET("/ip", func(c *Context) { t.Equal("", c.GetClientIP()) ip := "127.0.0.1" ipb := uint...
package storages import ( "bytes" "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/smithy-go" "github.com/aws/smithy-go/transport/http" ss3 "github.com/m...
package synccontroller import ( "fmt" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/kubernetes" cscloud "github.com/containership/csctl/cloud" csv3 "github.com/containership/cluster-manager/pkg/apis/containership.io/v3" csclients...
package main import ( "encoding/binary" "fmt" "github.com/zshorz/ezlog" "github.com/zshorz/shadowsocks/ss" "io" "net" "os" "strconv" "strings" "syscall" ) const logCntDelta = 1000 var connCnt int var nextLogConnCnt = logCntDelta func run(port, password string) { ln, err := net.Listen("tcp", ":"+port) if...
// Copyright 2019 The gVisor 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 path import ( "math/rand" "time" "example.com/graph" ) type nonObliviousLocal struct { network graph.Topology path Path isFinished bool curr *graph.Node //src *graph.Node //dest *graph.Node } func (nol *nonObliviousLocal) Build(network graph.Topology) {...
// Copyright 2018 Northern.tech AS // // 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 sio import ( "bufio" "encoding/binary" "fmt" "io" "strings" "unsafe" ) var DefaultBufSize int = 4096 type Reader struct { breader *bufio.Reader n uint64 } func NewReader(rd io.Reader) *Reader { return NewReaderSize(rd, DefaultBufSize) } // NewReaderSize 创建一个新的 Reader func NewReaderSize(rd io...
package types type NodeType string const ( GPUShareNode NodeType = "GPUShare" GPUExclusiveNode NodeType = "GPUExclusive" GPUTopologyNode NodeType = "GPUTopology" NormalNode NodeType = "Normal" UnknownNode NodeType = "unknown" AllKnownNode NodeType = "" ) type NodeTypeInfo struct { Name ...
// // Copyright 2017 Tink AB // // 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) 2015 Western Digital Corporation or its affiliates. All rights reserved. // SPDX-License-Identifier: MIT package raft import ( log "github.com/golang/glog" ) // coreCandidate represents the state of candidate. type coreCandidate struct { c *core // Received votes for this candidate on current te...
package lintersdb import ( "sort" "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/golinters" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/logutils" ) type EnabledSet struct { m *Manager v *Validator log logutils.Log cfg ...
package nit import ( "go/ast" "go/token" "strings" "github.com/pkg/errors" ) type ( // ImportsSection represents one of the 3 valid `imports` sections. ImportsSection uint8 // ImportsSectionMachine represents the `imports` code organization state // machine. ImportsSectionMachine struct { current Import...
package tojvm import ( "encoding/binary" "fmt" "io" "math" ) type Class struct { ConstPool ConstPool Name string Super string Flags uint16 Interfaces []string Fields []Field Methods []Field Attributes []Attribute } type Tag byte // From Table 4.4-A const ( TagClass ...
package main import ( "bytes" "fmt" "os" "os/exec" "strings" "github.com/dadosjusbr/coletores" "github.com/gocarina/gocsv" ) // magistrate_E.go parse all magistrate.pdf from the following months: // 2020: May // Will be used as default for the next months. type magMay struct { // Our example struct, you can ...
package api //go:generate go run github.com/99designs/gqlgen import ( "context" "fmt" "strings" "github.com/99designs/gqlgen/graphql" "github.com/dstotijn/hetty/pkg/proj" "github.com/dstotijn/hetty/pkg/reqlog" "github.com/vektah/gqlparser/v2/gqlerror" ) type Resolver struct { RequestLogService *reqlog.Servi...
package main import ( "net/http" "os" "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/log" "github.com/prometheus/common/version" "gopkg.in/alecthomas/kingpin.v2" ) var ( listenAddress = kingpin.Flag( "listen",...
package px import ( "context" "reflect" "runtime" "github.com/lyraproj/pcore/threadlocal" "github.com/lyraproj/issue/issue" ) const PuppetContextKey = `puppet.context` type VariableState int const NotFound = VariableState(0) const Global = VariableState(1) const Local = VariableState(2) // VariableStates is...
// Package store implments the database store that is utilizied by the service. package store import ( "database/sql" "errors" "sync" "github.com/gdotgordon/ipverify/types" // Load sqlite3 driver _ "github.com/mattn/go-sqlite3" "go.uber.org/zap" ) const sqlAdditem = ` INSERT INTO items( Uuid, Username,...
// *** 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/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Creates a new AuthorizationPolicy in a given...
package bitflyer import ( "buy-btc/utils" "encoding/hex" "encoding/json" "errors" "crypto/hmac" "crypto/sha256" "strconv" "time" ) const baseURL = "https://api.bitflyer.com" const productCodeKey = "product_code" const btcMinimumAmount = 0.001 //bitflyerにおけるBTCの最小注文数量 const btcPlace = 4.0 type APIClient stru...
/* Copyright (c) 2016, immortal 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, this list of conditions and the following discl...
package install import ( "context" "fmt" "io" "os" "strings" "time" "github.com/jenkins-x/jx-helpers/v3/pkg/builds" "github.com/jenkins-x/jx-helpers/v3/pkg/cmdrunner" "github.com/jenkins-x/jx-helpers/v3/pkg/cobras/helper" "github.com/jenkins-x/jx-helpers/v3/pkg/cobras/templates" "github.com/jenkins-x/jx-he...
package integrator import ( "fmt" "math" . "github.com/tatsy/gopt/src/core" ) type PathIntegrator struct { } func (integrator *PathIntegrator) Render(scene *Scene, sensor Sensor, sampler Sampler, params *RenderParams) { width := sensor.Film().Width height := sensor.Film().Height numSamples := params.GetInt("i...
/* Copyright 2019 The KubeCarrier 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,...
// Code generated by go-swagger; DO NOT EDIT. package catalog_category_repository_v1 // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/ru...
/* deployment.go Copyright (c) 2019-2020 VMware, Inc. SPDX-License-Identifier: https://spdx.org/licenses/MIT.html */ package controllers import ( "context" "path" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ctrl "sigs.k8s.io/controller-runtime" appsv1 "k8s.io/api/apps...
package main import ( "bufio" "bytes" "encoding/json" "flag" "fmt" "io/ioutil" "net/http" "net/url" "os" "os/user" "strconv" "strings" "time" ) var ( device string message string priority string sound string timestamp string title string tokenKey string urlPath string urlTitle ...
/* Copyright (c) 2015, Alcatel-Lucent Inc 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, this list of condi...
// +build js,wasm package js_test import ( "fmt" "testing" "github.com/dairaga/srx/js" "github.com/stretchr/testify/assert" ) func TestElementOK(t *testing.T) { el := js.HTML(`<div></div>`).Element() assert.True(t, el.OK()) el = js.ElementOf(js.ValueOf("")) assert.False(t, el.OK()) } func TestElementProp...
// Copyright 2016 The Serviced 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 restapi import ( "crypto/tls" "embed" "gopcep/certs" "gopcep/controller" "net/http" "strings" "time" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" ) //go:embed static/* var f embed.FS type Config struct { Address string Port string CertFile string K...
// Package geolocate implements IP lookup, resolver lookup, and geolocation. package geolocate import ( "context" "fmt" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/version" ) const ( // DefaultProbeASN is the default probe ASN as a number. DefaultProbeASN uint = 0...
// Copyright 2021 ETH Zurich // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wri...
package ws import ( "fmt" "net/http" "bgtools-api/models" "github.com/gorilla/websocket" ) // <summary>: プレイヤーの接続情報をまとめた構造体 type PlayerConn struct { C *websocket.Conn RoomId string } var ( // <summary>: WebSocket開始用パラメータ wsUpgrader = websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024...
// Copyright (c) 2020 Zededa, Inc. // SPDX-License-Identifier: Apache-2.0 package volumemgr // Interface to worker to run the create and destroy in separate goroutines import ( "time" "github.com/lf-edge/eve/pkg/pillar/types" "github.com/lf-edge/eve/pkg/pillar/worker" ) // InitHandleWork returns an object with ...
// Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. //go:build orchestrator // +build orchestrator package k8s import ( "c...
// Copyright 2020 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...
package l3gd20 // Expected identification number for L3GD20. const ( // For L3GD20 expectedWHOAMI = 0xD4 // For L3GD20H expectedWHOAMI_H = 0xD7 ) // Register bits masks const ( reg5RebootBit = 1 << 7 reg5FIFOEnableBit = 1 << 6 reg1NormalBits = 0b1111 ) // Register addresses. Comments from https://githu...
package apps import ( "bufio" "bytes" "image" "image/png" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "sync" "github.com/srwiley/oksvg" "github.com/srwiley/rasterx" open "github.com/ventsislav-georgiev/prosper/pkg/helpers/exec" ) const ( sysAppsPath = "/usr/share/applications/" sysAppsPath2 ...
package main import ( "bytes" "flag" "fmt" "io" "log" "os" "path/filepath" "strings" "github.com/kamichidu/goen/generator" "github.com/kamichidu/goen/internal/asts" "github.com/tcnksm/go-latest" ) var latestSource = &latest.GithubTag{ Owner: "kamichidu", Repository: "goen", } type excludeGlobsFlag...
package utils import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "os" "time" "github.com/briandowns/spinner" "github.com/manifoldco/promptui" "github.com/mgutz/ansi" terminal "github.com/wayneashleyberry/terminal-dimensions" ) type PostJSON struct { Data struct { Post struct { Name ...
// Copyright (C) 2019 Orange // // This software is distributed under the terms and conditions of the 'Apache License 2.0' // license which can be found in the file 'License.txt' in this package distribution // or at 'http://www.apache.org/licenses/LICENSE-2.0'. package db_test import ( "context" "database/sql" ...
// Code generated by goagen v1.3.1, DO NOT EDIT. // // API "types": array_prism Resource Client // // Command: // $ goagen // --design=github.com/nikhil-thomas/technik-dojo/goa-exp/goa-examples/02_types/design // --out=$(GOPATH)/src/github.com/nikhil-thomas/technik-dojo/goa-exp/goa-examples/02_types // --version=v1.3.1...
// Copyright (c) 2020-2021 Blockwatch Data Inc. // Author: <EMAIL> package tzpro import ( "bytes" "context" "encoding/hex" "encoding/json" "fmt" "strconv" "strings" "time" "blockwatch.cc/tzgo/micheline" "blockwatch.cc/tzgo/tezos" ) type Constant struct { RowId uint64 `json:"row_id"` Addres...
package servers import ( "database/sql" "encoding/json" "github.com/bor3ham/reja/schema" "github.com/bor3ham/reja/utils" "github.com/gorilla/context" "github.com/mailru/easyjson" "github.com/mailru/easyjson/jwriter" "log" "net/http" "sync" "time" ) type CachedInstance struct { Instance schema.Instance ...
// Code generated by vfsgen; DO NOT EDIT package test_test import ( "net/http" "os" "time" ) // We imported "os", but may end up not using it. Avoid unused import error. var _ os.FileInfo // assets statically implements the virtual filesystem provided to vfsgen. var assets = func() http.FileSystem { mustUnmarsh...
// Licensed to 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. Apache Software Foundation (ASF) licenses this file to you under // the Apache License, Version 2.0 (the "Li...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iot 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" ) type CreateThingGroupInput struct { _ struct{} `type:"structure"` // The nam...
package testutil import ( "bytes" "fmt" "math" "math/rand" "os" "path/filepath" "strings" "testing" "time" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/sts" "github.com/gruntwork-io/terratest/modules/aws" "github.com/gruntwork-io/terr...
package testkit import ( "fmt" "github.com/stretchr/testify/require" v1apps "k8s.io/api/apps/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "time" ) const ( gatewayNameFormat = "%s-gateway" gatewayRoleFormat = "%s-gateway-role" gatewayRoleBi...
package main import ( "encoding/binary" "errors" "fmt" "image" "image/draw" "image/png" "io" "os" "path/filepath" "github.com/adinfinit/texpack/maxrect" ) type TexPackerOptions struct { MaxBounds image.Point StripPrefix string } type TexPacker struct { outfile string options TexPackerOptions images...