text stringlengths 3.08k 10.4k |
|---|
package main
import (
"context"
"embed"
"encoding/json"
"flag"
"fmt"
"io/fs"
"log"
"net/http"
"os"
"os/signal"
"runtime/debug"
"syscall"
"time"
"github.com/ftauth/ftauth/internal/admin"
"github.com/ftauth/ftauth/internal/auth"
"github.com/ftauth/ftauth/internal/client"
"github.com/ftauth/ftauth/inter... |
package kubeclient
import (
"errors"
"net"
"net/http"
"syscall"
"time"
security "github.com/openshift/client-go/security/clientset/versioned"
"github.com/sirupsen/logrus"
"k8s.io/client-go/kubernetes"
v1 "k8s.io/client-go/tools/clientcmd/api/v1"
utilerrors "github.com/openshift/openshift-azure/pkg/util/err... |
package core
import (
"reflect"
)
// PageLoadOptions contains flags for what parts of the page to load. The flags
// are listed IN ORDER they are used for loading.
// When adding a new flag, make sure it goes in the right order, and make sure
// that the default (false) value results in minimal work. Don't forget to... |
package blocks
import (
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func testBlockStoreCompression(t *testing.T, compression Compression) {
tmpDir, err := ioutil.TempDir("", "sequins-test-")
require.NoError(t, err, "creating a test tmpdir")
bs := N... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package ec2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/sm... |
package statedb
import (
"encoding/json"
"fmt"
"github.com/incognitochain/incognito-chain/privacy/key"
"reflect"
"github.com/incognitochain/incognito-chain/common"
)
//@NOTE this struct is view object only
type StakerInfoSlashingVersion struct {
committeePublicKey string
rewardReceiver key.PaymentAddress
... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"encoding/json"
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
"github.com/ArifulProtik/gograph-notes/ent/notes"
"github.com/ArifulProtik/gograph-notes/ent/user"
"github.com/google/uuid"
)
// Notes is the model entity for the Notes schema.
type... |
package handler
import (
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net"
"github.com/Goss-io/goss/lib"
"github.com/Goss-io/goss/lib/ini"
"github.com/Goss-io/goss/lib/logd"
"github.com/Goss-io/goss/lib/packet"
"github.com/Goss-io/goss/lib/protocol"
)
type NodeParams struct {
Conn net.Conn
Types packet.N... |
/*
* Copyright 2018 The NATS 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... |
/*
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 to in writing, software
distributed under the Li... |
package c4
import (
"fmt"
"hash/fnv"
"github.com/gorgonia/agogo/game"
)
var (
_ game.State = &Game{}
)
type Game struct {
b *Board
history []game.PlayerMove
historical [][]game.Colour
nextToMove game.Player
histPtr int
moveCount int
passCount int
}
//New creates a new game with a board ... |
package someutils
import (
"bytes"
"errors"
"io"
"os"
"time"
)
// A set of invocation (In, Out, ErrOut, and even ErrIn (but ErrIn is usually only used by the special 'Redirector' util)
// Note that Pipables are not expected to use this type (Pipables should not need any dependency on someutils - just the implici... |
// Copyright 2021 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package main
import (
"fmt"
"os"
"log"
"strings"
"time"
"net/http"
"encoding/json"
"io/ioutil"
"github.com/gorilla/mux"
guuid "github.com/google/uuid"
agonesv1 "agones.dev/agones/pkg/apis/agones/v1"
"agones.dev/agones/pkg/client/clientset/versioned"
"agones.dev/agones/pkg/util/runtime"
"k8s.io/apimachi... |
package parser
// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Apache License, Version 2.0 <... |
/*
==================================================================================
Copyright (c) 2019 AT&T Intellectual Property.
Copyright (c) 2019 Nokia
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 co... |
package model
import (
"github.com/evergreen-ci/evergreen"
"github.com/evergreen-ci/evergreen/cloud"
"github.com/evergreen-ci/evergreen/model/distro"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
)
// APIDistro is the model to be returned by the API whenever distros are fetched
type APIDistro struc... |
package main
import (
"flag"
"fmt"
"strings"
"github.com/hashicorp/nomad/api"
"github.com/jasonhancock/go-nagios"
"github.com/pkg/errors"
)
func main() {
fs := flag.CommandLine
p := nagios.NewPlugin("nomad-unplaceable", fs)
p.StringFlag("addr", "http://127.0.0.1:4646", "The address of the Nomad server")
p... |
package netconf
import (
"context"
"log"
"reflect"
"time"
"golang.org/x/crypto/ssh"
)
// unique type to prevent assignment.
type clientEventContextKey struct{}
// ContextClientTrace returns the ClientTrace associated with the
// provided context. If none, it returns nil.
func ContextClientTrace(ctx context.Con... |
package workitem
import (
"reflect"
"sort"
"time"
"github.com/fabric8-services/fabric8-wit/actions/change"
"github.com/fabric8-services/fabric8-wit/log"
errs "github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
)
// WorkItem the model structure for the work item.
type WorkItem struct {
// unique id per ... |
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"net"
"net/http"
"os"
"strconv"
"time"
"code.cloudfoundry.org/perm"
cmdflags "code.cloudfoundry.org/perm/cmd/flags"
"code.cloudfoundry.org/perm/cmd/internal/ioutilx"
"code.cloudfoundry.org/perm/logx"
"code.cloudfoundry.org/perm/metrics"
"code.cl... |
// Copyright 2019 The Sync 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 harmonic
import (
"fmt"
"math"
"math/cmplx"
"math/rand"
"github.com/pointlander/sync/fixed"
"github.com/MaxHalford/eaopt"
"github.com/mjibso... |
package alicloud
import (
"strings"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/aliyun/alibaba-cloud-sdk-go/services/edas"
"github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
func resourceAlicloudE... |
package pools
import (
golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/pagination"
)
// ListOptsBuilder allows extensions to add additional parameters to the
// List request.
type ListOptsBuilder interface {
ToPoolListQuery() (string, error)
}
// ListOpts... |
package config
import (
"fmt"
"io/ioutil"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
// TestLeagueConfig returns a configuration that can be used for testing
// the Base League
func TestLeagueConfig() *LeagueConfig {
return &Config{
BaseConfig: TestBaseConfig(),
RPC: ... |
package model
import (
"fmt"
"sort"
"github.com/Konstantin8105/GoFea/input/element"
"github.com/Konstantin8105/GoFea/input/point"
"github.com/Konstantin8105/GoFea/utils"
)
func (m *Dim2) checkInputData() error {
// TODO add common error slise
errorText := "Not enought data for calculate. %s"
if len(m.points... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License... |
package expr
import (
"errors"
"fmt"
"sort"
"strings"
"github.com/kokes/smda/src/column"
)
var errNoNestedAggregations = errors.New("cannot nest aggregations (e.g. sum(min(a)))")
var errTypeMismatch = errors.New("expecting compatible types")
var errNoTypes = errors.New("expecting at least one column")
type Exp... |
/*
Implementation ddccontrol for GO
Some hint:
- C.struct_monitorlist
- contains information about detected monitor:
- filename: path to i2c dev
- is first monitor info returned from C.ddcci_probe()
- to get(need assign) next use .next
- C.struct_monitor
- opened monitor (C.ddcci_open)
- have some in... |
// Copyright (c) 2016 VMware, Inc. All Rights Reserved.
//
// This product is licensed to you under the Apache License, Version 2.0 (the "License").
// You may not use this product except in compliance with the License.
//
// This product may include a number of subcomponents with separate copyright notices and
// lice... |
// Code generated by protoc-gen-go.
// source: RpcPayloadHeader.proto
// DO NOT EDIT!
package RpcPayloadHeader
import proto "code.google.com/p/goprotobuf/proto"
import json "encoding/json"
import math "math"
// Reference proto, json, and math imports to suppress error if they are not otherwise used.
var _ = proto.Ma... |
package rpc
import (
"github.com/micro/go-micro/server"
"github.com/pborman/uuid"
"github.com/sirupsen/logrus"
"github.com/tomogoma/authms/logging"
"github.com/tomogoma/authms/model"
"golang.org/x/net/context"
errors "github.com/tomogoma/go-typed-errors"
"github.com/tomogoma/authms/api"
"github.com/tomogoma/a... |
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
"strings"
"sync"
"syscall"
"time"
"github.com/rafaelsq/wtc/configuration"
"github.com/rjeczalik/notify"
yaml "gopkg.in/yaml.v2"
)
var config configuration.Config
var contexts map[string]context.CancelFunc
var ctxmutex sync... |
package main
import (
"fmt"
"strconv"
"fyne.io/fyne/widget"
)
type shipCountsAndTons struct {
tons int
tl string
tlOffset int
jump int
jumpTons float32
jumpFuel int
maneuver int
maneuverTons float32
power int
powerTons float32
bridge int
comput... |
package wotlib
// ExpandedThingDescriptionSet set of thing descriptions with some convenience functions
type ExpandedThingDescriptionSet map[string]ExpandedThingDescription
// NewExpandedThingDescriptionSet creates a new set
func NewExpandedThingDescriptionSet(tds ...ExpandedThingDescription) ExpandedThingDescription... |
package x509util
import (
"crypto/x509"
)
// Variables used to hold template data.
const (
SubjectKey = "Subject"
SANsKey = "SANs"
TokenKey = "Token"
InsecureKey = "Insecure"
UserKey = "User"
CertificateRequestKey = "CR"
)
// TemplateError represen... |
/*
Copyright 2017 The Kubernetes Authors.
SPDX-License-Identifier: Apache-2.0
*/
package cdidriver
import (
"os"
"path/filepath"
"github.com/container-storage-interface/spec/lib/go/csi"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"k8s.io... |
package querier
import (
"fmt"
"net/http"
querier_worker "github.com/cortexproject/cortex/pkg/querier/worker"
util_log "github.com/cortexproject/cortex/pkg/util/log"
"github.com/go-kit/log/level"
"github.com/gorilla/mux"
"github.com/grafana/dskit/services"
"github.com/opentracing-contrib/go-stdlib/nethttp"
"... |
// -----------------------------------------------------------------------------
// ZR Library zr/[reflect.go]
// (c) <EMAIL> License: MIT
// -----------------------------------------------------------------------------
package zr
... |
package mlsag
import (
"fmt"
"github.com/incognitochain/go-incognito-sdk-v2/crypto"
)
// Sig represents a MLSAG signature.
type Sig struct {
c *crypto.Scalar // 32 bytes
keyImages []*crypto.Point // 32 * size bytes
r [][]*crypto.Scalar // 32 * size_1 * size_2 bytes
}
// GetC returns s.c.
... |
package controller
import (
"fmt"
"strings"
"syscall"
"github.com/caicloud/canary-release/pkg/util"
releaseapi "github.com/caicloud/clientset/pkg/apis/release/v1alpha1"
"github.com/golang/glog"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/... |
package ldsview
import (
"bufio"
"errors"
"os"
"regexp"
"strings"
"github.com/icza/backscanner"
"github.com/kgoins/ldsview/internal"
)
const LDAPMaxLineSize int = 1024 * 1024 * 10
// LdifParser implements EntityBuilder and constructs LDAP Entities
// from an ldif file.
type LdifParser struct {
filename stri... |
package geom
import (
"fmt"
"math"
"strconv"
"strings"
)
var Origin = Vec{0, 0, 0}
// Vec holds x, y, z values.
type Vec struct {
X, Y, Z float64
}
func ArrayToVec(a [3]float64) Vec {
return Vec{a[0], a[1], a[2]}
}
// Scaled multiplies by a scalar
func (a Vec) Scaled(n float64) Vec {
return Vec{a.X * n, a.Y... |
package handlers
import (
"encoding/json"
"errors"
"log"
"strconv"
"strings"
"unicode"
"unicode/utf8"
"github.com/suite911/cloud911/database"
"github.com/suite911/cloud911/vars"
"github.com/suite911/maths911/maths"
"github.com/badoux/checkmail"
pkgErrors "github.com/pkg/errors"
"github.com/valyala/fast... |
package business
import (
"database/sql"
"fmt"
"regexp"
"strings"
"github.com/MakeNowJust/heredoc"
"github.com/housepower/ckman/common"
"github.com/housepower/ckman/log"
"github.com/pkg/errors"
)
// GetObjectListFromClickHouse
func GetObjectListFromClickHouse(db *sql.DB, query string) (names, statements []st... |
package main
import (
"bytes"
"fmt"
"os/exec"
"regexp"
"strconv"
"strings"
"github.com/newrelic/infra-integrations-sdk/log"
"github.com/newrelic/infra-integrations-sdk/metric"
)
func populateMetrics(ms *metric.MetricSet) error {
cmdExecutable := strings.TrimSpace(args.Cmd)
checkNodetoolExists(cmdExecutable... |
package repository
import (
"fmt"
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalyp... |
/*
MIT License
Copyright (c) 2020-2021 YPSI SAS
Centctl is developped by : <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to ... |
/*
* Manifesto - generates a Greybus Module Manifest from git config syntax input
*
* Copyright 2014 Google Inc.
* Copyright 2014 Linaro Ltd.
*
* Provided under the three clause BSD license found in the LICENSE file.
*
* Note: quick and dirty, needs a bunch of error checking on I/O and data read
* from the g... |
package main
import (
"encoding/json"
"fmt"
"log"
"time"
"github.com/cenkalti/backoff"
"github.com/confluentinc/confluent-kafka-go/kafka"
"github.com/dgraph-io/ristretto"
"github.com/go-playground/validator/v10"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/nandanrao/chance"
"github.com/vlab-research/botpa... |
package main
import (
"fmt"
"log"
"path/filepath"
"runtime"
"strings"
"sync"
"time"
"github.com/autamus/binoc/config"
"github.com/autamus/binoc/parsers"
"github.com/autamus/binoc/repo"
"github.com/autamus/binoc/update"
"github.com/go-git/go-git/v5"
"github.com/google/go-github/github"
)
func main() {
u... |
// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT.
package serumgo
import (
"encoding/binary"
"errors"
ag_binary "github.com/gagliardetto/binary"
ag_solanago "github.com/gagliardetto/solana-go"
ag_format "github.com/gagliardetto/solana-go/text/format"
ag_treeout "github.com/gagliardet... |
package funcs
import (
"strings"
"fmt"
"ibamWinAgent/common/model"
"ibamWinAgent/g"
NET "net"
"github.com/StackExchange/wmi"
"github.com/shirou/gopsutil/net"
)
func netMetric(ip string) int32 {
type Win32_IP4RouteTable struct {
//Metric1 int32 where name='10.5.105.18'
Metric1 int32
}
var ret int32
v... |
package git
import (
"io/ioutil"
"os"
"path"
"testing"
"github.com/sclevine/spec"
"github.com/stretchr/testify/require"
ssh2 "golang.org/x/crypto/ssh"
"gopkg.in/src-d/go-git.v4/plumbing/transport/http"
"gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
corev1 "k8s.io/api/core/v1"
)
func TestGitKeychain(t *t... |
package main
import (
"context"
"encoding/binary"
"fmt"
"regexp"
"sort"
"strconv"
"strings"
"time"
"unicode"
"github.com/gravitational/teleport-plugins/access"
)
const (
NoAction ActionID = iota
ApproveAction
DenyAction
)
type RequestData struct {
User string
Roles []string
Created time.Time
}
... |
// +build !windows
package solar
import (
"log"
"github.com/jgarff/rpi_ws281x/golang/ws2811"
)
const (
pin = 18
brightness = 255
)
// LedDisplay info needed to render to an image
type LedDisplay struct {
// total number of Leds for all planets
totalLedCount int
// render color for each led
renderCo... |
package dewy
import (
"context"
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
"path/filepath"
"sort"
"sync"
"syscall"
"time"
"github.com/carlescere/scheduler"
starter "github.com/lestrrat-go/server-starter"
"github.com/linyows/dewy/kvs"
"github.com/linyows/dewy/notice"
"github.com/linyows/dewy/repo"
)
con... |
/*
* Copyright 2014 <NAME>, <NAME>, <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... |
package cloud911
import (
"io/ioutil"
"log" // TODO
"net"
"os"
"strconv"
"github.com/suite911/cloud911/database"
"github.com/suite911/cloud911/droppriv"
"github.com/suite911/cloud911/register"
"github.com/suite911/cloud911/run"
"github.com/suite911/cloud911/vars"
"github.com/suite911/env911"
"github.com/... |
package trust
import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"github.com/LaurenceGA/go-crev/internal/command/io"
"github.com/LaurenceGA/go-crev/internal/config"
"github.com/LaurenceGA/go-crev/internal/github"
"github.com/LaurenceGA/go-crev/internal/id"
"github.com/LaurenceGA/go-crev/internal/store"
... |
package cleaner
import (
"fmt"
"log"
"os"
"os/user"
"path/filepath"
"sort"
"strings"
"time"
"github.com/wangxufire/m2clean/args"
)
const (
separator = string(os.PathSeparator)
mb = float32(1024 * 1024)
)
var (
m2Repository string
accesseBefore int64
ignoreGroups... |
package day18
import (
"strings"
"github.com/mjm/advent-of-code-2019/pkg/point"
)
// Map represents an underground cave map, which is restricted to a 2D
// Cartesian coordinate system and is full of keys and doors.
type Map struct {
starts map[point.Point2D]uint32
points map[point.Point2D]rune
key... |
package metric
import (
"github.com/emirpasic/gods/sets/hashset"
"github.com/kubernetes-sigs/alibaba-cloud-csi-driver/pkg/utils"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
"github.com/sirupsen/logrus"
"k8s.io/client-go/kubernetes"
"strings"
)
const (
//OssStorageName repre... |
package config
import (
"errors"
"fmt"
"os"
"strings"
"github.com/BurntSushi/toml"
"gitlab.com/gitlab-org/gitaly/internal/config/auth"
"gitlab.com/gitlab-org/gitaly/internal/config/log"
"gitlab.com/gitlab-org/gitaly/internal/config/prometheus"
"gitlab.com/gitlab-org/gitaly/internal/config/sentry"
"gitlab.co... |
package subscription
import (
"context"
"database/sql"
"errors"
"fmt"
"strings"
_ "github.com/lawrencejones/pgsink/internal/dbschema/pg_catalog/model"
. "github.com/lawrencejones/pgsink/internal/dbschema/pg_catalog/table"
. "github.com/lawrencejones/pgsink/internal/dbschema/pg_catalog/view"
"github.com/lawre... |
package typeutils
import (
"encoding/json"
"fmt"
"testing"
"github.com/stretchr/testify/suite"
)
// These tests demonstrates and validates use of a Registry to marshal/unmarshal JSON.
type JsonTestSuite struct {
suite.Suite
film *filmJson
}
var testRegistryJson = NewRegistry()
func init() {
if err := testR... |
package network
import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
"github.com/Sirupsen/logrus"
cniTypes "github.com/containernetworking/cni/pkg/types"
"github.com/docker/docker/pkg/locker"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/typ... |
// Copyright 2020 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package atcs
import (
"atc/base"
"encoding/base64"
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"log"
"os"
"strings"
)
// Atcs int 的包装
type Atcs map[string]interface{}
var (
mobileKeywords = []string{"Android", "Phone", "iPod", "Adr", "Mobile"}
weixinKeywords = []string{"micromess... |
package main
import (
"fmt"
"io/ioutil"
"path/filepath"
"sort"
"strconv"
"strings"
"time"
)
const (
ndevStatPathPattern = "/sys/class/net/*/statistics"
ndevFieldIndex = 4
)
const (
dataTypeRxBytes = "rx_bytes"
dataTypeTxBytes = "tx_bytes"
dataTypeRxPackets = "rx_packets"
dataTypeTxPackets = "tx... |
package installhtml
import (
"encoding/json"
"fmt"
"strings"
"github.com/openshift/sippy/pkg/apis/api"
"github.com/openshift/sippy/pkg/db"
"github.com/openshift/sippy/pkg/db/query"
"github.com/openshift/sippy/pkg/testgridanalysis/testidentification"
log "github.com/sirupsen/logrus"
"github.com/openshift/sip... |
// stupid program to launch a go program during development, and watch all
// go and gotmpl files, restarting the program when a file changes
package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
// "sync"
"syscall"
"time"
"github.com/brentongillis/go-libs/closer"
"github.com/fsnotify/fsnotify"
)... |
package storage
import (
"fmt"
"k8s-pv-provisioner/cmd/provisioner/config"
"testing"
core_v1 "k8s.io/api/core/v1"
storage_v1 "k8s.io/api/storage/v1"
)
var _appConfig *config.AppConfig
const _storageClassName = "storageClass1"
func initAppConfig() {
_appConfig = config.GetInstance()
_appConfig.StorageAssetRo... |
// Copyright 2016 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 ed25519 implements the Ed25519 signature algorithm. See
// https://ed25519.cr.yp.to/.
//
// These functions are also compatible with the “Ed25519” fu... |
package python3
/*
#include "Python.h"
#include "macro.h"
*/
import "C"
import (
"reflect"
"unsafe"
)
// Py_buffer layer
type Py_buffer struct {
ptr *C.Py_buffer
}
type PyBUF_Flag int
const (
PyBUF_SIMPLE = PyBUF_Flag(C.PyBUF_SIMPLE)
PyBUF_WRITABLE = PyBUF_Flag(C.PyBUF_WRITABLE)
PyBUF_STRIDES =... |
package main
import (
"bufio"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"unicode"
log "github.com/sirupsen/logrus"
)
func isAlpha(word string) bool {
for _, c := range word {
if !unicode.IsLetter(c) {
return false
}
}
return true
}
const defaultListLength = 100
func scanFile(file *os.File, fi... |
package main
import (
"errors"
"fmt"
"os"
color "github.com/fatih/color"
"github.com/domonda/go-types/uu"
"github.com/domonda/golog"
"github.com/domonda/golog/log"
)
func main() {
consoleColorizer := &ConsoleColorizer{
TimespampColor: color.New(color.FgHiBlack),
OtherLevelColor: color.New(color.FgWhite... |
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"github.com/sensu/sensu-go/types"
)
type Authentication struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
Expiration int64 `json:"expires_at"`
}... |
// Copyright 2010 The win Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package oleacc
const (
ANNO_THIS = AnnoScope(0)
ANNO_CONTAINER = AnnoScope(1)
)
const (
STATE_SYSTEM_NORMAL = 0
STATE_SY... |
package release
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"path/filepath"
"sort"
"strings"
"sync"
"text/template"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/gorilla/mux"
"github.com/kiteco/kiteco/kite-golib/envutil... |
// Package thunder povides a simple key-value
// file storage using encoding/gob for file
// encoding/decoding.
package thunder
import (
"encoding/gob"
"errors"
"io"
"os"
"path"
"sync"
)
type header struct {
Name string
Version int
}
type nodeMap map[interface{}]*Node
// DB is the struct that contains th... |
package main
import (
"fmt"
"io"
syslog "log"
"os"
"time"
"github.com/aweris/postgres-data-dump/database"
"github.com/aweris/postgres-data-dump/dump"
"github.com/aweris/postgres-data-dump/internal/helpers"
"github.com/aweris/postgres-data-dump/internal/log"
"github.com/aweris/postgres-data-dump/storage"
"g... |
package library
import (
"encoding/json"
"fmt"
"strings"
lua "github.com/anaminus/gopher-lua"
"github.com/anaminus/rbxmk"
"github.com/anaminus/rbxmk/dump"
"github.com/anaminus/rbxmk/dump/dt"
"github.com/anaminus/rbxmk/reflect"
"github.com/anaminus/rbxmk/rtypes"
"github.com/robloxapi/types"
)
const rbxasset... |
// Copyright © Microsoft <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, ... |
/*
* Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... |
package db
import (
"context"
"fmt"
"log"
"net/url"
"strconv"
"strings"
"sync"
"time"
"github.com/c-f/hygo/model"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"
)
var (
MongoDBName = "mongo"
AuthMechanism = "auth_mechanism... |
package payd
import (
"context"
"time"
"github.com/libsv/go-bt/v2"
validator "github.com/theflyingcodr/govalidator"
"gopkg.in/guregu/null.v3"
)
// InvoiceState enforces invoice states.
type InvoiceState string
// contains states that an invocie can have.
const (
StateInvoicePending InvoiceState = "pending"
... |
package main
import (
"encoding/json"
"flag"
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
)
var interval time.Duration
var url string
var path string
var username... |
package builtin
import (
"eago/auth/conf"
"eago/auth/dao"
"eago/auth/model"
"eago/common/log"
"eago/common/redis"
"eago/common/utils"
"encoding/json"
"sync"
"time"
)
// NewToken 本地服务::生成Token
func NewToken(userObj *model.User) string {
log.Info("builtin.NewToken called.")
defer log.Info("builtin.NewToken e... |
package main
import (
"bufio"
"encoding/json"
"fmt"
dcli "github.com/fsouza/go-dockerclient"
"github.com/garyburd/redigo/redis"
"io"
"log"
"net/http"
"time"
)
func main() {
redisPool := redis.NewPool(func() (redis.Conn, error) {
return redis.Dial("tcp", ":6379")
}, 5)
s := &Server{
broker: NewBrok... |
package erreur
import (
"go.uber.org/zap"
"go.uber.org/zap/buffer"
"go.uber.org/zap/zapcore"
)
// Structured holds an error (and a possible cause for it) and zap Fields that provide context for
// that error.
type Structured struct {
causer error
err error
fields []zap.Field
}
// Structure returns a structu... |
package main
import (
"sort"
"github.com/anz-bank/sysl/src/proto"
"github.com/sirupsen/logrus"
)
func evalTransformStmts(txApp *sysl.Application, assign *Scope, tform *sysl.Expr_Transform) *sysl.Value {
result := MakeValueMap()
for _, s := range tform.Stmt {
switch ss := s.Stmt.(type) {
case *sysl.Expr_Tra... |
package main
// Guild represents a discord guild
type Guild struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
IconHash string `json:"icon_hash"`
Sp... |
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Defines the desired state of WebSphereLibertyTrace
type WebSphereLibertyTraceSpec struct {
// The name of... |
package ssh
import (
"fmt"
"github.com/LogicalOverflow/music-sync/playback"
"github.com/LogicalOverflow/music-sync/testutil"
"github.com/stretchr/testify/assert"
"os"
"strings"
"testing"
)
func TestRegisterCommand(t *testing.T) {
oldCommands := make([]Command, len(commands))
copy(oldCommands, commands)
init... |
package main
import (
"errors"
"fmt"
"math/rand"
"os"
"os/signal"
"path/filepath"
"runtime/pprof"
"sync"
"time"
"github.com/dcaiafa/nitro"
"github.com/dcaiafa/nitro/lib"
"github.com/dcaiafa/nitro/lib/nitroco"
"github.com/dcaiafa/nitro/lib/nitromath"
"github.com/dcaiafa/nitro/lib/nitropath"
"github.com/... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Allows you to add filters when you use the search function in Secrets Manager.
// For more information, see Find secrets in Secrets Manager
// (https://docs.aws.amazon.com/secre... |
/*
Copyright 2022 The Flux 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, softwar... |
package server
import (
"github.com/rabbitstack/fibratus/pkg/outputs/amqp/_fixtures/garagemq/amqp"
"github.com/rabbitstack/fibratus/pkg/outputs/amqp/_fixtures/garagemq/auth"
"github.com/rabbitstack/fibratus/pkg/outputs/amqp/_fixtures/garagemq/config"
"net"
"os"
"os/signal"
"sync"
"syscall"
log "github.com/si... |
package rainbow
import (
"fmt"
"strconv"
"time"
"github.com/tomnomnom/xtermcolor"
)
var (
reset = "\u001b[0m"
colorBlack = "\x1b[30m"
colorBlue = "\x1b[34m"
colorRed = "\x1b[31m"
colorGreen = "\x1b[32m"
colorYellow = "\x1b[33m"
colorMagenta = "\x1b[35m"
colorCyan = "\x1b[36m"
colorWhite ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.