text stringlengths 3.08k 10.4k |
|---|
package examples
import (
"math"
"runtime"
"github.com/go-gl/gl/v2.1/gl"
"github.com/jakecoffman/cp"
)
var GRABBABLE_MASK_BIT uint = 1 << 31
var GrabFilter cp.ShapeFilter = cp.ShapeFilter{
cp.NO_GROUP, GRABBABLE_MASK_BIT, GRABBABLE_MASK_BIT,
}
var NotGrabbableFilter cp.ShapeFilter = cp.ShapeFilter{
cp.NO_GRO... |
package game
import (
"errors"
"fmt"
"main/src/types"
)
type Player struct {
Username string `json:"username"`
EventSource chan interface{} `json:"-"`
Nth int
}
type Game struct {
IsDone bool `json:"isDone" binding:"required"`
IsReady bool `json:"isReady" binding:"required"`
Winner string `json:"winner" bin... |
package main
import "fmt"
type Mapper interface {
LoadPrg(addr uint16) uint8
StorePrg(addr uint16, val uint8)
LoadChr(addr uint16) uint8
StoreChr(addr uint16, val uint8)
Mirroring() Mirroring
}
func NewMapper(rom *Rom) Mapper {
switch rom.Mapper() {
case 0:
return NewNrom(rom)
case 1:
return NewMmc1(rom)... |
// 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... |
package responsemanager
import (
"context"
"errors"
"strings"
"time"
"github.com/ipfs/go-peertaskqueue/peertask"
ipld "github.com/ipld/go-ipld-prime"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/ipfs/go-graphsync"
"github.com/ipfs/go-graphsync/ipldutil"
gsmsg "github.com/ipfs/go-graphsync/message"
... |
package helm
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/gofrs/flock"
"gopkg.in/yaml.v2"
"helm.sh/helm/v3/pkg/cli"
"helm.sh/helm/v3/pkg/getter"
"helm.sh/helm/v3/pkg/helmpath"
"helm.sh/helm/v3/pkg/repo"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
)
const (
E... |
package minecraft
import (
"fmt"
"golang.org/x/text/encoding/unicode"
"io"
"log"
"net"
"os"
)
type Server struct {
listener net.Listener
Motd string
KickMessage string
TooltipMessage string
VersionName string
MaxPlayerCount int
ConnectCallback func()
HostAddress string
P... |
package selenium
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"strings"
"github.com/TylerBrock/colorjson"
"github.com/fatih/color"
"github.com/pkg/errors"
"github.com/theRealAlpaca/go-selenium/logger"
"github.com/theRealAlpaca/go-selenium/types"
)
// Describes possible response status... |
package protocol
import (
"bytes"
"encoding/binary"
)
// EnchantmentOption represents a single option in the enchantment table for a single item.
type EnchantmentOption struct {
// Cost is the cost of the option. This is the amount of XP levels required to select this enchantment
// option.
Cost uint32
// Encha... |
package cmd
import (
"fmt"
"os"
"path"
"path/filepath"
"strings"
"github.com/maxlaverse/image-builder/pkg/builder"
"github.com/maxlaverse/image-builder/pkg/config"
"github.com/maxlaverse/image-builder/pkg/engine"
"github.com/maxlaverse/image-builder/pkg/executor"
"github.com/maxlaverse/image-builder/pkg/reg... |
package main
import (
"bytes"
"errors"
"io"
"log"
"os"
)
const (
byteNewLine = byte('\n')
byteTab = byte('\t')
)
func processSingleInput(b byte, state editorState) (editorState, error) {
switch b {
case ANSI.etx:
return state, errors.New("should exit")
case ANSI.vt:
return state.TrimLine(), nil
ca... |
package internal
import "fmt"
// An Exception is an Io exception.
type Exception struct {
Err error
Stack []*Message
}
// String returns the error message.
func (e Exception) String() string {
return e.Err.Error()
}
// Error returns the error message.
func (e Exception) Error() string {
return e.Err.Error()
}... |
package ethblocks
import (
"context"
"database/sql"
"errors"
"log"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
// BlockUncleIntf - interface
type BlockUncleIntf interface {
AddBlockUncle(ctx context.Context, tx *sql.Tx, blkuncle *types.Header, BlockID uint) (*BlockU... |
package controllers
import (
"context"
"fmt"
"sync"
"github.com/tyler-lloyd/wg-overlay/pkg/overlay"
"github.com/tyler-lloyd/wg-overlay/pkg/wireguard"
"k8s.io/apimachinery/pkg/api/errors"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
v1 "k8s.io/api/core/v1"
ctrl "sigs.k8s.... |
package main
/*
Day 14: Disk Defragmentation
*/
import (
"fmt"
"io/ioutil"
"strconv"
"strings"
)
func getChallenge() string {
filename := "./input"
b, err := ioutil.ReadFile(filename)
if err != nil {
panic(err)
}
return strings.TrimSpace(string(b))
}
func knotHashC() func([]byte) []int {
// populate ... |
package domain
import (
"crypto/rand"
"sort"
"sync"
"github.com/iotaledger/hive.go/logger"
"github.com/iotaledger/wasp/packages/peering"
"github.com/iotaledger/wasp/packages/util"
)
type DomainImpl struct {
netProvider peering.NetworkProvider
nodes map[string]peering.PeerSender
permutation *util.Permu... |
package anomalia
import (
"encoding/csv"
"encoding/json"
"os"
"strconv"
)
// TimeSeries wrapper for timestamps and their values
type TimeSeries struct {
Timestamps []float64
Values []float64
}
// NewTimeSeries creates a new time series data structure
func NewTimeSeries(timestamps []float64, values []float6... |
/*
* Copyright 2017-2018 <NAME>, Inc.
*
* This file is available under the Apache License, Version 2.0,
* with the Commons Clause restriction.
*/
package worker
import (
"golang.org/x/net/context"
"golang.org/x/net/trace"
"github.com/dgraph-io/dgo/protos/api"
"github.com/dgraph-io/dgraph/conn"
"github.com/... |
package sc
import (
"fmt"
"strconv"
"github.com/pkg/errors"
"github.com/scgolang/osc"
)
const (
gQueryTree = "/g_queryTree"
gQueryTreeReply = "/g_queryTree.reply"
)
// Node is a node in a synth execution tree.
// It could be a synth node or a group.
type Node interface {
Free() error
ID() int32
}
// S... |
/*
Package containing Token struct and TokenType info.
Tokens are the lingua-franca used between all the refmt packages.
Users typically do not refer to these types.
*/
package tok
import (
"bytes"
"fmt"
)
type Token struct {
// The type of token. Indicates which of the value fields has meaning,
// or has a s... |
// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2017 The go-ovh 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
/... |
package panel
import (
"strconv"
"github.com/jroimartin/gocui"
"github.com/skanehira/docui/common"
)
// TaskStatus define new type of task status.
type TaskStatus string
var (
// Success when task success.
Success TaskStatus = "Success"
// Executing when task running.
Executing TaskStatus = "Executing"
// E... |
// Copyright 2015 Comcast Cable Communications Management, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required b... |
// Copyright (c) 2017 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 2022 The Volcano 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, sof... |
package main
import (
"log"
"math/bits"
"reflect"
"unsafe"
)
type sample struct {
a int
b string
}
func main() {
sizeOfIntInBits := bits.UintSize
log.Printf("%d bits\n", sizeOfIntInBits)
var a int
log.Printf("%s is %d bytes, type is %s\n", "a", unsafe.Sizeof(a), reflect.TypeOf(a))
b := 2
log.Printf("%s... |
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"time"
"github.com/codecat/go-libs/log"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
func hasCommand(cmd string) bool {
for _, arg := range pflag.Args() {
if arg == cmd {
return true
}
}
return false
}
func main() {
// Configure lo... |
// Copyright © 2018 <NAME> <<EMAIL>>
//
// 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 service
import (
"fmt"
"io"
"net/url"
"strconv"
"strings"
"time"
"github.com/go-ocf/cloud/coap-gateway/coapconv"
pbCQRS "github.com/go-ocf/cloud/resource-aggregate/pb"
pbRA "github.com/go-ocf/cloud/resource-aggregate/pb"
pbRD "github.com/go-ocf/cloud/resource-directory/pb/resource-directory"
gocoap... |
// Transpose a matrix
// Based on code posted on sci.math.num-analysis by <NAME>
//
// https://groups.google.com/forum/?hl=en#!msg/sci.math.num-analysis/qbqu8eEbaZ0/xDCs-7MRAmgJ
// The functions here are for a very fast matrix transpose, needed
// for Bailey's four-step FFT. Some assumptions: the matrix must
// be sq... |
package quic
import (
"errors"
"sync"
"github.com/Vishista/mp-quic/congestion"
"github.com/Vishista/mp-quic/frames"
"github.com/Vishista/mp-quic/internal/utils"
"github.com/Vishista/mp-quic/protocol"
)
type Scheduler struct {
dataToSend []SchedulerSendData
controlFrames []frames.Fram... |
package wildcat
import "testing"
func parseUtil(str string) *Order {
order, _ := ParseOrder(str)
return order
}
func checkIndex(t *testing.T, orig, order *Order, index, wontValue int) {
if order.index != wontValue {
t.Errorf("%s.toSlice did not match, wont orders[%d] is %d, got %d", orig.String(), index, wontVa... |
package jenkins
import "time"
// JobResponse struct represent the response of the
// Jenkins api to get all the jobs
type JobResponse struct {
Jobs []struct {
Class string `json:"_class"`
Name string `json:"name"`
URL string `json:"url"`
Color string `json:"color,omitempty"`
} `json:"jobs"`
URL string... |
package pe
import (
"log"
"sync"
"time"
"github.com/gonum/matrix/mat64"
)
/*
physicsengine.go
by <NAME>
Package is geared towards processing physics based information. It's meant to be integrated with TSP for networking purposes.append
Ideally, this package is optimized for quick networking capabilities.
... |
package flower
import (
"net"
"strings"
"sync"
"time"
"github.com/hashicorp/yamux"
"go.uber.org/zap"
"github.com/damnever/sunflower/log"
"github.com/damnever/sunflower/msg"
"github.com/damnever/sunflower/msg/msgpb"
connutil "github.com/damnever/sunflower/pkg/conn"
"github.com/damnever/sunflower/pkg/retry"... |
package webapp
import (
"net/http"
"net/url"
"github.com/authgear/authgear-server/pkg/auth/handler/webapp/viewmodels"
"github.com/authgear/authgear-server/pkg/auth/webapp"
"github.com/authgear/authgear-server/pkg/lib/interaction"
"github.com/authgear/authgear-server/pkg/lib/interaction/intents"
"github.com/aut... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package kms
import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/hyperledger/aries-framework-go/pkg/crypto"
"github.com/hyperledg... |
package chain_events
import (
"context"
"strings"
"time"
wallet_errors "github.com/flow-hydraulics/flow-wallet-api/errors"
"github.com/flow-hydraulics/flow-wallet-api/flow_helpers"
"github.com/flow-hydraulics/flow-wallet-api/system"
"github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/client"
log ... |
// Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package app
import (
"bufio"
"encoding/json"
"fmt"
"io"
"github.com/mattermost/mattermost-server/model"
"github.com/pkg/errors"
)
const permissionsExportBatchSize = 100
const systemSchemeName = "000... |
package gochat
import (
"bufio"
"errors"
"fmt"
"net"
"strings"
)
// IRC client config type used during the connection process
type ClientCfg struct {
Network string
Nick string
}
// IRC client type with in/out data channels
type Client struct {
Config ClientCfg
Channels map[string]*Channel
In ch... |
// This package provides immutable UUID structs and the functions
// NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4
// and 5 UUIDs as specified in RFC 4122.
//
// Copyright (C) 2011 by <NAME> <<EMAIL>>
package uuid
import (
"crypto/md5"
"crypto/rand"
"crypto/sha1"
"encoding/hex"
"errors"
"fmt"
"ha... |
package goinsta
import (
"fmt"
"github.com/alok87/goutils/pkg/random"
"strings"
)
const (
UserLocale = "en_US"
AppVersion = "27.0.0.7.97"
UserAgentFormat = "Instagram %s Android (%s/%s; %s; %s; %s; %s; %s; %s; %s)"
UserAgentFormatIos = "Instagram %s %s"
)
var iosDevices = []string {
"(iPhone7,1; iOS 10_2; ... |
// Copyright 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package search
import (
"crypto/rand"
"encoding/json"
"fmt"
"strings"
"github.com/ghodss/yaml"
ctlconf "github.com/k14s/kbld/pkg/kbld/config"
ctlres "github.com/k14s/kbld/pkg/kbld/resources"
)
type ImageRefs struct {
res interface... |
package rfc8009
import (
"crypto/hmac"
"encoding/binary"
"encoding/hex"
"errors"
"github.com/ns1/gokrb5/v8/crypto/etype"
"github.com/ns1/gokrb5/v8/iana/etypeID"
"golang.org/x/crypto/pbkdf2"
)
const (
s2kParamsZero = 32768
)
// DeriveRandom for key derivation as defined in RFC 8009
func DeriveRandom(protocol... |
package restserver
/*
Original version copied from: github.com/bitly/oauth2_proxy
MIT License
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 th... |
/*
Copyright 2019 The Vitess 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 tasks
import (
"fmt"
"github.com/alexkreidler/wiz/utils"
"github.com/alexkreidler/wiz/utils/gutils"
"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/simple"
"gonum.org/v1/gonum/graph/traverse"
"log"
)
type TaskGraph interface {
graph.DirectedBuilder
}
// Pipeline represents one Wiz Tasks Framewor... |
package main
import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"github.com/gobuffalo/pop"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"go.uber.org/zap"
"github.com/transcom/mymove/pkg/cli"
"github.com/transcom/mym... |
// unify-labels is a CLI which will add, rename, or change the color of labels so they match the Jekyll org's requirements.
package main
import (
"flag"
"fmt"
"log"
"strings"
"github.com/google/go-github/github"
"github.com/parkr/auto-reply/ctx"
"github.com/parkr/auto-reply/freeze"
"github.com/parkr/auto-repl... |
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package create
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/konfig"
"sigs.k8s.io/kustomize/api/loader"
"s... |
// 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 a... |
/**
* Copyright 2019 gd Author. All rights reserved.
* Author: Chuck1024
*/
package dhttp
import (
"encoding/json"
"errors"
"fmt"
"github.com/chuck1024/gd/dlog"
"github.com/gin-gonic/gin"
"io/ioutil"
"net/http"
"reflect"
)
var ptrToGinCtx = reflect.PtrTo(reflect.TypeOf((*gin.Context)(nil))).Kind()
var err... |
/* Day 3: Binary Diagnostic */
package main
import (
"AoC2021/utils/timer"
"bufio"
"fmt"
"io"
"os"
"strconv"
)
const BITLENGTH = 12
func check(e error) {
if e != nil {
fmt.Println("Oh snap!")
panic(e)
}
}
func main() {
fmt.Println("--- Day 3: Binary Diagnostic ---")
timer.Start()
part1()
timer.Tick(... |
// Copyright 2017 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... |
// +build windows
package agent
import (
"os"
"path/filepath"
"strings"
"time"
"github.com/Microsoft/hcsshim"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/util"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/kubernetes/pkg/kubeapiserver/authorizer/modes"
... |
// Copyright 2020 FastWeGo
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wr... |
package syslog
// Copyright (c) 2013 <NAME>, Papertrail, Inc., & <NAME>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to... |
package job
/*
Copyright 2020 - 2021 Crunchy Data Solutions, 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 ag... |
// Copyright 2019 The Vearch 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 server
import (
"context"
"fmt"
"github.com/bytepowered/flux/flux-node"
"github.com/bytepowered/flux/flux-node/ext"
"github.com/bytepowered/flux/flux-node/logger"
"github.com/prometheus/client_golang/prometheus"
"reflect"
"sort"
"time"
)
type Dispatcher struct {
metrics *Metrics
hooks []flux.Prep... |
// Copyright 2018 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... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package guardduty
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type GetFilterInput struct {
_ struct{} `type:"structure"`
// The uniq... |
// Code generated by go-swagger; DO NOT EDIT.
package public
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/g... |
package component
import (
"fmt"
"path/filepath"
servicebinding "github.com/redhat-developer/service-binding-operator/apis/binding/v1alpha1"
"github.com/spf13/cobra"
"github.com/openshift/odo/pkg/component"
appCmd "github.com/openshift/odo/pkg/odo/cli/application"
projectCmd "github.com/openshift/odo/pkg/odo/... |
/*
Copyright 2021 The Fission 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, sof... |
package graphs
import (
"image"
"image/color"
"math"
"github.com/fogleman/gg"
"github.com/veandco/go-sdl2/sdl"
"github.com/wdevore/Deuron5/deuron"
"github.com/wdevore/Deuron5/deuron/app/gui"
)
// A test graph for plotting exponentials to see how they shape
type ExpoGraph struct {
BaseGraph
gui.BaseWidget
... |
// Code generated by go-swagger; DO NOT EDIT.
package dynatrace
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"bytes"
"encoding/json"
"io"
"io/ioutil"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
... |
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package binding
import (
"fmt"
"github.com/spf13/cobra"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/client/pkg/... |
// Copyright 2017 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 applicabl... |
/*
Copyright 2016-2017 Mirantis
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
d... |
package stager
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"code.cloudfoundry.org/bbs/models"
"code.cloudfoundry.org/eirini"
"code.cloudfoundry.org/eirini/opi"
"code.cloudfoundry.org/lager"
"code.cloudfoundry.org/runtimeschema/cc_messages"
)
const (
Image = "eirini/recipe"
DefaultTag = "latest"... |
// Copyright (c) 2019 IoTeX Foundation
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use... |
package genReports
import (
"bytes"
"errors"
"grafanareports/gfClient"
"io"
"io/ioutil"
"net/url"
"os"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
const dashJSON = `
{"Dashboard":
{
"Title":"My first dashboard",
"Rows":
[{"Panels":
[{"Type":"singlestat", "Id":1},
{"Type":"graph", ... |
// Package aws generates Machine objects for aws.
package aws
import (
"fmt"
machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/s... |
package main
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"github.com/agradl/golang-exercise/testutil"
)
func TestHandlerWrapperHelperChecksShutdownState(t *testing.T) {
registrar := &mockRegistrar{}
state := &mockState{isShutdownReturn: true}
makeHandlerWithState(regis... |
package coin
import (
"errors"
"github.com/MinterTeam/minter-explorer-extender/address"
"github.com/MinterTeam/minter-explorer-tools/helpers"
"github.com/MinterTeam/minter-explorer-tools/models"
"github.com/MinterTeam/minter-node-go-api"
"github.com/MinterTeam/minter-node-go-api/responses"
"github.com/sirupsen/... |
package hbase
//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 migration_test
import (
"bufio"
"bytes"
"database/sql"
"fmt"
"html/template"
logger "log"
"testing"
config "github.com/fabric8-services/fabric8-cluster/configuration"
"github.com/fabric8-services/fabric8-cluster/migration"
"github.com/fabric8-services/fabric8-cluster/resource"
"github.com/fabric8-s... |
// Copyright 2021 Matrix Origin
//
// 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 ... |
package balancer
import (
"fmt"
log "github.com/Sirupsen/logrus"
"net"
"sync"
"github.com/weaveworks/flux/balancer/events"
"github.com/weaveworks/flux/balancer/forwarder"
"github.com/weaveworks/flux/balancer/model"
"github.com/weaveworks/flux/common/daemon"
)
type servicesConfig struct {
netConfig netConfig... |
// generated code; DO NOT EDIT"
//
// Client for Choria RPC Agent 'choria_provision' Version 0.22.0 generated using Choria version 0.22.0
package choria_provisionclient
import (
"context"
"encoding/json"
"fmt"
"io"
"sync"
"github.com/choria-io/go-choria/protocol"
rpcclient "github.com/choria-io/go-choria/prov... |
// Package discovery implements uses bitcoin-based addrbook to store network addresses and collects
// them by crawling the network using a simple protocol.
package discovery
import (
"context"
"errors"
"github.com/spacemeshos/go-spacemesh/log"
"github.com/spacemeshos/go-spacemesh/p2p/config"
"github.com/spaceme... |
package entity
import (
"fmt"
"time"
"github.com/gosimple/slug"
"github.com/jinzhu/gorm"
"github.com/photoprism/photoprism/pkg/rnd"
"github.com/photoprism/photoprism/pkg/txt"
)
type Links []Link
// Link represents a sharing link.
type Link struct {
LinkUID string `gorm:"type:varbinary(42);primary_key... |
package mtproto
import (
"fmt"
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"golang.org/x/xerrors"
"github.com/gotd/neo"
"github.com/gotd/td/bin"
"github.com/gotd/td/internal/mt"
"github.com/gotd/td/internal/rpc"
"github.com/gotd/td/internal/tdsync"
"git... |
package tosca_v2_0
import (
"reflect"
"github.com/tliron/kutil/ard"
"github.com/tliron/puccini/tosca"
"github.com/tliron/puccini/tosca/normal"
)
type HasComparer interface {
SetComparer(comparer string)
}
//
// DataType
//
// [TOSCA-v2.0] @ ?
// [TOSCA-Simple-Profile-YAML-v1.3] @ 3.7.6
// [TOSCA-Simple-Profile... |
package cmds
import (
"encoding/json"
"errors"
"io"
"reflect"
"sync"
"gx/ipfs/QmR77mMvvh8mJBBWQmBfQBu8oD38NUN4KE9SL2gDgAQNc6/go-ipfs-cmds/debug"
"gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
)
func NewWriterResponseEmitter(w io.WriteCloser, req *Request) (ResponseEmitter, error) {
_... |
package true_git
import (
"archive/tar"
"fmt"
"io"
"log"
"os"
"path/filepath"
"runtime"
"runtime/pprof"
"strings"
"github.com/flant/logboek"
uuid "github.com/satori/go.uuid"
)
type ArchiveOptions struct {
Commit string
PathFilter PathFilter
}
type ArchiveDescriptor struct {
Type ArchiveType
Is... |
// Copyright (c) 2014 <NAME>
package server
import (
"crypto/tls"
"net"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/mirango/framework"
"golang.org/x/net/netutil"
)
type Server struct {
*http.Server
Timeout time.Duration
ListenLimit int
ConnState func(net.Con... |
package logrus
import (
"io"
"os"
"github.com/gaofubao/go-webcrawler/log/base"
"github.com/gaofubao/go-webcrawler/log/field"
"github.com/sirupsen/logrus"
)
// loggerLogrus 代表基于logrus的日志记录器的类型。
type loggerLogrus struct {
// level 代表日志级别。
level base.LogLevel
// format 代表日志格式。
format base.LogFormat
// optWit... |
package cdn
import (
"context"
"crypto/md5"
"path"
"strconv"
"github.com/dragonflyoss/Dragonfly/apis/types"
cutil "github.com/dragonflyoss/Dragonfly/common/util"
"github.com/dragonflyoss/Dragonfly/supernode/config"
"github.com/dragonflyoss/Dragonfly/supernode/daemon/mgr"
"github.com/dragonflyoss/Dragonfly/su... |
package report
import (
"crypto/x509"
"encoding/json"
"github.com/s-rah/onionscan/utils"
"io/ioutil"
"time"
)
type ExifTag struct {
Name string `json:"name"`
Value string `json:"value"`
}
type ExifImage struct {
Location string `json:"location"`
ExifTags []ExifTag `json:"exifTags"`
}
type PGPKey struct... |
package zenkit
import (
"context"
"strings"
"github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/pkg/errors"
"google.golang.org/grpc"
"gopkg.in/square/go-jose.v2/jwt"
)
type key int
const (
identityKey key = iota + 1
)
var (
ErrorNoSubject = errors.New("no subject present on token")
ErrorNoScopes... |
package conveyearthgo
import (
"aletheiaware.com/authgo"
authemail "aletheiaware.com/authgo/email"
"fmt"
"html/template"
"log"
)
type NotificationDatabase interface {
SelectNotificationPreferences(int64) (int64, bool, bool, bool, bool, error)
UpdateNotificationPreferences(int64, int64, bool, bool, bool, bool) ... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package cloudformation provides functionality to deploy ECS resources with AWS CloudFormation.
package cloudformation
import (
"context"
"errors"
"fmt"
"strings"
"github.com/aws/aws-sdk-go/aws"
awscf... |
package balancer
import (
"context"
"os"
"sync"
pb "github.com/bazelbuild/remote-apis-sdks/go/pkg/balancer/proto"
"github.com/golang/protobuf/jsonpb"
"google.golang.org/grpc"
)
const (
// Default max number of connections is 0, meaning "no limit"
defaultMaxConn = 0
// Default max stream watermark is 100, w... |
/********************************
*** Multiplexer for Go ***
*** Bone is under MIT license ***
*** Code by CodingFerret ***
*** github.com/go-zoo ***
*********************************/
package bone
import (
"net/http"
"net/url"
"regexp"
"strings"
)
const (
//PARAM value store in Atts if the ... |
package main
import (
"bufio"
"compress/gzip"
"encoding/json"
"flag"
"fmt"
"log"
"os"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/buger/jsonparser"
)
type Record struct {
Key string
Value []byte
}
type Backend interface {
Put(records []Record) error
Search(prefix string) ([]Record, error)
C... |
// 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 rule
import (
"errors"
"fmt"
"regexp"
"strconv"
"strings"
"reflect"
"github.com/go-ozzo/ozzo-validation"
"github.com/hyperledger/burrow/acm"
"github.com/hyperledger/burrow/crypto"
"github.com/hyperledger/burrow/permission"
)
var PlaceholderRegex = regexp.MustCompile(`\$(?P<bracket>{?)(?P<job>[[:w... |
// Package pdag allows to define a DAG of processing fuctions.
//
// The processing can be triggered at any node of the graph
// and will follow the directed edges of the graph. Before
// a function in a node is executed all its parents
// have to finish execution. Thus the graph defines the order
// in which the funct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.