text stringlengths 3.08k 10.4k |
|---|
/*
Open Source Initiative OSI - The MIT License (MIT):Licensing
The MIT License (MIT)
Copyright (c) 2013 DutchCoders <http://github.com/dutchcoders/>
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... |
// written by <NAME> <<EMAIL>>
// released under the ISC license
package ircmsg
import (
"errors"
"strings"
)
var (
// ErrorLineIsEmpty indicates that the given IRC line was empty.
ErrorLineIsEmpty = errors.New("Line is empty")
// ErrorTagsContainsBadChar indicates that the passed tag string contains a space or... |
/*
Copyright 2015 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... |
package acceptance
import (
"errors"
"fmt"
"os"
"testing"
"github.com/databrickslabs/databricks-terraform/common"
"github.com/databrickslabs/databricks-terraform/internal/acceptance"
"github.com/databrickslabs/databricks-terraform/internal/qa"
. "github.com/databrickslabs/databricks-terraform/storage"
"gith... |
// Code generated by sqlc. DO NOT EDIT.
// source: addresses.sql
package db
import (
"context"
"github.com/handshake-labs/blockexplorer/pkg/types"
)
const addressExists = `-- name: AddressExists :one
SELECT EXISTS(SELECT 1 FROM tx_outputs WHERE tx_outputs.address = $1::text)
`
func (q *Queries) AddressExists(ctx... |
package kerneladiutor
import (
"database/sql"
"encoding/json"
"sync"
_ "github.com/mattn/go-sqlite3"
"fmt"
"../utils"
"sort"
"time"
)
type DeviceData struct {
db *sql.DB
Infos map[string]*DeviceInfo
SortedScores []string
Board map[string][]string
newDevices []*DeviceInfo
Lock sync.Mutex
}
... |
package fakerpc
import (
"bytes"
"net"
"net/http"
"net/url"
"testing"
)
var (
cli = [...]net.TCPAddr{{
IP: net.IPv4(192, 168, 14, 186),
Port: 46793,
}, {
IP: net.IPv4(192, 168, 14, 186),
Port: 46794,
}, {
IP: net.IPv4(192, 168, 14, 186),
Port: 46795,
}}
srv = &net.TCPAddr{
IP: net.IPv4... |
package s3
import (
"encoding/xml"
"time"
)
/* Canned ACL Constants.
PRIVATE = "private"
PUBLIC_READ = "public-read"
PUBLIC_READ_WRITE = "public-read-write"
AUTHENTICATE_READ = "authenticated-read"
BUCKET_OWNER_READ = "bucket-owner-read"
BUCKET_OWNER_FULL_CONTROL = "bucket-owner-full-control"
LOG_DELIVERY_WR... |
// Copyright Splunk, 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 wri... |
package grpcweb
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"sync"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
)
type (
TransportBuilder func(host string, req *Request) Transport
StreamTransportBuilder func(host string, endpoint string) (StreamTransport,... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package redisrpc
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc packa... |
package main
import (
"bytes"
"math"
"strings"
"testing"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana-plugin-sdk-go/data"
)
func TestParseCSV(t *testing.T) {
logger := log.New()
for _, tt := range []struct {
query csvOptions
input string
output []*data.Field
}{... |
package awsspec
import (
"encoding/json"
"errors"
"net/url"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/iam"
)
type (
ConditionOperator interface {
GetOperator() string
GetVariable() string
GetValue() interface{}
}
// PolicyDocument represents an IAM policy document
PolicyDocume... |
package assembler
import (
"testing"
"github.com/qiniu/arch/devices/console"
"github.com/qiniu/arch/devices/keyboard"
"github.com/qiniu/arch/drivers"
"github.com/qiniu/arch/von"
con "github.com/qiniu/arch/drivers/console"
kb "github.com/qiniu/arch/drivers/keyboard"
)
type shortMem struct {
b []byte
}
func ... |
package scheduler
import (
"context"
"errors"
"fmt"
"sync"
"time"
"github.com/5imili/kugo/pkg/dao"
daotypes "github.com/5imili/kugo/pkg/dao/mysql/types"
"github.com/5imili/kugo/pkg/task/types"
"github.com/5imili/kugo/pkg/task/utils"
"github.com/leopoldxx/go-utils/trace"
"github.com/zieckey/etcdsync"
)
con... |
package setting
import (
"context"
"encoding/json"
"strings"
"testing"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
corefake "k8s.io/client... |
package data
// Data is the structure of the data directory.
type Data struct {
TemplateDir string `yaml:"template_dir"`
TemplatePaths []string `yaml:"template_paths"`
DataDir string `yaml:"data_dir"`
Hierarchy []string `yaml:"hierarchy"`
}
// HostData is the data relating to a particular host.
ty... |
package process
import (
"bytes"
"github.com/jchavannes/btcd/wire"
"github.com/jchavannes/jgo/jerr"
"github.com/jchavannes/jgo/jfmt"
"github.com/jchavannes/jgo/jlog"
"github.com/jchavannes/jgo/jutil"
"github.com/memocash/index/db/client"
"github.com/memocash/index/db/item"
"github.com/memocash/index/node/obj/... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: Fundamentals/Security/Claim.proto
package security
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf... |
/*
* Copyright (c) 2021 by the OnMetal 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 l... |
package markdown
import (
"bytes"
"fmt"
"regexp"
"strings"
"github.com/kode4food/ale/internal/console"
)
// This is *not* a full-featured markdown formatter, or even a compliant one
// for that matter. It only supports the productions that are used by the
// system's documentation strings and will likely not ev... |
package main
import (
"bytes"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path/filepath"
"strings"
"text/template"
"unicode"
"github.com/fatih/structtag"
"github.com/pkg/errors"
"github.com/rogpeppe/go-internal/module"
"golang.org/x/mod/modfile"
)
type tmplVars struct ... |
// Copyright 2021 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.
// Code generated by generate.go. DO NOT EDIT.
package fiat
import (
"crypto/subtle"
"errors"
)
// P256Element is an integer modulo 2^256 - 2^224 + 2^192 +... |
package rascal
import (
"fmt"
"github.com/spf13/viper"
"github.com/streadway/amqp"
"log"
"os"
"runtime"
"sync"
"time"
)
type Rascal struct {
name string
connection *amqp.Connection
handlers map[string]func(amqp.Delivery, *amqp.Channel)
errChan chan *amqp.Error
active bool
connLock sync.... |
package main
import (
"fmt"
"reflect"
)
/*
https://blog.golang.org/laws-of-reflection
reflect 3大定律
1. Reflection goes from interface value to reflection object.
interface{}类型的值到反射reflecton对象.
根源上来说, reflection的原理就是检查interface中保存的一对值和类型, 所以在reflect包中,有两个类型我们需要记住, Type和Value两个类型. 通过这两个类型,我们可以访问一个interface变量的内容. 调用re... |
// Copyright 2020 Thinkium
//
// 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 service
import (
"context"
"time"
"github.com/pkg/errors"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
intAuth "github.com/cortezaproject/corteza-server/pkg/auth"
"github.com/cortezaproject/corteza-server/pkg/aut... |
package chilis
import (
"encoding/json"
"fmt"
"net/url"
"strconv"
"time"
"github.com/antchfx/htmlquery"
"golang.org/x/net/html"
)
// A Customer provides access to all of the customer-related information that
// is needed to place a Chili's order. It isn't implemented as a concrete type
// (like all of the oth... |
package common
import (
"fmt"
"strings"
)
// Code represents ISO 4217 Currency Codes
type Code string
// ISO 4217 Code List
const (
AED Code = "AED"
AFN Code = "AFN"
ALL Code = "ALL"
AMD Code = "AMD"
ANG Code = "ANG"
AOA Code = "AOA"
ARS Code = "ARS"
AUD Code = "AUD"
AWG Code = "AWG"
AZN Code = "AZN"
BA... |
// Copyright (c) 2013-2016 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
"fmt"
_ "net/http/pprof"
"os"
"path/filepath"
"runtime"
"runtime/pprof"
"time"
"github.com/kaspanet/kaspad/app"
"github.com/kaspanet/ka... |
package http
import (
"errors"
"io"
"log"
"net/http"
"strings"
"github.com/Mushus/image-server/server/internal"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
"github.com/gofiber/fiber/v2/middleware/requestid"
)
type Server struct {
app *fiber.App
}
func ProvideServer(
con... |
/*
* Copyright 2017 <NAME>.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, s... |
package pixivgogo
import (
"github.com/sleepingpig/pixivgogo/pkg/pixivgogo/datetime"
)
type RankingIllustsFilter struct {
// Filter is the filter for the illustrations.
// Possible values: "for_ios", "for_android"
// This field is optional.
Filter IllustFilter `schema:"filter,omitempty"`
// Mode of the ranking... |
package utils
import (
"errors"
"io"
"log"
"net/http"
"os"
"reflect"
"strings"
"text/template"
"unicode"
"github.com/hacdias/caddy-hugo/assets"
"github.com/hacdias/caddy-hugo/config"
"github.com/spf13/hugo/commands"
"github.com/spf13/viper"
)
// CanBeEdited checks if the extension of a file is supported... |
package hamt
import (
"bytes"
"context"
"fmt"
"time"
/*
bstore "github.com/ipfs/go-ipfs/blocks/blockstore"
bserv "github.com/ipfs/go-ipfs/blockservice"
offline "github.com/ipfs/go-ipfs/exchange/offline"
*/
block "github.com/ipfs/go-block-format"
cbor "github.com/ipfs/go-ipld-cbor"
recbor "github.c... |
// Package cosmosanalysis provides a toolset for statically analysing Cosmos SDK's
// source code and blockchain source codes based on the Cosmos SDK
package cosmosanalysis
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"os"
"path/filepath"
"github.com/pkg/errors"
"golang.org/x/mod/modfile"
)
const (
cosmos... |
package compactor
import (
"context"
"path"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
tsdb_errors "github.com/prometheus/prometheus/tsdb/errors"
"gith... |
package cmd
import (
"context"
"fmt"
"io"
"net"
"net/http"
_ "net/http/pprof"
"os"
"time"
"github.com/lnsp/cloudsort/control"
"github.com/lnsp/cloudsort/pb"
"github.com/lnsp/cloudsort/worker"
"github.com/spf13/cobra"
"go.uber.org/zap"
"google.golang.org/grpc"
)
var rootCmd = &cobra.Command{
Use: "cl... |
package reservation
import (
"fmt"
"os"
"time"
"github.com/garyburd/redigo/redis"
"gopkg.in/Clever/kayvee-go.v6/logger"
)
// Reservation is a type that represents a lock on a resource. At most one reservation
// can exist for an individual resource at any time.
type Reservation struct {
stopped bool
key s... |
// Copyright 2020 The Chromium OS 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 arcappcompat will have tast tests for android apps on Chromebooks.
package arcappcompat
import (
"context"
"time"
"chromiumos/tast/loca... |
package core
import (
"bytes"
"testing"
"time"
"github.com/DE-labtory/cleisthenes"
"github.com/DE-labtory/cleisthenes/honeybadger"
"github.com/DE-labtory/cleisthenes/pb"
"github.com/DE-labtory/cleisthenes/tpke"
)
type sampleTransaction struct {
From string
To string
Amount int
}
type mockACS struct ... |
//
// Copyright 2020 Pantacor 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 or agreed ... |
// Copyright (c) 2016 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 2018 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.
// Dict impletments a bunch of operations which are pretty
// simliar to what python does. It is majorly based on
// the Go map type to support different API th... |
package plugins
import (
"context"
"github.com/b2wdigital/restQL-golang/v6/internal/domain"
"net/http"
"net/url"
"runtime/debug"
"github.com/b2wdigital/restQL-golang/v6/pkg/restql"
"github.com/pkg/errors"
"github.com/valyala/fasthttp"
)
// Lifecycle represent the hooks on the query execution.
type Lifecycle ... |
package main
import (
"strconv"
"strings"
"github.com/dpinela/mflg/internal/buffer"
"github.com/dpinela/mflg/internal/color"
"github.com/dpinela/mflg/internal/config"
"github.com/dpinela/mflg/internal/highlight"
"github.com/dpinela/mflg/internal/termdraw"
"github.com/dpinela/mflg/internal/termesc"
"github.c... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package stream
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package... |
package main
import (
"context"
"flag"
"math/rand"
"net/http"
"strconv"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/runconduit/conduit/controller/api/proxy"
common "github.com/runconduit/conduit/controller/gen/common"
pb "github.com/runconduit/conduit/controller/gen/proxy/telemetry"
"gi... |
package refs
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/control... |
package gorethink
import (
"fmt"
"github.com/adjust/goprotobuf/proto"
p "github.com/adjust/gorethink/ql2"
"strconv"
"strings"
)
type OptArgs interface {
toMap() map[string]interface{}
}
type termsList []RqlTerm
type termsObj map[string]RqlTerm
type RqlTerm struct {
name string
termType p.Term_TermType
da... |
package file
import (
"bytes"
"fmt"
"go/parser"
"go/token"
"io/ioutil"
"path/filepath"
"strings"
"github.com/dave/dst"
"github.com/dave/dst/decorator"
"github.com/hocv/gin-swagger-gen/lib/common"
)
// File file
type File struct {
dirty bool
src string // file name or sourc... |
package loadtest
import (
"sync"
"time"
)
// TransactorGroup allows us to encapsulate the management of a group of
// transactors.
type TransactorGroup struct {
transactors []*Transactor
statsMtx sync.RWMutex
startTime time.Time
txCounts map[int]int // The counts of all of the total transactions per transa... |
/*
Copyright 2018 The Rook 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 agreed to ... |
// Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
// Copyright 2016 The etcd-operator 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... |
// *** 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 dataproc
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Three different resources help you manage IAM po... |
package socket
import (
"bytes"
"encoding/gob"
"errors"
"fmt"
"net"
"sync"
"github.com/viwii/utils/utils"
"github.com/golang/protobuf/proto"
)
type CloseType int
var (
CloseType_UpLayer CloseType = 0 //上层主动
CloseType_UnderLayer CloseType = 1 //下层主动
)
type Session struct {
sockid uint64
write... |
package proxy
import (
"math"
"github.com/fagongzi/gateway/pkg/pb/metapb"
"github.com/fagongzi/gateway/pkg/store"
"github.com/fagongzi/log"
"github.com/fagongzi/util/format"
)
var (
eventTypeStatusChanged = store.EvtType(math.MaxInt32)
eventSrcStatusChanged = store.EvtSrc(math.MaxInt32)
)
type statusChanged... |
// Copyright (C) 2019-2021 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) ... |
// Copyright 2015-2021 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
/*
Copyright 2016 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... |
// Package xstats is a generic client for service instrumentation.
//
// xstats is inspired from Go-kit's metrics (https://github.com/go-kit/kit/tree/master/metrics)
// package but it takes a slightly different path. Instead of having to create
// an instance for each metric, xstats use a single instance to log every m... |
package plugin
import (
"math/rand"
"net/http"
"reflect"
"strings"
"sync"
"time"
"github.com/mattermost/mattermost-server/v5/model"
mattermostPlugin "github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-plugin-splunk/server/api"
"github.com/mattermost/mattermost-plugin-splun... |
package teams
import (
"crypto/rand"
"encoding/hex"
"testing"
"time"
"github.com/keybase/client/go/kbtest"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/keybase1"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
func makeCryptKey(t *testing.T, gen int) keybase... |
/*
* 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 networkpolicy
import (
"fmt"
"sort"
v1 "github.com/rancher/rancher/pkg/generated/norman/core/v1"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
knetworkingv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/p... |
package web
import (
"context"
"database/sql"
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/google/go-github/v35/github"
uuid "github.com/satori/go.uuid"
"github.com/whywaita/myshoes/internal/config"
"github.com/whywaita/myshoes/pkg/datastore"
"github.com/whywaita/myshoes/pkg/gh"
"gith... |
package main
import (
"fmt"
"math/rand"
"os"
"os/exec"
"strconv"
"time"
)
var stepCounter int
var totalTimeTaken time.Duration
// const finishedBoard [3][3]int = [[1,2,3],[4,5,6],[7,8,9]]
func main() {
startTime := time.Now()
init:
puzzle := [3][3]int{}
puzzle = initBoard(puzzle)
if !isBoardSolvable(... |
package zlog
import (
"bytes"
"context"
"testing"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func TestDynamicLevelCore(t *testing.T) {
buf := &bytes.Buffer{}
logger, _, err := NewWithOutput(&Config{Development: false, Level: "error"}, zapcore.AddSync(buf))
assert.Nil(... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"strings"
"path/filepath"
"path"
// "github.com/k0kubun/pp"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"github.com/karrick/godirwalk"
"github.com/spf13/pflag"
)
var (
help bool
debug bool
dataDir string
mong... |
package main
import (
"context"
"fmt"
"os"
"github.com/alibaba/pouch/apis/types"
units "github.com/docker/go-units"
"github.com/spf13/cobra"
)
// infoDespscription is used to describe info command in detail and auto generate command doc.
var infoDescription = "Display the information of pouch, " +
"including... |
// Copyright 2019 The Hugo 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 ... |
/*
Copyright 2022 Cortex 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, softwa... |
package webhook
import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"net/url"
"time"
"github.com/kinecosystem/agora-common/headers"
"github.com/kinecosystem/agora-common/retry"
"github.com/kinecosystem/agora-common/retry/backoff"
"github.com/pkg/er... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codecommit
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type GetMergeOptionsInput struct {
_ struct{} `type:"structure"`
// The level of conflict detail to use. If unspecifie... |
// Copyright 2011 The Walk Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"log"
"os"
"path/filepath"
"time"
)
import (
"github.com/lxn/walk"
// ...
_ "runtime/cgo"
. "github.com/lxn/walk/declarative"... |
package cmd
import (
"fmt"
"math"
"os"
"path"
"sync"
"github.com/hryyan/b2"
"github.com/spf13/cobra"
"github.com/vbauerster/mpb"
"github.com/vbauerster/mpb/decor"
)
var concurrency int64 = 1
func uploadFile(client *b2.B2, bucket *b2.Bucket, fileName, filePath string, size int64) {
var (
wg sync.WaitGrou... |
package main
import (
"api"
"fmt"
"state"
"vm"
)
import "io/ioutil"
import "os"
import "binchunk"
func main() {
if len(os.Args) > 1 {
data, err := ioutil.ReadFile(os.Args[1])
if err != nil {
panic(err)
}
luaMain(data)
}
}
func luaMain(data []byte) {
ls := state.New(20)
ls.Load(data, os.Args[1], "... |
package models
import (
"github.com/graphql-go/graphql"
)
/*
* This file contains the defnitions of the category model
*/
//Category helps to classify the products.
//It can have subcategories too
type Category struct {
//ID of the product
ID uint `gorm:"primary_key"`
Name string //Name of th... |
/*
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, ... |
package dhcp4
import (
"net"
"time"
)
// A DHCP packet
type Packet []byte
func (p Packet) OpCode() OpCode { return OpCode(p[0]) }
func (p Packet) HType() byte { return p[1] }
func (p Packet) HLen() byte { return p[2] }
func (p Packet) Hops() byte { return p[3] }
func (p Packet) XId() []byte { return ... |
/*
Copyright 2011 Google 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, software
di... |
package tasks
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"strings"
"time"
cloudtasks "cloud.google.com/go/cloudtasks/apiv2"
"github.com/golang/protobuf/ptypes/timestamp"
"golang.org/x/oauth2/google"
"google.golang.org/api/iterator"
taskspb "google.golang.org/genproto/googleapis/cloud/tasks/... |
// Copyright 2015 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... |
package akkacluster
import (
"context"
"fmt"
"reflect"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
... |
package mgtv
import (
"encoding/base64"
"encoding/json"
"fmt"
"regexp"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
"github.com/iawia002/lux/extractors"
"github.com/iawia002/lux/request"
"github.com/iawia002/lux/utils"
)
func init() {
extractors.Register("mgtv", New())
}
type mgtvVideoStream stru... |
package goroslib
import (
"context"
"fmt"
"reflect"
"sync"
"github.com/aler9/goroslib/pkg/actionproc"
)
type goalHandlerPair struct {
gh *ActionServerGoalHandler
goal interface{}
}
// SimpleActionServerConf is the configuration of a SimpleActionServer.
type SimpleActionServerConf struct {
// parent node.
... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package presentproof
import (
"errors"
"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/presentproof"
)
type (
// RequestPre... |
package edit
import (
"bytes"
"fmt"
"os"
"github.com/rancher/rio/cli/pkg/clicontext"
"github.com/rancher/rio/cli/pkg/lookup"
clitypes "github.com/rancher/rio/cli/pkg/types"
riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1"
"github.com/rancher/rio/pkg/riofile"
"github.com/rancher/rio/pkg/systemstack"
... |
// Copyright 2012 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 odbc_test
import (
"database/sql"
"flag"
"fmt"
"testing"
"time"
_ "github.com/runner-mei/odbc"
)
var (
fox = flag.String("fox", "testdata", "d... |
// 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 Datadog, Inc.
// Package mux provides tracing functions for tracing the gorilla/mux package (ht... |
// 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 mat
import "gonum.org/v1/gonum/blas/blas64"
func asBasicMatrix(d *Dense) *basicMatrix { return (*basicMatrix)(d) }
func asBasicVector... |
package main
import (
"bytes"
"context"
"fmt"
"net/http"
"net/url"
"strconv"
"strings"
"github.com/gorilla/mux"
"github.com/kiteco/kiteco/kite-answers/go/execution"
"github.com/kiteco/kiteco/kite-answers/go/githubapp"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonresource"
"github.com/shurcooL/githu... |
package agent
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/armon/circbuf"
"github.com/docker/go-connections/sockets"
)
// DockerClient is a simplified client for the Docker Engine API
// to execute the health checks and avoid significant dependencies.
/... |
package auditlog
import (
"context"
"io"
"net"
"github.com/containerssh/auditlog/message"
)
// Logger is a top level audit logger.
type Logger interface {
// OnConnect creates an audit log message for a new connection and simultaneously returns a connection object for
// connection-specific messages
... |
package cmd
import (
"github.com/go-errors/errors"
irma "github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/server/keyshare/myirmaserver"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var myirmaServerCmd = &cobra.Command{
Use: "myirmaserver"... |
// 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 agreed to in ... |
package dhcp4
import (
"errors"
"io"
"net"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
type testPacketConn struct {
mock.Mock
}
func (pc *testPacketConn) ReadFrom(b []byte) (n int, addr net.Addr, ifindex int, err error) {
args := pc.Called(b)
switch arg0 := args.Get... |
// 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 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.