text stringlengths 3.08k 10.4k |
|---|
package main
import (
"fmt"
"io"
"os"
"os/exec"
"strings"
"time"
)
type (
Executor struct {
logger io.Writer
}
)
func (this *Executor) Run(name string, args ...string) error {
if name == "ssh" {
// Automatically inject ssh parameters.
args = append(defaultSshParametersList, args...)
}
io.WriteString... |
package main
import (
"context"
"fmt"
apierr "k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/dynamic"
"k8s... |
package trees
import (
"github.com/tddhit/golearn/base"
"math"
"sort"
)
//
// Information gain rule generator
//
// InformationGainRuleGenerator generates DecisionTreeRules which
// maximize information gain at each node.
type InformationGainRuleGenerator struct {
}
// GenerateSplitRule returns a DecisionTreeNod... |
// Package billmodel contains the types for schema 'equinox'.
package billmodel
// GENERATED BY XO. DO NOT EDIT.
import (
"database/sql"
"github.com/lib/pq"
)
// Crprob represents a row from 'equinox.crprobs'.
type Crprob struct {
Crpid sql.NullInt64 `json:"crpid"` // crpid
Crpdate ... |
package gateway
import (
"bytes"
"context"
"encoding/json"
"io/ioutil"
"net/http"
"reflect"
"strings"
"google.golang.org/genproto/protobuf/field_mask"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"github.com/infobloxopen/atlas-app-toolkit/util"
)
const (
fieldPresenceMetaKey = "field-paths... |
package fsapi
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/user"
"path"
"strings"
"time"
"github.com/IronhandedLayman/icfp-origami/objs"
)
type FoldServerBasic struct {
website string
apikey string
lastRequest time.Time
cacheDir string
useCache bool
}
func ... |
// CookieJar - A contestant's algorithm toolbox
// Copyright (c) 2013 <NAME>. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your... |
/*******************************************************************************
*
* Copyright 2018 SAP SE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You should have received a copy of the License along with this
* program. If... |
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
package main
import (
"regexp"
"golang.org/x/crypto/ssh"
)
type IaasPlatform interface {
CreateVfxt(avereVfxt *AvereVfxt) error
AddIaasNodeToCluster(avereV... |
/*
Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
A copy of the License is located at
http://www.apache.org/licenses/LICENSE-2.0
or in the "license... |
// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package controllers
import (
"context"
"fmt"
"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-ru... |
package envflag
import (
"errors"
"flag"
"fmt"
"log"
"os"
"strings"
)
var (
debugEnabled = false
)
// EnvFlag represents a envflag object that contains several settings.
type EnvFlag struct {
flagSet *flag.FlagSet // the flagSet to process
minLength int // minLength defin... |
// Copyright 2015 The Serulian 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 scopegraph
import (
"fmt"
"github.com/serulian/compiler/compilercommon"
"github.com/serulian/compiler/compilergraph"
"github.com/serulian/co... |
// Copyright 2016 The Vanadium 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 gerrit
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"go.fuchsia.dev/jiri/collect"
)
// The functions in this file are provided to suppo... |
// Copyright © 2018 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: BSD-2-Clause
package processors
import (
"bytes"
"fmt"
"path"
"strings"
"github.com/vmware/kube-fluentd-operator/config-reloader/datasource"
"github.com/vmware/kube-fluentd-operator/config-reloader/fluentd"
"github.com/vmware/ku... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package common
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/hyperledger/aries-framework-go-ext/component/storage/couchdb"
"github.com/hyperledger/aries-framework-go-e... |
// Copyright 2019 The Chromium 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 main
import (
"fmt"
"strconv"
"strings"
"time"
"context"
"go.chromium.org/luci/common/api/gerrit"
"go.chromium.org/luci/common/data/stri... |
package virtualmachine
import (
"encoding/json"
"fmt"
admissionregv1 "k8s.io/api/admissionregistration/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/runtime"
kubevirtv1 "kubevirt.io/api/core/v1"
ctlharvesterv1 "gith... |
package txn
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
"gopkg.in/validator.v2"
"github.com/Jaskaranbir/es-bank-account/eventutil"
"github.com/Jaskaranbir/es-bank-account/logger"
"github.com/Jaskaranbir/es-bank-account/model"
)
// creator handles validating commands a... |
// Copyright 2011, <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
/*
* Filename: godu.go
* Author: <NAME> <<EMAIL>>
* Created: Tue Jul 5 22:13:49 PDT 2011
* Description:
* Usage: godu [optio... |
package universe
import (
"context"
"github.com/apache/arrow/go/v7/arrow/memory"
"github.com/influxdata/flux"
"github.com/influxdata/flux/array"
"github.com/influxdata/flux/arrow"
"github.com/influxdata/flux/codes"
"github.com/influxdata/flux/compiler"
"github.com/influxdata/flux/execute"
"github.com/influxd... |
// Package versions fetches Mojang's versions listing of Minecraft, allowing
// clients to determine what the latest version is.
//
// This is useful to determine whether the latest version of the game is
// installed and/or construct download URLs for the latest versions of the game.
// For example:
// vs, err := vers... |
package nvjpeg
/*
#include <nvjpeg.h>
#include<cuda_runtime_api.h>
int dev_malloc_unified(void **p,size_t s) {
return (int)cudaMallocManaged(p,s,cudaMemAttachGlobal);
}
int dev_free(void *p) { return (int)cudaFree(p); }
int host_malloc_unified(void **p,size_t s,unsigned int flags){
return (int)cudaMallocManaged(p... |
package certadd
import (
"bytes"
"encoding/hex"
"encoding/json"
"io/ioutil"
"math/big"
"net/http"
"time"
"github.com/ironstar-io/tokaido/system/ssl/cfssl/api"
"github.com/ironstar-io/tokaido/system/ssl/cfssl/certdb"
"github.com/ironstar-io/tokaido/system/ssl/cfssl/errors"
"github.com/ironstar-io/tokaido/sy... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/testing/testing.proto
package testingpb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// ... |
// Copyright 2019 Aporeto 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,... |
package backend
import (
"fmt"
"math/rand"
"testing"
"time"
"github.com/Azure/azure-sdk-for-go/storage"
"github.com/khenidak/london/pkg/backend/consts"
storageerrors "github.com/khenidak/london/pkg/backend/storageerrors"
"github.com/khenidak/london/pkg/backend/storerecord"
"github.com/khenidak/london/pkg/ba... |
/*
** Copyright [2013-2017] [Megam 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 agr... |
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/datasource"
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
"github.com/grafana/grafana-plug... |
package etcd
import (
"fmt"
"github.com/openshift/cluster-kube-apiserver-operator/pkg/operator/configobservation"
"github.com/openshift/library-go/pkg/operator/events"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/client-go/kube... |
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strconv"
"sync"
"time"
"github.com/shapeshift-legacy/coinquery/services/blockbuster/csv"
)
// Disclaimer: This was some side work done to help Danielle with auditing and
// at some point will become a proper story and have some real cycles s... |
/*
* Copyright 2020 Saffat Technologies, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
package rus
// References:
// https://en.wikipedia.org/wiki/Romanization_of_Russian
// https://tt.se/tt-spraket/ord-och-begrepp/internationellt/andra-sprak/ryska/
import (
"fmt"
"regexp"
"strings"
tr "github.com/stts-se/translit"
)
type pair struct {
s1 string
s2 string
}
type rPair struct {
from *regexp.Re... |
// Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
package pool
import (
"fmt"
"sync"
"time"
"github.com/jolestar/go-commons-pool/collections"
)
// PooledObjectState is PooledObjectState enum const
type PooledObjectState int
const (
// StateIdle in the queue, not in use. default value.
StateIdle PooledObjectState = iota
// StateAllocated in use.
StateAlloca... |
package exe
// http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header
// STATUS: 1%
import (
"os"
"github.com/martinlindhe/formats/parse"
)
var (
gbLogo = []byte{
0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B,
0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D,
0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E,... |
// Copyright 2018 - <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... |
/*
Copyright (C) 2017 Red Hat, 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 llvm_module
import (
"github.com/grainlang/grain/ast"
"llvm.org/llvm/bindings/go/llvm"
"strconv"
)
func CreateLlvmModuleFromFunction(function ast.Function, allFunctions []ast.Function) llvm.Module {
context := llvm.GlobalContext()
builder := context.NewBuilder()
module := context.NewModule(function.Id +... |
package registry
import (
"context"
"log"
"os"
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/network"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tilt-dev/ctlptl/internal/exec"
"github.com/tilt-dev/ctlptl/pkg/api"
metav... |
/* Copyright (C) 2017 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this file (originally named buttons.go) and associated documentation files
* (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, ... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
// Copyright 2017 <NAME>. 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 venmoslack
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
"path"
"time"
"golang.org/x/net/context"
"google.golang.org/appengine"
"google... |
package anonuuid
import (
"fmt"
"log"
"math/rand"
"regexp"
"strings"
"sync"
"time"
)
var (
// UUIDRegex is the regex used to find UUIDs in texts
UUIDRegex = "[a-z0-9]{8}-[a-z0-9]{4}-[1-5][a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}"
)
// AnonUUID is the main structure, it contains the cache map and helpers
type Ano... |
/*
* Copyright 2021-present Ciena Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... |
package e2e_test
import (
"context"
"encoding/json"
"net/http"
"sort"
"testing"
"time"
"github.com/improbable-eng/thanos/pkg/runutil"
"github.com/improbable-eng/thanos/pkg/testutil"
"github.com/pkg/errors"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/pkg/timestamp"
)
const always... |
package logdb
import (
"os"
"testing"
"github.com/hashicorp/errwrap"
"github.com/stretchr/testify/assert"
)
// These all test the 'LockFreeChunkDB' loading error cases, so there's no need to try other databases.
func TestChunkDB_NoOpenFile(t *testing.T) {
if err := writeFile("test_db/no_open_file", uint8(1)); ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package quicksight
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 DeleteIAMPolicyAssignmentInput struct {
_ struct{} `type:"structur... |
package compute
import (
"fmt"
"strings"
)
// Resources are an abstraction over the various types of entities in the DD compute API
// ResourceType represents a well-known DD compute resource type.
type ResourceType int
const (
// ResourceTypeNetworkDomain represents a network domain.
ResourceTypeNetworkDomain ... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
)
// 生成的 Markdown 文档前缀
var errCodeDocPrefix = `# 错误码
!!SharkAgent 系统错误码列表,由 {{.}}codegen -type=int -doc{{.}} 命令生成,不要对此文件做任何更改。
## 功能说明
如果返回结果中存在 {{.}}code{{.}} 字段,则表示调用 API 接口失败。例如:
{{.}}{{.}}{{.}}json
{
"code": 100101,
... |
package accumulator
import (
"fmt"
"os"
)
// leafSize is a [32]byte hash (sha256).
// Length is always 32.
const leafSize = 32
// A forestData is the thing that holds all the hashes in the forest. Could
// be in a file, or in ram, or maybe something else.
type ForestData interface {
read(pos uint64) Hash
write(... |
package gista_helpers
import (
"encoding/json"
"io/ioutil"
"net/http"
"net/http/cookiejar"
"net/url"
"regexp"
"strings"
"github.com/kr/pretty"
)
type ChallengeResponse struct {
Config *ChallengeResponseConfig `json:"config"`
EntryData *ChallengeResponseEntryData `json:"entry_data"`
RollOutHash s... |
package server
import (
"context"
"fmt"
"net"
"net/http"
"time"
"github.com/aserto-dev/go-utils/certs"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"github.com/rs/zerolog"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
healthpb "g... |
package cmd
import (
"encoding/json"
"fmt"
"net/http"
"strings"
"github.com/matheuscscp/fd8-judge/judge"
"github.com/matheuscscp/fd8-judge/pkg/services"
"github.com/spf13/cobra"
)
func init() {
defineJudgeCommand()
}
type (
// executeFlags holds the flags for the judge execute command.
executeFlags struct... |
package repl
import (
"context"
"fmt"
"io"
"os"
"strings"
"syscall"
gosig "os/signal"
gm "github.com/mitchellh/go-mruby"
"github.com/box-builder/box/builder/command"
"github.com/box-builder/box/builder/evaluator"
"github.com/box-builder/box/builder/evaluator/mruby"
"github.com/box-builder/box/builder/ex... |
package thorchain
import (
"fmt"
"github.com/blang/semver"
sdk "github.com/cosmos/cosmos-sdk/types"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornode/constants"
"gitlab.com/thorchain/thornode/x/thorchain/keep"
)
// LeaveHandler a handler to process leave request
// if an operator of THORCh... |
package containers
import (
_ "fmt"
"log"
"os"
"testing"
"time"
)
type cacheStruct struct {
id int
name string
}
func init() {
cacher.clearPrepare = func(items []interface{}) {
log.Println(items, cacher.items)
}
}
var (
cacher = NewCache(time.Second*10, time.Second*15, nil)
listCallback = func(... |
package instruction
import (
"reflect"
"strings"
"testing"
"github.com/open-machine/assembler/data"
"github.com/open-machine/assembler/helper"
)
func TestGetNoParam(t *testing.T) {
got, err := getParamNoParam("nop", []string{"nop"})
if !(err == nil && !got.IsStr && got.Num == 0) {
t.Errorf("Wrong")
}
}
fu... |
// _ _
// __ _____ __ ___ ___ __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
// \ V V / __/ (_| |\ V /| | (_| | || __/
// \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
// Copyright © 2016 - 2019 SeMI Holding B.V. (registered @ Dutch Chamber of Commerce no 752216... |
package vault
import (
"context"
"fmt"
"os"
"path/filepath"
"text/template"
"time"
"github.com/cenkalti/backoff"
"github.com/hashicorp/vault/api"
log "github.com/sirupsen/logrus"
"github.com/uswitch/vault-creds/pkg/metrics"
)
type DefaultManager struct {
client *api.Client
secret Secret
lease tim... |
package dashboard
import (
"context"
"fmt"
"net/http"
"sort"
dashv1alpha1 "github.com/cosmo-workspace/cosmo/api/openapi/dashboard/v1alpha1"
wsv1alpha1 "github.com/cosmo-workspace/cosmo/api/workspace/v1alpha1"
"github.com/cosmo-workspace/cosmo/pkg/clog"
"github.com/cosmo-workspace/cosmo/pkg/wsnet"
"k8s.io/api... |
package service
import (
"context"
"fmt"
"math/rand"
"time"
"go-common/library/log"
"go-common/library/xstr"
pb "go-common/app/service/live/xroom-feed/api"
)
// GetList implementation
// 根据模块位置获取投放列表 position=>RoomItem
func (s *Service) GetList(ctx context.Context, req *pb.RecPoolReq) (resp *pb.RecPoolResp, ... |
// Copyright 2022 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 types
// Implementation of structural type computation for types.
// TODO: we would like to depend only on the types2 computation of structural type,
... |
package main
import (
"context"
"fmt"
"strings"
"time"
"github.com/ovh/cds/sdk"
"github.com/spf13/cobra"
"github.com/mum4k/termdash"
"github.com/mum4k/termdash/cell"
"github.com/mum4k/termdash/container"
"github.com/mum4k/termdash/linestyle"
"github.com/mum4k/termdash/terminal/termbox"
"github.com/mum4k/... |
// Copyright 2012 Lightpoke. All rights reserved.
// This source code is subject to the terms and
// conditions defined in the "License.txt" file.
package organics
import (
"fmt"
"sync"
"time"
)
// Session represents an user's session, which is built up of zero to multiple
// different connections.
//
// An sessi... |
// Copyright © 2017-2019 <NAME>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
package libs
import (
"github.com/gotranspile/cxgo/runtime/cnet"
"github.com/gotranspile/cxgo/types"
)
const (
sysSocketH = "sys/socket.h"
)
func init() {
RegisterLibrary(sysSocketH, func(c *Env) *Library {
intT := types.IntT(4)
int16T := types.IntT(2)
uint16T := types.UintT(2)
gintT := c.Go().Int()
ui... |
/*
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, ... |
package cmd
import (
"fmt"
"log"
"net/http"
"net/url"
"os"
"runtime"
"strconv"
"strings"
"time"
"github.com/fatih/color"
"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v3/host"
"github.com/shirou/gopsutil/v3/load"
"github.com/shirou/gopsutil/v3/mem"... |
package storagepb
import (
"net"
"sort"
"testing"
"github.com/stretchr/testify/assert"
)
var (
testGroup = &Group{
Id: "node1",
Name: "test group",
Profile: "g1h2i3j4",
Selector: map[string]string{
"uuid": "a1b2c3d4",
"mac": "52:da:00:89:d8:10",
},
Metadata: []byte(`{"some-key":"some-... |
package migrations
import (
"github.com/muharihar/d3ta-go/database/base"
"github.com/muharihar/d3ta-go/system/handler"
_ "gorm.io/driver/mysql"
_ "gorm.io/driver/postgres"
_ "gorm.io/driver/sqlite"
_ "gorm.io/driver/sqlserver"
"gorm.io/gorm"
)
// NewMS0103CreateAndInitCasbin new MS0103CreateAndInitCasbin
func... |
// uplane_tun.go - 3GPP TS 29.244 GTP-U UP plug-in
//
// Copyright (c) 2021 Travelping 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/LICEN... |
package s3
import (
"testing"
"fmt"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/stretchr/testify/assert"
)
func setEnv() {
os.Setenv("AWS_ACCESS_KEY_ID", "accessKey")
os.Setenv("AWS_SECRET_ACCESS_KEY", "se... |
/*
Copyright 2019 kubeflow.org.
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
dist... |
package main
import (
"flag"
"log"
"net"
"strconv"
"strings"
"github.com/tylertreat/comcast/throttler"
)
func main() {
// TODO: Add support for other options like packet reordering, duplication, etc.
var (
device = flag.String("device", "", "Interface (device) to use (defaults to eth0 where applicable... |
//Copyright 2013 GoGraphviz Authors
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in... |
package dev
import (
"context"
"fmt"
"time"
"github.com/0xPolygon/polygon-edge/blockchain"
"github.com/0xPolygon/polygon-edge/consensus"
"github.com/0xPolygon/polygon-edge/helper/progress"
"github.com/0xPolygon/polygon-edge/state"
"github.com/0xPolygon/polygon-edge/txpool"
"github.com/0xPolygon/polygon-edge/... |
package users
import (
"database/sql"
"fmt"
"github.com/lbryio/lbrytv/internal/lbrynet"
"github.com/lbryio/lbrytv/internal/monitor"
"github.com/lbryio/lbrytv/models"
"github.com/sirupsen/logrus"
"github.com/lib/pq"
xerrors "github.com/pkg/errors"
"github.com/volatiletech/sqlboiler/boil"
)
// WalletService ... |
package logger
import (
"fmt"
"os"
"strings"
"text/tabwriter"
)
var (
reset = "\033[0m"
red = "\033[31m"
green = "\033[32m"
yellow = "\033[33m"
blue = "\033[34m"
purple = "\033[35m"
cyan = "\033[36m"
white = "\033[37m"
)
type Logger struct{}
// A Row holds the row content and basic type
type R... |
package mchv3
import (
"crypto"
"crypto/aes"
"crypto/cipher"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/json"
"encoding/pem"
"fmt"
"math/rand"
"net/http"
"strings"
"time"
)
type CertResponse struct {
Data []struct {
SerialNo string `json:"serial_no"` ... |
// Copyright 2021 The Wuffs 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package main
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"regexp"
)
const (
chromeWebStoreURL = "https://clients2.google.com/service/update2/crx?response=redirect"
reExtendionID = `[a-z]{32}`
)
var (
errHTTPStatusCodeNotOK = errors.New("http down... |
package models
import (
"context"
"fmt"
"strings"
"time"
"cloud.google.com/go/spanner"
"github.com/usmbest/go-number"
"github.com/usmbest/ocean.one/example/session"
"google.golang.org/api/iterator"
)
const (
CandleGranularity1M = 60
CandleGranularity5M = 300
CandleGranularity15M = 900
CandleGranularity... |
package hll
import (
"errors"
"fmt"
"log"
"os"
"github.com/zeebo/xxh3"
)
const (
genBiasVerboseFlag = "HLL_BIAS_LOG"
)
// BiasEstimate holds an average cardinality estimate and a average resulting bias. This is produced by running a number
// of simulations on a set containing exactly TrueCardinality. (I.e. I... |
package salon
import (
"math/rand"
)
const (
LABLeft = 1 << 0
LABRight = 1 << 1
LABTop = 1 << 2
LABDown = 1 << 3
)
var Field = map[string]int{
"cross": LABLeft | LABRight | LABTop | LABDown,
"downleft": LABLeft | LABDown,
"downright": LABRight | LABDown,
"edown": LABDown,
"eleft": LAB... |
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// ... |
package pg
import (
"context"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/jmoiron/sqlx"
sqlx_types "github.com/jmoiron/sqlx/types"
"github.com/resourced/resourced-master/contexthelper"
)
func NewTSCheck(ctx context.Context, clusterID int64) *TSCheck {
ts := &TSCheck{}
... |
package logx
import (
"fmt"
"io"
"os"
"path/filepath"
"runtime"
"time"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
rotatelogs "github.com/iproj/file-rotatelogs"
"github.com/Xwudao/junet"
)
const (
JSON = "json"
TEXT = "text"
)
//type JLogHook func(zapcore.Entry) error
//var z = zap.New(zapcore.NewCor... |
package models
type (
GameMode string // 游戏模式
GameQueueID int // 游戏队列模式id
GameQueueType string // 游戏队列模式
GameStatus string // 游戏状态
RankTier string // 排位等级
GameType string // 游戏类型
Spell int // 召唤师技能
Champion int // 英雄
Lane string // 位置
ChampionRole string //... |
// Copyright 2020 FairwindsOps 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 t... |
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law o... |
package main
import (
"fmt"
"os"
"encoding/json"
"io/ioutil"
"github.com/dsoprea/go-iptc"
"github.com/dsoprea/go-logging"
"github.com/jessevdk/go-flags"
"github.com/dsoprea/go-jpeg-image-structure/v2"
)
// TODO(dustin): Add comments to all of these structs.
var (
options = &struct {
Filepath stri... |
package crmanager
import (
"fmt"
"reflect"
"strings"
"time"
cisapiv1 "github.com/F5Networks/k8s-bigip-ctlr/config/apis/cis/v1"
"github.com/F5Networks/k8s-bigip-ctlr/pkg/pollers"
"github.com/F5Networks/k8s-bigip-ctlr/pkg/vxlan"
log "github.com/F5Networks/k8s-bigip-ctlr/pkg/vlogger"
v1 "k8s.io/api/core/v1"
)... |
// Copyright 2016 <NAME>. All rights reserved.
//
// Use of this source code is governed by a permissive BSD 3 Clause License
// that can be found in the license file.
package goes
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"github.com/tomask-de/go.geteventstore/atom"
)
// StreamReader provides methods... |
/*
* Copyright 2020, Offchain 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 i... |
//
// command/display.go
//
// Copyright (c) 2016-2017 <NAME>
//
// This software is released under the MIT License.
//
// http://opensource.org/licenses/mit-license.php
//
package command
import (
"bufio"
"context"
"fmt"
"io"
"sort"
"strings"
"sync"
"github.com/jroimartin/gocui"
"github.com/ttacon/chalk"
)... |
package bestof
import (
"fmt"
"net/http"
"net/url"
"reflect"
"sync"
"github.com/jangie/goloadbalancers/util"
)
//ChoiceOfBalancer is a bookkeeping struct
type ChoiceOfBalancer struct {
balancees map[*url.URL]int
highWatermark map[url.URL]int
requestCounter map[url.URL]int
isTesting bool
ran... |
// Copyright 2015 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 date
import (
"fmt"
"regexp"
"strconv"
"time"
)
// These are predefined layouts for use in Date.Format and Date.Parse.
// The reference date used ... |
// Code generated by "mdtogo"; DO NOT EDIT.
package generated
var GenerateKptPkgDocsShort = `The ` + "`" + `generate-kpt-pkg-docs` + "`" + ` function generates opinionated documentation for a [kpt package](https://kpt.dev/book/02-concepts/01-packages).
It works by analyzing the kpt package to generate markdown docu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.