text stringlengths 3.08k 10.4k |
|---|
package main
import (
"context"
"fmt"
"github.com/acicn/minit/pkg/mlog"
"github.com/robfig/cron/v3"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
"time"
)
const KindLogrotate = "logrotate"
// filename mark
// daily: FILENAME.ROT2020-06-02.EXT
// filesize: FILENAME.ROT000000000001.EXT (%012d)
c... |
package coding_test
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"strings"
"testing"
"github.com/jhillyerd/enmime/internal/coding"
)
func TestQPCleaner(t *testing.T) {
ttable := []struct {
input string
want string
}{
{"", ""},
{"abcDEF_", "abcDEF_"},
{"=5bSlack=5d", "=5bSlack=5d"},
{"low: ... |
// KATO, Application Management Platform
// Copyright (C) 2021 Gridworkz Co., Ltd.
// 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 r... |
package graviton
import (
"math/rand"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestTreeProve(t *testing.T) {
rand.Seed(100)
_, tree := setupDeterministicTree(t, 10)
key := make([]byte, 20)
value := make([]byte, 10)
rand.Read(key)
rand.Read(value)
require.NoError(t, tree.Put(key, valu... |
package browserpass
import (
"bufio"
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"io"
"os/exec"
"path/filepath"
"regexp"
"strings"
"github.com/dannyvankooten/browserpass/pass"
"github.com/dannyvankooten/browserpass/protector"
"github.com/gokyle/twofactor"
)
// Login represents a single pass login... |
// Copyright © 2019 <NAME> – This file is part of GoatCounter and
// published under the terms of a slightly modified EUPL v1.2 license, which can
// be found in the LICENSE file or at https://license.goatcounter.com
package main
import (
"context"
"fmt"
"os"
"runtime"
"strings"
"sync"
_ "time/tzdata"
"zgo.a... |
package git2ftp
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/secsy/goftp"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"strings"
)
type ftpConfig struct {
Host string `json:"host"`
Port string `json:"port"`
User string `json:"user"`
Password string `json:"password"`
Path ... |
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package internal
import (
"github.com/ONSdigital/dp-graph/v2/neo4j/neo4jdriver"
"sync"
)
var (
lockBoltRowsMockAll sync.RWMutex
lockBoltRowsMockClose sync.RWMutex
lockBoltRowsMockColumns sync.RWMutex
lockBoltRowsMockMetadata sync.RWMutex... |
// 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 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"github.com/Travix-International/gozzmock/expectations"
"github.com/Travix-International/gozzmock/httpclient"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/prometheus/client_golang/prometheus/promhtt... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
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/wafregional/types"
smithy "github.com/awslabs/smithy-go"
"github.com/awslabs/s... |
/*
Copyright The Helm 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
di... |
package docs
// WARNING:
// Most structures in here are an representation of what is defined in default
// Open API Specification documentation, v3.0.3.
//
// [More about it can be found on this link](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md)
// New returns a new instance of OAS str... |
// Copyright 2021 Monoskope 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 command
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
"github.com/kevinburke/ssh_config"
"github.com/zshamrock/vmx/config"
"github.com/zshamrock/vmx/core"
"gopkg.in/urfave/cli.v1"
)
const (
optionalFollowArgsIndex = 0
hostsGroupArgsIndex = 0
commandNameArgsIndex ... |
package backup
/*
* This file contains structs and functions related to backing up data on the segments.
*/
import (
"fmt"
"strings"
"sync"
"github.com/greenplum-db/gp-common-go-libs/dbconn"
"github.com/greenplum-db/gp-common-go-libs/gplog"
"github.com/greenplum-db/gpbackup/utils"
"gopkg.in/cheggaaa/pb.v1"... |
package kustomize
import (
"fmt"
"os"
"path/filepath"
"gopkg.in/yaml.v2"
"sigs.k8s.io/kustomize/api/filesys"
fLdr "sigs.k8s.io/kustomize/api/loader"
)
var _ filesys.FileSystem = FsOverlay{}
// FsOverlay implements FileSystem using the local filesystem.
type FsOverlay struct {
base filesys.FileSystem
overla... |
// Copyright (C) 2015 NTT Innovation Institute, 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 applicabl... |
/*
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 client
import (
"github.com/rancher/norman/types"
)
const (
ReplicaSetType = "replicaSet"
ReplicaSetFieldActiveDeadlineSeconds = "activeDeadlineSeconds"
ReplicaSetFieldAnnotations = "annotations"
ReplicaSetFieldAutomountServiceAccountToken = "autom... |
/*
@Time 2019-09-17 18:28
@Author ZH
*/
package task
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/pkg/errors"
"github.com/zhcppy/fabricli/logger"
)
const (
randFunc = "$rand("
padFunc = "$pad("
seqFunc = "$seq("
setFunc = "$set("
... |
/*
Copyright 2019 gomemcache 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, soft... |
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package integrations
import (
"net/http"
"net/url"
"path/filepath"
"testing"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
"cod... |
//
// Copyright (C) 2018 <NAME>
//
// This work is open source software, licensed under the terms of the
// MIT license as described in the LICENSE file in the top-level directory.
package cmd
import (
"github.com/hadiko-i6/zischr/backend/db"
"github.com/hadiko-i6/zischr/backend/rpc"
"log"
"golang.org/x/net/cont... |
package config
import (
"fmt"
"os"
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/go-playground/validator.v9"
"gopkg.in/yaml.v2"
)
func TestFromFile(t *testing.T) {
config, err := FromFile("../test/migrator-test.yaml")
assert.Nil(t, err)
assert.Equal(t, "test/migrations", config.BaseLocation)
ass... |
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright 2011 Google Inc. All Rights Reserved.
// This file is available under the Apache license.
package vm
import (
"fmt"
"strconv"
"strings"
"github.com/google/mtail/metrics"
)
// Unparser is for converting program syntax trees back to program text.
type Unparser struct {
pos int
output strin... |
// Copyright 2020 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 wr... |
/*
Copyright 2018 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 agreed to in writing, soft... |
package statedb
import (
"encoding/json"
"fmt"
"reflect"
"github.com/incognitochain/incognito-chain/common"
)
type PDETradingFeeState struct {
token1ID string
token2ID string
contributorAddress string
amount uint64
}
func (s PDETradingFeeState) Token1ID() string {
return s.t... |
package cbrest
import (
"bufio"
"crypto/tls"
"crypto/x509"
"encoding/json"
"errors"
"io"
"net"
"net/http"
"strconv"
"strings"
"time"
"github.com/couchbase/tools-common/errutil"
"github.com/couchbase/tools-common/log"
"github.com/couchbase/tools-common/maths"
"github.com/couchbase/tools-common/netutil"
... |
// Code generated by tutone: DO NOT EDIT
package nrdb
import (
"github.com/newrelic/newrelic-client-go/internal/serialization"
)
// EventAttributeDefinition - A human-readable definition of an NRDB Event Type Attribute
type EventAttributeDefinition struct {
// This attribute's category
Category string `json:"categ... |
//go:build !hilbiline && !goreadline
// +build !hilbiline,!goreadline
package main
// Here we define a generic interface for readline and hilbiline,
// making them interchangable during build time
// this is normal readline
import (
"os"
"path/filepath"
"strings"
"github.com/Rosettea/readline"
"github.com/yuin... |
package dali
import (
"errors"
"fmt"
)
//Heading is a column title
type Heading struct {
Span int
Text string
Base
}
//Children return nil for Headings
func (hd *Heading) Children() *Elements { return &Elements{} }
func (hd *Heading) String() string {
style := ""
if hd.Style() != "" {
style = fmt.Sprintf(`... |
// Copyright © 2018 <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 use, copy, modify, merge, publish, distribu... |
package diff
import (
"strings"
"github.com/hashicorp/terraform/flatmap"
"github.com/hashicorp/terraform/terraform"
)
// AttrType is an enum that tells the ResourceBuilder what type of attribute
// an attribute is, affecting the overall diff output.
//
// The valid values are:
//
// * AttrTypeCreate - This attr... |
// Copyright 2020 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 wr... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: gomatcha.io/matcha/pb/view/segmentview/segmentview.proto
/*
Package segmentview is a generated protocol buffer package.
It is generated from these files:
gomatcha.io/matcha/pb/view/segmentview/segmentview.proto
It has these top-level messages:
View
Event... |
package connector
import (
"fmt"
"net"
"os"
"github.com/infrawatch/apputils/config"
"github.com/infrawatch/apputils/logging"
)
const maxBufferSize = 4096
type socketInfo struct {
Address net.UnixAddr
Pc *net.UnixConn
}
type UnixSocketConnector struct {
msgBuffer []byte
logger *logging.Logger
out ... |
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
log "github.com/Sirupsen/logrus"
"github.com/mateuszdyminski/auto/ingress/model"
nats "github.com/nats-io/go-nats"
"github.com/BurntSushi/toml"
)
var configPath string
var rps int
// ... |
// SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Gardener contributors.
//
// SPDX-License-Identifier: Apache-2.0
package componentarchive
import (
"compress/gzip"
"context"
"fmt"
"os"
"github.com/gardener/component-spec/bindings-go/ctf"
"github.com/mandelsoft/vfs/pkg/osfs"
"github.com/m... |
package iam
import (
"fmt"
"log"
"net/url"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/hashicorp/aws-sdk-go-base/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com... |
// Copyright 2019 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 bot
import (
"bytes"
"errors"
"fmt"
"io"
"os"
"time"
"github.com/bwmarrin/discordgo"
"github.com/kelseyhightower/envconfig"
"github.com/nint8835/parsley"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
// PersistenceBackend represents a generic backend capable of persisting data.
type Persis... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/ConsensusDeleteTopic.proto
package proto
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
//... |
package definitions
import (
"fmt"
"github.com/Xuanwo/gg"
"github.com/Xuanwo/templateutils"
log "github.com/sirupsen/logrus"
)
type genOperation struct {
g *gg.Generator
}
func GenerateOperation(path string) {
gop := &genOperation{
g: gg.New(),
}
gop.generateHeader()
for _, ns := range []Namespace{Servi... |
package piputils
import (
"bytes"
"encoding/json"
"fmt"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/io/fileutils"
"github.com/jfrog/jfrog-client-go/utils/log"
... |
package tableroll
import (
"context"
"fmt"
"net"
"sync"
"github.com/inconshreveable/log15"
"github.com/ngrok/tableroll/internal/proto"
"github.com/pkg/errors"
)
type upgradeSession struct {
closeOnce sync.Once
wr *net.UnixConn
coordinator *coordinator
ownerVersion uint32
l log15.... |
/*
Copyright 2018 Turbine Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
/*
Copyright 2021 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
// Copyright (c) 2020 OSRAM; Licensed under the MIT license.
// This code handles the OpenAPI for PHYTOFY RL v0 (DEPRECATED)
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
)
type api0 struct {
logger *log.Logger
controller *ctrl0Controller
}
type api0SetLedsArguments struct {
Serial ... |
package environmentscleanup
import (
"context"
"fmt"
"strings"
"time"
"github.com/gardener/gardener/pkg/apis/core/v1beta1"
"github.com/hashicorp/go-multierror"
"github.com/kyma-project/control-plane/components/kyma-environment-broker/internal"
"github.com/kyma-project/control-plane/components/kyma-environment... |
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"sync"
"github.com/at-wat/ebml-go/webm"
"github.com/pion/rtp"
"github.com/pion/rtp/codecs"
"github.com/pion/webrtc/v2"
"github.com/pion/webrtc/v2/pkg/media/samplebuilder"
"github.com/hakobera/go-ayame/ayame"
)
func main() {
signalingURL := flag.... |
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright 2016 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 frontend
import (
"infra/appengine/test-results/model"
"net/http"
"net/http/httptest"
"testing"
"time"
"golang.org/x/net/context"
"go.ch... |
package cluster
import (
"flag"
"fmt"
"log"
"sync"
"testing"
"time"
)
var (
flagLocalPort = 0
flagRemotePort = 0
flagLocalHost = ""
flagRemoteHost = ""
)
func init() {
flag.IntVar(&flagLocalPort, "lport", flagLocalPort, "Local port")
flag.IntVar(&flagRemotePort, "rport", flagRemotePort, "Remote port")
... |
package task
import (
"fmt"
"strings"
"time"
"cloud.google.com/go/datastore"
"github.com/golang/glog"
"github.com/pedrocelso/go-task/lib/http/authcontext"
)
const (
index = `Task`
invalidTaskData = `error: invalid Task data (Name is required)`
userIndex = `User`
)
// Task defines task attri... |
package nimo
import (
"bufio"
"errors"
"fmt"
"os"
"path/filepath"
"reflect"
"regexp"
"strconv"
"strings"
"time"
)
const (
DefaultSeparator = ";"
GenericTypeRaw = 1
GenericTypeDate = 2
)
var onlyAlpha = regexp.MustCompile("^[a-zA-Z0-9_-]+")
// ConfigLoader load config from file
type ConfigLoader struc... |
// Copyright IBM Corp. 2021 All Rights Reserved.
// Licensed under the Mozilla Public License v2.0
package scc
import (
"context"
"fmt"
"log"
"time"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codeartifact
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 CreateDomainInput struct {
_ struct{} `type:"structure"`
// Th... |
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT
package company
import (
"context"
"github.com/communitybridge/easycla/cla-backend-go/gen/v1/models"
log "github.com/communitybridge/easycla/cla-backend-go/logging"
"github.com/communitybridge/easycla/cla-b... |
package csv
import (
"errors"
"fmt"
"io"
"strings"
"github.com/antchfx/xpath"
"github.com/jf-tech/go-corelib/caches"
"github.com/jf-tech/go-corelib/ios"
"github.com/jf-tech/go-corelib/maths"
"github.com/jf-tech/omniparser/idr"
)
// ErrInvalidHeader indicates the header of the CSV input is corrupted, mismat... |
// Package mimic contains a mockup middleware tool.
package mimic
import (
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"sync"
yaml "gopkg.in/yaml.v2"
)
// Load loads yml file with parameters for mocking.
func Load(filename string) error {
f, err := os.Open(filename)
if err != nil {
return err
}
de... |
package tileoverlay
import (
"image/color"
"github.com/paulmach/go.geo"
"github.com/paulmach/slide"
"github.com/paulmach/slide/surfacers"
"github.com/paulmach/slide/utils"
"github.com/paulmach/slide/utils/smoothsurface"
)
// defaults for newly created ImageOverlaySurface.
// See ImageOverlaySurface for more in... |
package vproxy_controller
import (
"../http_parser"
"crypto/tls"
"encoding/json"
"net"
"strconv"
"strings"
"time"
)
const FailRetryIntervalSecondInt = 2
const FailRetryInterval = FailRetryIntervalSecondInt * time.Second
func buildConnection(watchConf *WatchConfig) (net.Conn, error) {
if watchConf.UseHttps {
... |
/*
* Copyright(C) 2020. Huawei Technologies Co.,Ltd. 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 b... |
package stubs
// Copyright 2019 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 a... |
// Author : <NAME>
// Date : 6/10/2018
package gpio
import (
"encoding/json"
"fmt"
"math/rand"
"time"
MQTT "github.com/eclipse/paho.mqtt.golang"
"github.com/stianeikeland/go-rpio"
)
const (
GreenLedPin1 uint8 = 21
GreenLedPin2 uint8 = 20
GreenLedPin3 u... |
package instance
import (
"context"
"crypto/rand"
"encoding/base64"
"fmt"
"sync"
"testing"
"time"
"github.com/loft-orbital/cuebe/internal/mock"
"github.com/loft-orbital/cuebe/internal/utils"
"github.com/loft-orbital/cuebe/pkg/manifest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/requ... |
package mitmproxy
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"math/big"
"os"
"time"
)
// CertPath is path where all created certificates will be stored. Should be an existing directory
var CertPath = "./c... |
package fitbit
import (
"database/sql"
"fmt"
"net/http"
"strings"
"time"
"github.com/bah2830/fitbit-exporter/pkg/database"
"golang.org/x/oauth2"
)
type UserResponse struct {
User *User `json:"user"`
}
type User struct {
ID string `json:"encodedId"`
DisplayName string `json:"displayName"`
FullNam... |
package main
import (
"errors"
"os"
"sort"
"sync"
"github.com/mitchellh/go-homedir"
"github.com/rdkr/gitsync/concurrency"
gitsync "github.com/rdkr/gitsync/sync"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"golang.org/x/crypto/ssh/terminal"
)
var cfgFile string
var verbos... |
package efgh
import (
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"reflect"
"strings"
"time"
)
// Implementation of HTTP processing for an event function.
type functionHandler struct {
// The function in question
f reflect.Value
// metadata about the signature
needsContext, hasEr... |
// Copyright 2016-2017 VMware, 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 appli... |
package eventbrite
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"strconv"
"time"
)
const (
// EventEnvKey -
EventEnvKey = "EVENTBRTIE_EVENT"
// AuthEnvKey -
AuthEnvKey = "EVENTBRITE_AUTH"
urlFormat = "https://www.eventbriteapi.com/v3/events/%d/attendees/?page=%d"
authFormat = "Bearer %s"
)
... |
package main
import (
"encoding/json"
"flag"
"fmt"
"gopkg.in/jcelliott/turnpike.v2"
"log"
"math/rand"
"net/http"
"net/url"
"strconv"
)
type Quote struct {
Date int64 `json:"date"`
Open float64 `json:"open"`
High float64 `json:"high"`
Low float64 `json:"low"`... |
package chunk
import (
"bytes"
"encoding"
"io"
)
var (
_ encoding.BinaryMarshaler = (*bstream)(nil)
_ encoding.BinaryUnmarshaler = (*bstream)(nil)
)
type bit bool
const (
zero bit = false
one bit = true
)
func newBStream(capacity int) *bstream {
return newBStreamWithData(make([]byte, 0, capacity))
}
fu... |
package main
import (
"fmt"
"net"
"os"
"path/filepath"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"go.uber.org/fx"
"golang.org/x/xerrors"
"github.com/filecoin-project/venus-messager/api"
"github.com/filecoin-project/venus-messager/api/controller"
"github.com/filecoin-project/venus-messager/ap... |
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
/*
* Copyright 2016,2017 falcon Author. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
package sys
import (
"bufio"
"bytes"
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"runtime"
"strconv"
"strings"
"github.com/golang/glog"
"g... |
package cert
import (
"crypto"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
"github.com/BSNDA/bsn-sdk-crypto/keystore"
"github.com/BSNDA/bsn-sdk-crypto/keystore/key"
"net"
"net/mail"
"net/url"
"github.com/BSNDA/PCNGateway-Go-SDK/pkg/common/errors"
"github.com/BSNDA/PCNGat... |
package main
import (
"bytes"
"crypto/tls"
"encoding/base64"
"flag"
"io"
"log"
"mime"
"mime/multipart"
"net/mail"
"os"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/BurntSushi/toml"
"github.com/alexcesaro/quotedprintable"
"github.com/mxk/go-imap/imap"
)
var wd, _ = os.Getwd()
var conf = flag... |
package interp
import (
"math/big"
"github.com/wader/fq/internal/gojqextra"
"github.com/wader/gojq"
)
func init() {
functionRegisterFns = append(functionRegisterFns, func(i *Interp) []Function {
return []Function{
{"bnot", 0, 0, i.bnot, nil},
{"bsl", 2, 2, i.bsl, nil},
{"bsr", 2, 2, i.bsr, nil},
{"... |
package nl
import (
"bytes"
"io"
"syscall"
)
const (
NLA_TYPE_MASK = ^uint16(syscall.NLA_F_NESTED | syscall.NLA_F_NET_BYTEORDER)
)
type AttrLen uint16
func (l AttrLen) Align() int {
return (int(l) + 3) &^ 3
}
type AttrHdr struct {
Len AttrLen
Type uint16
}
func DecodeAttrHdr(b []byte) (AttrHdr, int, error... |
package main
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/mail"
"os"
"time"
q "mailingful.com/mailingful-server/queries"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-g... |
package main
import (
"fmt"
"github.com/abadojack/whatlanggo"
"github.com/carlescere/scheduler"
"github.com/joho/godotenv"
"github.com/nlopes/slack"
"github.com/reiyw/paperbot/queue"
"github.com/reiyw/paperbot/translate"
"log"
"mvdan.cc/xurls"
"os"
"strings"
)
func main() {
err := godotenv.Load()
if err ... |
package iqshell
import (
"bufio"
"context"
"fmt"
"github.com/astaxie/beego/logs"
"os"
"os/signal"
"strings"
"time"
)
func filterByPuttime(putTime, startDate, endDate time.Time) bool {
switch {
case startDate.IsZero() && endDate.IsZero():
return true
case !startDate.IsZero() && endDate.IsZero() && putTime... |
// Copyright (c) 2017 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
package main
import (
"fmt"
"hro.projects/INFDAT01-2NEW/assets"
"sort"
)
type strategyPattern interface {
Similarity(map[string]map[string]float64, []string, map[string]float64) (map[string]map[string]map[float64]int, error)
Average(map[string]float64) float64
}
type itemItem struct {
dataset *map[... |
package main
import (
"./lib"
"./messages"
"./models"
"./config"
"log"
"os"
"flag"
"strings"
"os/signal"
"syscall"
"fmt"
"encoding/json"
"net/http"
"github.com/satori/go.uuid"
)
var tcpServer *lib.TcpServer
var producer *messages.Producer
var consumer *messages.Consumer
var (
/*brokers = flag.Stri... |
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
import (
"runtime/internal/atomic"
"runtime/internal/sys"
"unsafe"
)
const (
// For the time histogram type, we use an HDR histogram.
// ... |
// Copyright 2021 The Sigstore 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 agr... |
package ez3
import (
"bytes"
"context"
"errors"
"fmt"
awsS3 "github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/smithy-go"
"io/ioutil"
"strings"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
)
// S3Client is the interface for an AWS S3-compatible client.
type S3Client inter... |
package mutex
import (
"bufio"
"bytes"
"fmt"
"github.com/petermattis/goid"
"io/ioutil"
"runtime"
"sync"
"time"
)
const deadlockdumpheader = "POTENTIAL DEADLOCK:"
// THIS IS THE THING THAT DOES DEADLOCK ANALYSIS
func deadlockcheck(lockFn func(), ptr interface{}) {
if Opts.Disable {
lockFn()
return
}
pr... |
package tpns
type CommonRspEnv string
const (
// EnvProd
EnvProd CommonRspEnv = "product"
// EnvDev
EnvDev CommonRspEnv = "dev"
)
type CommonRsp struct {
// TODO: doc this
Seq int64 `json:"seq"`
PushID string `json:"push_id"`
RetCode int `json:"ret_code"`
Environment CommonRspEnv `json:"environment"`
E... |
package config
import (
"encoding/json"
"io/ioutil"
"gopkg.in/yaml.v2"
)
var ConfigPath = "./config.yaml"
var DbPath = "./gopheart.db"
type NotifierService struct {
SMTPHost string `yaml:"smtp_host" json:"smtp_host"`
SMTPPort string `yaml:"smtp_port" json:"smtp_port"`
SMTPUsername string `... |
package repository
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/AlecAivazis/survey/v2"
apipac "github.com/openshift-pipelines/pipelines-as-code/pkg/apis/pipelinesascode/v1alpha1"
"github.com/openshift-pipelines/pipelines-as-code/pkg/cli"
"github.com/openshift-pipelines/pipelines-as-cod... |
package objectstore
import (
"fmt"
"github.com/pkg/errors"
chubaoapi "github.com/rook/rook/pkg/apis/chubao.rook.io/v1alpha1"
"github.com/rook/rook/pkg/operator/chubao/commons"
"github.com/rook/rook/pkg/operator/chubao/constants"
"github.com/rook/rook/pkg/operator/k8sutil"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8... |
package prometheus
import (
"fmt"
"net"
"net/http"
"strconv"
"time"
etcd "github.com/coreos/etcd/client"
prom "github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"
"github.com/weaveworks/flux/balancer/events"
"github.com/weaveworks/flux/common/daemon"
"github.com/weaveworks/flux/comm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.