text stringlengths 3.08k 10.4k |
|---|
// Copyright 2014, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mysqlctl
import (
"fmt"
"os"
"golang.org/x/net/context"
log "github.com/golang/glog"
"github.com/gitql/vitess/go/mysqlconn/replication"
"github.co... |
package datasource
import (
"fmt"
"time"
)
type testQuery string
func (q testQuery) String() string {
return string(q)
}
func (q testQuery) ID() string {
return fmt.Sprintf("%d", time.Now().UnixNano())
}
/*
func TestParseMetricString(t *testing.T) {
data, err := ParseMetricString("")
assert.NoError(t, err)
... |
package output
import (
"archive/zip"
"encoding/json"
"io"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/newrelic/newrelic-diagnostics-cli/config"
log "github.com/newrelic/newrelic-diagnostics-cli/logger"
"github.com/newrelic/newrelic-diagnostics-cli/registration"
"github.com/ne... |
// Copyright 2021 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 agreed to i... |
/*
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... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package ledgerconfig
import (
"path/filepath"
"github.com/hyperledger/fabric/core/config"
"github.com/spf13/viper"
)
//IsCouchDBEnabled exposes the useCouchDB variable
func IsCouchDBEnabled() bool {
stateDatabase := viper.GetStr... |
//
// Copyright (c) SAS 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 applicable law or agre... |
// This code comes from https://github.com/prometheus-community/windows_exporter/blob/f1384759cb04f8a66cd0954e2eff4bca81b2caa4/exporter.go.
// To see its license, please refer to https://github.com/prometheus-community/windows_exporter/blob/master/LICENSE.
// The only modification is switching the (deprecated) log prov... |
package seo
import (
"fmt"
"html/template"
"net/url"
"reflect"
"regexp"
"strings"
"github.com/itech-eng/admin"
"github.com/itech-eng/media"
"github.com/itech-eng/qor"
"github.com/itech-eng/qor/resource"
)
func init() {
admin.RegisterViewPath("github.com/itech-eng/seo/views")
}
// New initialize a SeoColl... |
// 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 ... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
package script64
import (
"fmt"
"go/token"
"reflect"
data "github.com/seeder-research/uMagNUS/data64"
)
// converts in to an expression of type OutT.
// also serves as type check (not convertible == type error)
// pos is used for error message on impossible conversion.
func typeConv(pos token.Pos, in Expr, outT ... |
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
package dtls
import (
"bytes"
"errors"
"fmt"
)
type handshakeType uint8
const (
handshakeType_ClientHello ... |
package bigqueue
import (
"errors"
"fmt"
"os"
"path"
)
const (
cArenaFileFmt = "arena_%d.dat"
)
var (
// errShouldNotReach is returned when an invariant is not true anymore
errShouldNotReach = errors.New("SHOULD NOT REACH HERE")
)
// arenaManager manages all the arenas for a bigqueue
type arenaManager struct... |
/*
* Copyright 2019 Nalej
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wri... |
package cmdutils
import (
"fmt"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
)
// AddCommonCreateNodeGroupFlags adds common flags for creating a nodegroup
func AddCommonCreateNodeGroupFlags(fs *pflag.FlagSet, cmd *Cmd, ng *api.NodeGr... |
/*
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package idemix
import (
"io/ioutil"
"github.com/cloudflare/cfssl/log"
proto "github.com/golang/protobuf/proto"
"github.com/VoneChain-CS/fabric-ca-gm/util"
"github.com/VoneChain-CS/fabric-gm/idemix"
"github.com/pkg/errors"
)
co... |
//
// Copyright 2018-present Sonatype 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 ... |
package drng
import (
"sync"
"time"
"github.com/iotaledger/goshimmer/packages/clock"
)
// Ticker holds a channel that delivers randomness at intervals.
type Ticker struct {
dRNGState func() *State
dRNGTicker *time.Ticker
interval int64 // the interval at which the ticker should ti... |
// 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 writin... |
// Copyright ©2015 The Gonum 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 testlapack
import (
"testing"
"golang.org/x/exp/rand"
"github.com/jingcheng-WU/gonum/blas"
"github.com/jingcheng-WU/gonum/blas/blas64"
"gith... |
package chromedominate
import (
"encoding/json"
"errors"
"github.com/gorilla/websocket"
"log"
"strings"
"sync"
"time"
)
type ChromeEventListener interface {
OnMessage(target *ChromeTargetDominate, method string, message []byte)
}
type ChromeTargetDominate struct {
TargetInfo ChromeTargetType
IsAlive b... |
// Package sonyflake implements Sonyflake, a distributed unique ID generator inspired by Twitter's Snowflake.
//
// A Sonyflake ID is composed of
// 39 bits for time in units of 10 msec
// 8 bits for a sequence number
// 16 bits for a machine id
package sonyflake
import (
"errors"
"net"
"sync"
"time"
... |
package beater
import (
"fmt"
"time"
"strings"
"github.com/elastic/beats/libbeat/beat"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/libbeat/publisher"
"github.com/garyburd/redigo/redis"
"github.com/benamazing/rsbeat/config"
)
type Rsbeat struct ... |
// 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... |
package model
import (
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (... |
package views
import (
"context"
"errors"
"strings"
"github.com/derailed/k9s/internal/k8s"
"github.com/derailed/k9s/internal/resource"
"github.com/derailed/tview"
"github.com/gdamore/tcell"
"github.com/rs/zerolog/log"
"k8s.io/client-go/tools/portforward"
)
type containerView struct {
*logResourceView
cur... |
package egoscale
import (
"fmt"
"net"
)
// Nic represents a Network Interface Controller (NIC)
type Nic struct {
ID string `json:"id,omitempty"`
BroadcastURI string `json:"broadcasturi,omitempty"`
Gateway net.IP `json:"gateway,omitempty"`
IP6Address ... |
package main
import (
"io/ioutil"
"log"
"net/http"
"os"
"regexp"
"strings"
"github.com/axgle/mahonia"
"golang.org/x/net/proxy"
)
const (
path = "/Users/dracarysX/Pictures/每日一wen"
userAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 S... |
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"syscall"
"github.com/sevlyar/go-daemon"
"github.com/heetch/confita"
"github.com/heetch/confita/backend"
"github.com/heetch/confita/backend/env"
"github.com/heetch/confita/backend/file"
"github.com/h... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"sort"
)
func main() {
reader := bufio.NewReader(os.Stdin)
tc := readNum(reader)
var buf bytes.Buffer
for tc > 0 {
tc--
n, m := readTwoNums(reader)
teachers := readNNums(reader, n)
groups := make([][]int, m)
for i := 0; i < m; i++ {
sz := readNu... |
package test
import (
"crypto/tls"
"fmt"
"net/http"
"strings"
"testing"
"time"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/random"
"github.com/gruntwork-io/terratest/modules/retry"
"github.com/gruntwork-io/ter... |
// Copyright 2021 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
package main
import (
"crypto/x509"
"database/sql"
"encoding/hex"
"encoding/pem"
"errors"
"fmt"
"github.com/hashicorp/go-plugin"
_ "github.com/mattn/go-sqlite3"
"github.com/veraison/common"
)
var insertQueryText... |
package core
import (
"context"
"fmt"
"time"
"github.com/ich5003/small-osm"
"github.com/ich5003/small-osm/annotate/shared"
)
// A Datasourcer is something that acts like a datasource allowing us to
// fetch children as needed.
type Datasourcer interface {
Get(ctx context.Context, id osm.FeatureID) (ChildList, ... |
/*
* Copyright 2022 The Furiko 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 ag... |
// Copyright (c) 2016 shawn1m. All rights reserved.
// Use of this source code is governed by The MIT License (MIT) that can be
// found in the LICENSE file.
package config
import (
"bufio"
"encoding/json"
"io/ioutil"
"net"
"os"
"regexp"
"strconv"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/shad... |
// Copyright (c) 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a license that can be
// found in the LICENSE file.
package skein
import "github.com/aead/skein/threefish"
type hashFunc struct {
hashsize int
hVal, hValCpy [9]uint64
tweak [3]uint64
block [BlockSize... |
package sync
import (
"io/ioutil"
"github.com/Sirupsen/logrus"
prommodel "github.com/prometheus/common/model"
mconfig "github.com/zionwu/monitoring-manager/config"
"github.com/zionwu/monitoring-manager/model"
alertconfig "github.com/zionwu/monitoring-manager/model/alertmanager"
"github.com/zionwu/monitoring... |
// Copyright (c) 2013 Conformal Systems LLC.
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package yubikey
import (
"crypto/aes"
"encoding/binary"
"errors"
"strings"
)
const (
BlockSize = 16
KeySize = 16
OTPSize = 32 // BlockSize * 2
UidSize ... |
package tieba
import (
"encoding/json"
"fmt"
"log"
"regexp"
"strconv"
"github.com/imroc/req"
"github.com/yann0917/check-in/global"
"github.com/yann0917/check-in/notification"
)
const (
appName = "贴吧"
host = "https://tieba.baidu.com"
referer = "https://tieba.baidu.com/index.html"
)
var apis = map[strin... |
package godotenv
import (
"bytes"
"errors"
"fmt"
"strings"
"unicode"
)
const (
charComment = '#'
prefixSingleQuote = '\''
prefixDoubleQuote = '"'
exportPrefix = "export"
)
func parseBytes(src []byte, out map[string]string, lookupFn LookupFn) error {
cutset := src
for {
cutset = getStatementStart(... |
package main
// Imports
import "os"
import "time"
import "fmt"
import "io/ioutil"
import "strings"
// TODO: config parser
import "github.com/bigkevmcd/go-configparser"
// Constants
// TODO: check if file exists
const STOP = "<>--- STOP ---<>"
const TIMEFORMAT = "01.02.2006 15:04:05 Mon"
var path = ""
// print-color... |
// Copyright 2015 <NAME> and <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package msolid
import (
"math"
"github.com/cpmech/gosl/chk"
"github.com/cpmech/gosl/fun"
"github.com/cpmech/gosl/tsr"
)
// Ogden implements a linear e... |
// Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License included
// in the file licenses/BSL.txt and at www.mariadb.com/bsl11.
//
// Change Date: 2022-10-01
//
// On the date above, in accordance with the Business Source License, use
// of this software will be gov... |
package client
import (
"fmt"
"net/http"
"net/http/httptest"
"strings"
"testing"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
"github.com/alibabacloud-go/tea/utils"
credential "github.com/aliyun/credentials-go/credentials"
)
func mockServer(status int, json string... |
// Copyright 2019-present Open Networking Foundation.
//
// 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 applica... |
package testing
import (
"fmt"
"net/http"
"testing"
"time"
"github.com/nexclipper/gophercloud/openstack/clustering/v1/events"
th "github.com/nexclipper/gophercloud/testhelper"
fake "github.com/nexclipper/gophercloud/testhelper/client"
)
const ListResponse = `
{
"events": [
{
"action": "CLUSTER_CREATE",... |
// Copyright 2019-present Facebook Inc. All rights reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.
// Code generated by entc, DO NOT EDIT.
package ent
import (
"context"
"fmt"
"entgo.io/ent/dialect/sql/sqlgraph"
"entg... |
// Copyright (c) 2018, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
package env
import (
"fmt"
"strings"
"testing"
"github... |
/*************************************************************************
* Copyright 2017 Gravwell, Inc. All rights reserved.
* Contact: <<EMAIL>>
*
* This software may be modified and distributed under the terms of the
* BSD 2-clause license. See the LICENSE file for details.
**********************************... |
// Copyright 2014-2016 <NAME>.
// Released under the terms of the MIT license.
// xip.name is a small name server which sends back any IP address found in the provided hostname.
//
// When queried for type A, it sends back the parsed IPv4 address.
// In the additional section the client host:port and transport are sho... |
package models
import (
"encoding/json"
"io"
"io/ioutil"
"time"
"github.com/ONSdigital/dp-api-clients-go/v2/dataset"
"github.com/ONSdigital/dp-api-clients-go/v2/recipe"
errs "github.com/ONSdigital/dp-import-api/apierrors"
bsonprim "go.mongodb.org/mongo-driver/bson/primitive"
)
// CreatedState represents one ... |
package resolver
import (
"context"
"encoding/json"
"fmt"
"github.com/gofrs/uuid"
"github.com/layer5io/meshery/handlers"
"github.com/layer5io/meshery/internal/graphql/model"
"github.com/layer5io/meshery/models"
)
func (r *Resolver) getPerfResult(ctx context.Context, provider models.Provider, id string) (*mode... |
package main
import (
"github.com/GrayOxygen/json-go-struct/apis"
"encoding/json"
"github.com/asticode/go-astichartjs"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"sort"
"strconv"
"github.com/asticode/go-astilectron"
"github.com/asticode/go-astilectron-bootstrap"
"strings"
)
// handleMessages handles mess... |
/*
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 (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package user
import (
"regexp"
"github.com/mattermost/mattermost-load-test-ng/loadtest/store"
"github.com/mattermost/mattermost-server/v5/model"
)
// TestUserSuffixRegexp matches the numerical suffix ... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package channel
import (
reqContext "context"
"strings"
"github.com/pkg/errors"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/context"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fa... |
package web
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/bitsbeats/dronetrigger/core"
"github.com/bitsbeats/dronetrigger/mock"
"github.com/golang/mock/gomock"
check "gopkg.in/check.v1"
)
func Test(t *testing.T) {
check.TestingT(t)
}
type TestSuite struct{}
... |
package radareutil
import (
"bytes"
"fmt"
"io"
"os/exec"
"path/filepath"
"sync"
)
type Mode string
func (o Mode) String() string {
return string(o)
}
const (
Unset Mode = ""
Cli Mode = "cli"
Http Mode = "http"
)
type State string
func (o State) String() string {
return string(o)
}
const (
Stopped ... |
package main
import (
"bufio"
"fmt"
"image"
"image/jpeg"
"image/png"
"net/http"
"os"
"os/user"
"regexp"
"strconv"
"strings"
"sync"
"github.com/PuerkitoBio/goquery"
logging "github.com/op/go-logging"
"github.com/skratchdot/open-golang/open"
"github.com/spf13/cobra"
)
var (
baseDir string
threadId =... |
package machine
import (
"encoding/json"
"fmt"
"io/ioutil"
)
/*
If this file gets too nuts, we can perhaps use existing go code
to create ignition files. At this point, the file is so simple
that I chose to use structs and not import any code as I was
concerned (unsubstantiated) about too much bloat coming in... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package cloudwatch
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides a CloudWatch Dashboard... |
package main
/**
this program creates vault tokens and store them periodically in the build variables
of your gitlab repos
you need to use a vault client to be able to read secrets on your pipelines
*/
import (
vault "github.com/hashicorp/vault/api"
"github.com/robfig/cron"
"github.com/xanzy/go-gitlab"
"str... |
package api_test
import (
"log"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"time"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/ory/dockertest/v3"
"github.com/treeverse/lakefs/api"
"github.com/treeverse/lakefs/api/gen/client"
"github.com/tre... |
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
package lib
import (
"bufio"
"encoding/hex"
"fmt"
"log"
"os"
"regexp"
"strings"
)
// ReadLines reads a whole file into memory
// and returns a slice of its lines.
func ReadLines(path string) ([]string, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
var lines []... |
package tokenizer
// This file is part of shelldoc.
// © 2018, <NAME> <<EMAIL>> and the shelldoc contributors
// SPDX-License-Identifier: LGPL-3.0
import (
"log"
"regexp"
"strings"
"gopkg.in/russross/blackfriday.v2"
)
// Visitor contains the element handler functions
type Visitor struct {
// CodeBlock should b... |
// Copyright 2016 <NAME>, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
package main
import (
"fmt"
"testing"
"github.com/attic-labs/noms/go/d"
"github.com/attic-labs/noms/go/datas"
"github.com/attic-labs/noms/go/marshal"
"github.com/... |
package pkg
import (
"context"
"fmt"
"io/ioutil"
"log"
"os"
"path"
"github.com/containerd/containerd"
"github.com/containerd/containerd/cio"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/oci"
gocni "github.com/containerd/go-cni"
"github.com/openfaas/faasd/pkg/cninetwork"
... |
package cmd
import (
"bufio"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/mholt/archiver/v3"
"github.com/spf13/cobra"
"io"
"os"
"os... |
/*
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 i... |
// Copyright 2019 Teonet-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.
// Teonet packet module.
package teonet
// #include <stdlib.h> /* free */
// #include "packet.h"
import "C"
import (
"errors"
"unsafe"
"github.com/ki... |
package map_testing
// import _ "../github.com/pkg/profile"
import "fmt"
import "time"
import "math/rand"
func populate_map_struct(m map[point]point) {
for i := 0; i < ROWS; i++ {
go func(idx int) {
for j := 0; j < COLS; j++ {
key, val := point{idx, j}, point{ROWS - idx, COLS - j}
m[key] = p... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2020 Datadog, Inc.
package main
import (
"fmt"
"math/rand"
"strconv"
"time"
log "github.... |
package matrix
import (
"errors"
"github.com/fighterlyt/permutation"
"github.com/sirupsen/logrus"
)
type PermutateMatrix struct {
iterSeqLength int
idle chan bool
DoneChan chan bool
IterChan chan Iterator
IterTotal uint64
IterTotalChan chan uint64
... |
package mdns
import (
"context"
"errors"
"net"
"sync"
"testing"
"github.com/celebdor/zeroconf"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
)
func makeServiceEntry(name, domain string, ip net.IP) *zeroconf.ServiceEntry {
var ipAddrv4, ipAddrv6 []net.IP
if ip.To4() != nil {
ipAddrv4 = appen... |
package build
import (
"fmt"
"github.com/fatih/color"
)
const (
defaultTheme = "bee"
)
// Colors define a theme
type Colors struct {
Title []string
Ok []string
Error []string
}
// Theme defined by colors
type Theme struct {
Title []color.Attribute
Ok []color.Attribute
Error []color.Attribute
}
// Th... |
package tchannel_test
import (
"fmt"
"sync"
"testing"
"time"
. "github.com/uber/tchannel-go"
"github.com/uber/tchannel-go/benchmark"
"github.com/uber/tchannel-go/testutils"
"github.com/bmizerany/perks/quantile"
"github.com/stretchr/testify/require"
)
type benchmarkParams struct {
servers, clients int
re... |
//
//
// File generated from our OpenAPI spec
//
//
package stripe
import "encoding/json"
// OrderStatus represents the statuses of an order object.
type OrderStatus string
// List of values that OrderStatus can take.
const (
OrderStatusCanceled OrderStatus = "canceled"
OrderStatusCreated OrderStatus = "create... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: grpc_controller.proto
package plugin
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var ... |
/*
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... |
package signalwire
import (
"context"
"encoding/json"
"errors"
"strings"
"sync"
)
// SendDigitsState keeps the state of a SendDigits action
type SendDigitsState int
// TODO DESCRIPTION
const (
SendDigitsFinished SendDigitsState = iota
)
func (s SendDigitsState) String() string {
return [...]string{"Finished"... |
// Package smallAndLight provides primitives to interact the openapi HTTP API.
//
// Code generated by go-sdk-codegen DO NOT EDIT.
package smallAndLight
// Error defines model for Error.
type Error struct {
// An error code that identifies the type of error that occurred.
Code string `json:"code"`
// Additional i... |
package task
import (
"fmt"
"github.com/golang/glog"
"github.com/kevinu2/gohangout/common"
"github.com/kevinu2/gohangout/input"
"github.com/kevinu2/gohangout/topology"
_ "net/http/pprof"
"sync"
)
type GoHangoutInputs []*input.InputBox
type TskActionResult struct {
LoadMode common.RuleLoadMode
TaskId strin... |
// Copyright 2020 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... |
package api
import (
"encoding/json"
"github.com/bytebase/bytebase/plugin/db"
)
// Instance is the API message for an instance.
type Instance struct {
ID int `jsonapi:"primary,instance"`
// Standard fields
RowStatus RowStatus `jsonapi:"attr,rowStatus"`
CreatorID int
Creator *Principal `jsonapi:"relation,cr... |
// The MIT License (MIT)
//
// Copyright (c) 2021 <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 u... |
// BCM2835 SoC Mailbox support
// https://github.com/usbarmory/tamago
//
// Use of this source code is governed by the license
// that can be found in the LICENSE file.
//
// Mailboxes are used for inter-processor communication, in particular
// the VideoCore processor.
//
package bcm2835
import (
"encoding/binary"... |
// Copyright 2017 The etcd 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 t... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20160515
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Disk struct {
pulumi.CustomResourc... |
package dashboard
import (
"context"
"fmt"
"runtime"
"strings"
"github.com/docker/docker/api/types/mount"
"github.com/kyma-project/cli/internal/cli"
"github.com/kyma-project/cli/internal/kube"
"github.com/kyma-project/cli/pkg/docker"
"github.com/pkg/browser"
"github.com/pkg/errors"
"github.com/spf13/cobra"... |
/*
Copyright 2021 NDD.
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 u... |
// Code generated by entc, DO NOT EDIT.
package novel
import (
"time"
)
const (
// Label holds the string label denoting the novel type in the database.
Label = "novel"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldClassifyId holds the string denoting the classifyid ... |
// Copyright (c) 2011 CZ.NIC z.s.p.o. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// blame: jnml, labs.nic.cz
package main
import (
"encoding/hex"
"fmt"
"github.com/cznic/dns/msg"
"github.com/cznic/dns/pcat"
"log"
"path"
"sort"
)... |
package services
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"strings"
"time"
"github.com/datawire/dlib/dgroup"
"github.com/datawire/dlib/dhttp"
)
// HTTP server object (all fields are required).
type HTTP struct {
Port int16
Backend ... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.
// Package upgrade contains upgrade plugin command logic.
package upgrade
i... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package securityinsights
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Represents an automation rule.... |
// Copyright 2019 Istio 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 i... |
package controllers
import (
"context"
poisonpillv1alpha1 "github.com/medik8s/poison-pill/api/v1alpha1"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"
"sigs.k8s.io/controller-runtime/pkg/client"
logf "sigs.k8s.io/controller-runt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.