text stringlengths 3.08k 10.4k |
|---|
// Copyright 2019-present PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... |
package wordpress
import (
"fmt"
"net/http"
)
const (
PostStatusDraft = "draft"
PostStatusPending = "pending"
PostStatusPrivate = "private"
PostStatusPublish = "publish"
PostStatusTrash = "trash"
PostTypePost = "post"
PostTypePage = "page"
CommentStatusOpen = "open"
CommentStatusClosed = "closed"
... |
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"strings"
"time"
"github.com/wesleyParriott/SmallData"
)
const usage = `
Small Data: a tiny hash table cli
==COMMANDS==
[MAIN]
exit: exits out of the cli.
help: prints this helpful message.
insert: inserts into the hash table
... |
package cli
import (
"bytes"
"encoding/json"
"fmt"
sdk "github.com/pokt-network/pocket-core/types"
"github.com/pokt-network/pocket-core/x/pocketcore/types"
"io/ioutil"
"net/http"
"strconv"
"time"
"github.com/pokt-network/pocket-core/app"
"github.com/pokt-network/pocket-core/app/cmd/rpc"
)
var (
SendRawTx... |
/*
Copyright 2020 The arhat.dev 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 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 monitor
import (
"fmt"
"strconv"
"time"
"github.com/evergreen-ci/evergreen"
"github.com/evergreen-ci/evergreen/model/host"
"github.com/evergreen-ci/evergreen/model/user"
"github.com/mongodb/grip"
"github.com/mongodb/grip/message"
"github.com/pkg/errors"
)
// the warning thresholds for spawned hosts,... |
// Copyright 2020 <NAME>, info-age GmbH, Basel. 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 requ... |
package ghaprofiler
import (
"context"
"log"
"os"
"regexp"
"sort"
"strings"
"github.com/go-git/go-git/v5"
"github.com/google/go-github/v32/github"
"github.com/jessevdk/go-flags"
"golang.org/x/sync/errgroup"
)
type CLI struct {
verbose bool
}
func NewCLI() *CLI {
return &CLI{}
}
func (cli *CLI) SetVerbo... |
package util
import (
"fmt"
"math"
"net/url"
"reflect"
"time"
)
//Decoder ...
func Decoder(Str string) (string, error) {
u, err := url.QueryUnescape(Str)
if err != nil {
return "", err
}
return u, nil
}
//TimeSpan ....
type TimeSpan struct {
H int
M int
S int
}
//ParseTimeSpanWithMinutes ....
func Pa... |
/*
* Copyright 2021 Layotto 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... |
/*
w
==================================================================================
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 ... |
// Package vago
package vago
/*
#cgo pkg-config: varnishapi
#cgo LDFLAGS: -lvarnishapi -lm
#include <sys/types.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <vapi/vsc.h>
#include <vapi/vsm.h>
#include <vapi/vsl.h>
int dispatchCallback(struct VSL_data *vsl, struct VSL_transaction **trans, voi... |
package sigma
import (
"fmt"
"strings"
"unicode"
"unicode/utf8"
)
type lexer struct {
input string // we'll store the string being parsed
start int // the position we started scanning
position int // the current position of our scan
width int // we'll be using runes which can be ... |
package mysql
import (
"context"
"database/sql"
"time"
"github.com/dogmatiq/verity/internal/x/sqlx"
"github.com/dogmatiq/verity/persistence"
)
// InsertQueueMessage inserts a message in the queue.
//
// It returns false if the row already exists.
func (driver) InsertQueueMessage(
ctx context.Context,
tx *sql.... |
// Copyright © 2013, 2014 <NAME> <<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, p... |
// Copyright (C) 2019-2020 Zilliz. 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 l... |
package database
import (
"github.com/fanda-org/postmasters/config"
"github.com/fanda-org/postmasters/database/models/accounting"
"github.com/fanda-org/postmasters/database/models/system"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mssql" // empty or blank
_ "github.com/jinzhu/gorm/dialects/my... |
package geogoth
import (
"math"
)
// MinDistance searches for the smallest distance
func MinDistance(distarr []float64) float64 {
distance := distarr[0]
for i := range distarr {
if distarr[i] < distance {
distance = distarr[i]
}
}
return distance
}
// NegToPosRad converts brng to positive if it's negati... |
package node
import (
"context"
"encoding/json"
"fmt"
"net/http"
"strconv"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/fx"
"github.com/celestiaorg/celestia-node/header"
"github.com/celestiaorg/celestia-node/header/local"
"github.com/celestiaorg/celest... |
package config
import (
"strconv"
"strings"
"github.com/newrelic/newrelic-diagnostics-cli/logger"
"github.com/newrelic/newrelic-diagnostics-cli/tasks"
"github.com/newrelic/newrelic-diagnostics-cli/tasks/base/config"
)
// DotNetCoreConfigAgent - This struct defined the sample plugin which can be used as a starti... |
package gopchromedp
import (
"context"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"time"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/network"
"github.com/chromedp/chromedp"
"github.com/hophouse/gop/utils"
)
// TakeScreenShot Take screenshot of the pages.
func TakeScreenShot(item *Item, ... |
// Encoding / Decoding for AMF3
package main
import (
"encoding/binary"
"math"
)
// Types
const AMF3_TYPE_UNDEFINED = 0x00
const AMF3_TYPE_NULL = 0x01
const AMF3_TYPE_FALSE = 0x02
const AMF3_TYPE_TRUE = 0x03
const AMF3_TYPE_INTEGER = 0x04
const AMF3_TYPE_DOUBLE = 0x05
const AMF3_TYPE_STRING = 0x06
const AMF3_TYPE_... |
package alicloud
import (
"regexp"
"strconv"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ddoscoo"
"github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terr... |
package bird
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
robinBirthday = nook.Birthday{
Day: 4,
Month: ... |
package main
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"os/user"
"runtime"
"runtime/pprof"
"strconv"
"strings"
"time"
)
type set map[string]struct{}
func (s set) add(x string) set {
if s == nil {
s = make(set)
}
s[x] = struct{}{}
return s
}
func (s set) get() []st... |
package parser
import (
"fmt"
"go/ast"
goparser "go/parser"
"go/token"
"os"
"path/filepath"
"strings"
"github.com/andreluzz/swagg-doc/utils"
)
// Parser process the main package and generate the doc
type Parser struct {
apiPackage string
files map[string]map[string]*gofile
globalComponent... |
package storageclass
import (
"context"
"fmt"
ctrl "github.com/ceph/ceph-csi/internal/controller"
"github.com/ceph/ceph-csi/internal/controller/utils"
"github.com/ceph/ceph-csi/internal/util"
"github.com/robfig/cron"
scv1 "k8s.io/api/storage/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"os/exec"
"sigs.... |
// Copyright 2020 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package wire
import (
"encoding/json"
"strings"
)
// FIBeneficiaryAdvice is the financial institution beneficiary advice
type FIBeneficiaryAdvice struct {
// tag
tag st... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
*/
package state
import (
"context"
"encoding/json"
"sync"
"magma/orc8r/cloud/go/errors"
"magma/orc8r/cloud/go/o... |
package snapshotbackpopulate
import (
"context"
"encoding/json"
"fmt"
"sort"
"github.com/rancher/lasso/pkg/cache"
"github.com/rancher/lasso/pkg/client"
"github.com/rancher/lasso/pkg/controller"
rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1"
cluster2 "github.com/rancher/rancher/pkg/controllers/p... |
package fiber_ldapauth
import (
"crypto/tls"
"encoding/base64"
"errors"
"strings"
"github.com/go-ldap/ldap/v3"
"github.com/gofiber/fiber/v2"
)
type ErrorHandlerCallback = func(*fiber.Ctx, error) error
type ErrorHandler = func(*fiber.Ctx, error, ErrorHandlerCallback) error
type Config struct {
// Next defines... |
// Copyright 2019 the u-root 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 tarutil
import (
"archive/tar"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
)
// passesFilters returns true if the given file passes all ... |
/*
genconstructor is constructor generator for Go.
```go
//genconstructor
type Foo struct {
key string `required:"[constValue]"`
}
```
with `go generate` command
```go
//go:generate go-genconstructor
```
*/
package genconstructor
import (
"bytes"
"go/ast"
"go/format"
"io"
"os"
"reflect... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: assistant.proto
package pluginassistanepb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
... |
package commands
import (
"fmt"
"strconv"
"strings"
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix/terminal"
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin"
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin_examples/list_plugin/api"
. "github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin_examples/list_plugin/i18n"
"gi... |
package main
import (
"context"
"flag"
"fmt"
"strings"
"time"
admin "cloud.google.com/go/iam/admin/apiv1"
"golang.org/x/oauth2/google"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
adminpb "google.golang.org/genproto/googleapis/iam/admin/v1"
"go.skia.org/infra/go/auth"
"go.skia.org/infr... |
/*
Copyright 2021.
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 un... |
/*
Copyright 2019-Present Couchbase, Inc.
Use of this software is governed by the Business Source License included in
the file licenses/BSL-Couchbase.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, Version ... |
package cluster
import (
"errors"
"flag"
"math/rand"
"time"
"github.com/golang/glog"
"mervin.me/algset/container"
"mervin.me/algset/distance"
)
func init() {
flag.Parse()
flag.Set("alsologtostderr", "true")
flag.Set("v", "2")
}
//KMeans xxx
//https://blog.csdn.net/google19890102/article/details/26149927
... |
/*
Copyright 2020 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
// Copyright 2015 go-swagger maintainers
//
// 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... |
// Copyright © 2021 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... |
/*
* Copyright (C) 2018 The ontology Authors
* This file is part of The ontology library.
*
* The ontology is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (a... |
/*
Copyright (c) Huawei Technologies Co., Ltd. 2021.
kunpengsecl licensed under the Mulan PSL v2.
You can use this software according to the terms and conditions of
the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOU... |
package trustmanager
import (
"crypto/x509"
"errors"
"github.com/dwake/docker-trust/external/github.com/Sirupsen/logrus"
)
// X509MemStore implements X509Store as an in-memory object with no persistence
type X509MemStore struct {
validate Validator
fingerprintMap map[CertID]*x509.Certificate
nameMap ... |
package shape
import (
"math"
"sort"
"github.com/nicholasblaskey/raytracer/intersection"
"github.com/nicholasblaskey/raytracer/material"
"github.com/nicholasblaskey/raytracer/matrix"
"github.com/nicholasblaskey/raytracer/ray"
"github.com/nicholasblaskey/raytracer/tuple"
)
var DrawBoundingBoxes = false
type G... |
package stepcas
import (
"context"
"crypto/x509"
"net/url"
"time"
"github.com/pkg/errors"
"github.com/smallstep/certificates/api"
"github.com/smallstep/certificates/ca"
"github.com/smallstep/certificates/cas/apiv1"
)
func init() {
apiv1.Register(apiv1.StepCAS, func(ctx context.Context, opts apiv1.Options) (... |
package value
type DataType byte
const (
NotSet DataType = 0x00
Bool DataType = 0x01
SByte DataType = 0x02
Byte DataType = 0x03
Short DataType = 0x04
UShort DataType = 0x05
Int24 DataType = 0x06
UInt24 DataType = 0x07
Int DataType = 0x08
UInt ... |
package ipld
import (
"context"
mrand "math/rand"
"testing"
"time"
mdutils "github.com/ipfs/go-merkledag/test"
"github.com/lazyledger/nmt"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/lazyledger/lazyledger-core/abci/types"
"github.com/lazyledger/lazyledger-cor... |
/*
Onix Config Manager - Terraform Provider
Copyright (c) 2018-2020 by www.gatblau.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
Un... |
package ion
import (
"bufio"
"bytes"
"io"
"strings"
)
type Token int
const (
ILLEGAL Token = iota
EOF
WHITESPACE
COMMA
COLON
DOUBLE_COLON
SYMBOL
STRING
OPEN_BRACE
CLOSE_BRACE
OPEN_BRACKET
CLOSE_BRACKET
OPEN_PAREN
CLOSE_PAREN
NUMBER
)
func (t Token) String() string {
switch t {
case EOF:
retur... |
package tekton
import (
"context"
"fmt"
lighthousev1alpha1 "github.com/jenkins-x/lighthouse/pkg/apis/lighthouse/v1alpha1"
configjob "github.com/jenkins-x/lighthouse/pkg/config/job"
"github.com/jenkins-x/lighthouse/pkg/util"
"github.com/sirupsen/logrus"
pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pip... |
// Copyright (c) 2018 Uber Technologies, Inc.
//
// 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... |
// Copyright 2016 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 crypto
import (
"crypto/aes"
"crypto/cipher"
"golang.org/x/crypto/chacha20poly1305"
"github.com/msgboxio/ike/protocol"
"github.com/pkg/errors"
)
var (
Aes128gcm16Prfsha256Ecp256,
Aes256gcm16Prfsha384Ecp384,
Chacha20poly1305Prfsha256Ecp256,
Aes128gcm16,
Aes256gcm16,
Chacha20poly1305 protocol.Trans... |
package cache
import (
"context"
"fmt"
"reflect"
"sync"
"time"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/keys"
"golang.org/x/tools/internal/imports"
"golang.org/x/tools/internal/lsp/source"
"golang.org/x/tools/internal/span"
)
type importsState struct {
ctx context.Context
m... |
package gerrit
import (
"context"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"time"
"github.com/cenkalti/backoff"
"go.skia.org/infra/go/git"
"go.skia.org/infra/go/skerr"
"go.skia.org/infra/go/sklog"
)
// EditChange is a helper for creating a new patch set on an existing
// Change. Pass in a function which... |
package address
import (
"github.com/hoisie/mustache"
"github.com/zhaolion/gofaker/name"
"github.com/zhaolion/gofaker/random"
)
// FakeAddress fake random address
type FakeAddress struct {
CityPrefixs []string `yaml:"city_prefix,flow"`
CitySuffixs []string `yaml:"city_suffix,flow"... |
// Copyright 2019 The FoodUnit 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by... |
package protocol
import (
"errors"
"hash/crc32"
"io"
"math"
"time"
)
func readMessage(b *pageBuffer, d *decoder) (attributes int8, baseOffset, timestamp int64, key, value Bytes, err error) {
md := decoder{
reader: d,
remain: 12,
}
baseOffset = md.readInt64()
md.remain = int(md.readInt32())
crc := uint... |
// Copyright (c) 2014 Couchbase, 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 w... |
package meta
import (
"context"
"errors"
"path/filepath"
"time"
minio "github.com/minio/minio/cmd"
"github.com/minio/minio/pkg/bucket/policy"
"github.com/threefoldtech/0-stor/client/metastor/metatypes"
)
const (
contentTypeKey = "content-type"
contentEncodingKey = "content-encoding"
amzStorageClass ... |
package modules
import (
"context"
"crypto/rand"
"errors"
"github.com/filecoin-project/venus-miner/api"
"io"
"io/ioutil"
"os"
"path/filepath"
"time"
"github.com/gbrlsnchs/jwt/v3"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p-core/peerstore"
record "github.com/libp2p/go-libp2p-record"
... |
package smtpd
import (
"flag"
"fmt"
"io/ioutil"
"net"
"net/smtp"
"os"
"os/exec"
"path/filepath"
"testing"
"time"
)
var controlTestConfig string = `
servers:
- protocol: tcp
address: 127.0.0.1:30025
logging:
syslogfacility: local1
`
const (
gomsfgaction = "GOMS_FG_ACTION"
)
func sendTestMail(t *testin... |
/*
* Flow CLI
*
* Copyright 2019-2021 <NAME>, 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... |
/*
Sniperkit-Bot
- Status: analyzed
*/
// Copyright 2015-present, Cyrill @ <EMAIL>umacher.fm and the CoreStore contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http... |
/*
Copyright 2020 The Kruise 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 brewerydb
import (
"fmt"
"net/http"
"testing"
)
var fakeDataChanges = `{
"status" : "success",
"numberOfPages" : 5,
"data" : [
{
"action" : "edit",
"subAttribute" : {
"locality" : "Some City",
"locationTypeDisplay" : "Micro Brewery",
"status" : "verified",
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cognitosync
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"
)
// A request for meta data about a dataset (creation date, number of re... |
/*
Copyright 2017 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 2019 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
package termui
import (
"errors"
"sync"
"github.com/gizak/termui"
"github.com/moncho/dry/ui"
"github.com/nsf/termbox-go"
)
// TextInput is a widget to capture user input
type TextInput struct {
termui.Block
input []rune
cursorX int
cursorY int
cursorLinePos int
escaped bool //tra... |
package consumer
import (
"log"
"sync"
"time"
"github.com/Shopify/sarama"
)
// NewPartitionHandle initializes a new PartitionHandle
func NewPartitionHandle(client *Client) *PartitionHandle {
handle := &PartitionHandle{
client: client,
ready: make(chan bool),
partitions: make(map[string]*TopicPart... |
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"math"
"net/http"
"net/url"
"os"
"os/signal"
"path/filepath"
"strconv"
"strings"
"sync"
"text/template"
"time"
movingaverage "github.com/RobinUS2/golang-moving-average"
"github.com/dustin/go-humanize"
"github.com/schollz/httpfileserver"
"github... |
// Package etypeID provides Kerberos 5 encryption type assigned numbers.
package etypeID
// Kerberos encryption type assigned numbers.
const (
//RESERVED : 0
DES_CBC_CRC int32 = 1
DES_CBC_MD4 int32 = 2
DES_CBC_MD5 int32 = 3
DES_CBC_RAW int32 = 4
... |
package eval
import (
"fmt"
"go/ast"
)
// convert an ast.Expr to an Expr without actually checking it. This
// is useful for avoiding special cases in error messages.
func fakeCheckExpr(expr ast.Expr, env Env) Expr {
if expr == nil {
return nil
}
switch expr := expr.(type) {
case *ast.BadExpr:
return &BadEx... |
// Main package for the remotetool binary.
//
// This tool supports common debugging operations concerning remotely executed
// actions:
// 1. Download a file or directory from remote cache by its digest.
// 2. Display details of a remotely executed action.
// 3. Download action results by the action digest.
// 4. Re-e... |
package mysql
import (
"database/sql"
"fmt"
"os"
"strings"
"github.com/GannettDigital/go-newrelic-plugin/helpers"
"github.com/Sirupsen/logrus"
_ "github.com/go-sql-driver/mysql"
)
const NAME string = "mysql"
const PROVIDER string = "mysql"
const PROTOCOL_VERSION string = "1"
const PLUGIN_VERSION string = "1.... |
package perf
import (
"fmt"
"io"
"os"
"path"
"runtime"
"runtime/pprof"
"syscall"
"time"
"github.com/borkshop/bork/internal/ecs"
)
const (
numSamples = 64
)
// Perf is an ecs.Proc that collects Perf data.
type Perf struct {
ecs.Proc
outputBase string
shouldProfile bool
profiling bool
err ... |
package fetching
import (
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"os"
"testing"
"github.com/setlog/trivrost/pkg/launcher/config"
)
type ErrorRecordingHandler struct {
ErrChan chan error
}
func (handler *ErrorRecordingHandler) HandleProgress(fromURL stri... |
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"os"
"os/exec"
"os/signal"
"sync"
"time"
"github.com/exapsy/peekprof/internal/extractors"
httphandler "github.com/exapsy/peekprof/internal/handlers/http"
"github.com/exapsy/peekprof/internal/process"
)
type App struct {
process ... |
// Copyright 2019 ETH Zurich, Anapaya 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... |
package goka
import (
"log"
"time"
)
// PartitionStatus is the status of the partition of a table (group table or joined table).
type PartitionStatus int
const (
// PartitionStopped indicates the partition stopped and should not be used anymore.
PartitionStopped PartitionStatus = iota
// PartitionInitializing i... |
package main
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"log"
"path/filepath"
"regexp"
"strings"
"text/template"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/lindell/multi-gitter/cmd"
)
const templatePath = "./docs/README.template.md"
const resultingPath = "./README.md"
type templateD... |
// Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
// Package dial contains methods and types for dialing XMPP connections.
package dial // import "mellium.im/xmpp/dial"
import (
"context"
"crypto/tls"
"fmt"
"net... |
package storage
import (
"context"
"errors"
"github.com/amirylm/libp2p-facade/core"
"github.com/ipfs/go-bitswap"
"github.com/ipfs/go-bitswap/network"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
exoffline "github.com/ipfs/go-ipfs-exchange-off... |
// Copyright 2014 The Gogs 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 models
import (
"bufio"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
"sync"
"time"
"github.com/Unknw... |
package main
import (
"flag"
"log"
"os"
"strings"
"github.com/hamcha/meiru/lib/config"
"github.com/hamcha/meiru/lib/errors"
"github.com/hamcha/meiru/lib/imap"
"github.com/hamcha/meiru/lib/mailstore"
"github.com/hamcha/meiru/lib/smtp"
)
var conf config.Config
func assert(err interface{}) {
switch e := err.... |
package nest
import (
"errors"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/jtsiros/nest/config"
"github.com/jtsiros/nest/device"
)
type hvacMode string
const (
// Heat mode
Heat hvacMode = "heat"
// Cool mode
Cool hvacMode = "cool"
// HeatCool mode
HeatCool hvacMode = "heat-cool"
// Eco mode
Eco... |
package gorestdoc
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"time"
)
// APIDoc Builds a base document for testing
type APIDoc struct {
Title string
Description string
Generated time.Time
markdownFileName string
htmlFileName string... |
package waldo
import (
"os"
"strings"
)
type CIInfo struct {
gitBranch string
gitCommit string
provider CIProvider
skipCount int
}
//-----------------------------------------------------------------------------
type CIProvider int
const (
Unknown CIProvider = iota // MUST be first
AppCenter
AzureDevOps
... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: custom_json_operation.proto
package steempb
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
// Reference imports to suppress errors if they are not otherwise used.
var _ = pro... |
/*
* Copyright (c) 2019 OysterPack, 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 agree... |
// +build integration
package integration
import (
"context"
"fmt"
"sync"
"time"
"github.com/Azure/go-shuttle/listener"
"github.com/Azure/go-shuttle/message"
tp "github.com/Azure/go-shuttle/publisher/topic"
"github.com/devigned/tab"
"github.com/stretchr/testify/assert"
)
func (suite *serviceBusTopicSuite) ... |
package main
import (
"errors"
"github.com/yuin/gopher-lua"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
"sync"
"time"
)
type article struct {
m sync.Mutex
FilePath string
Format string
Title string
Slug string
BodyText string
BodyHtml string
Status string
Ta... |
// Copyright (c) 2017-2018 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package zedagent
// certs API specific parser/utility routines
import (
"bytes"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"github.com/golang/protobuf/proto"
zcert "github.com/lf-edge/eve/api/go/certs"
zconfig "gi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.