text stringlengths 3.08k 10.4k |
|---|
package thuder
import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"time"
)
//Node is a node to be modified in the file system, such as files, folders, and
//deletes
type Node struct {
fc *FileContext //allow sharing for node with same context
info os.FileInfo //basic data read from the file system
}
... |
package collector
import (
"github.com/prometheus/client_golang/prometheus"
"sync"
"github.com/hpcloud/tail"
"fmt"
"strings"
"net/http"
"io/ioutil"
"github.com/prometheus/common/log"
"encoding/json"
"bytes"
"encoding/gob"
"os"
)
type logMonitorCollector struct {
logMonitor *prometheus.Desc
}
const (
l... |
package common
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
bumper "github.com/giantswarm/semver-bump/bump"
"github.com/giantswarm/semver-bump/storage"
yaml "gopkg.in/yaml.v2"
)
var (
Validfn = [...]string{
"func.yaml",
"func.yml",
"func.json",
}
errU... |
// The MIT License
//
// Copyright (c) 2019-2020, Cloudflare, Inc. and Apple, Inc. All rights reserved.
//
// 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 wi... |
package main
import (
"encoding/json"
"errors"
"log"
"net/http"
"time"
"github.com/gorilla/websocket"
)
const (
pongWait = 30 * time.Second
pingPeriod = (pongWait * 9) / 10
)
var clients clientSlice
type client struct {
conn *websocket.Conn
send chan []byte
}
type clientSlice []client
func setupRoute... |
package appcenter
import (
"context"
"github.com/elko-dev/spawn/appcenter/accounts"
"github.com/elko-dev/spawn/appcenter/apps"
"github.com/elko-dev/spawn/appcenter/builds"
"github.com/elko-dev/spawn/appcenter/organization"
"github.com/elko-dev/spawn/constants"
log "github.com/sirupsen/logrus"
)
const (
andr... |
package osmanthuswine
import (
"errors"
"fmt"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/wailovet/osmanthuswine/src/core"
"github.com/wailovet/osmanthuswine/src/helper"
"github.com/wailovet/osmanthuswine/src/session"
"github.com/wailovet/overseer"
"github.com/wailovet/overseer/fetc... |
package ldvalue
import (
"encoding/json"
"errors"
"strconv"
"gopkg.in/launchdarkly/go-sdk-common.v2/jsonstream"
)
// This file contains methods for converting Value to and from JSON.
// Parse returns a Value parsed from a JSON string, or Null if it cannot be parsed.
//
// This is simply a shortcut for calling j... |
package tls
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
"io"
"net"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestSerialNumber(t *testing.T) {
n1, err := GenerateSerialNumber()
require.Nil(t, err)
n2, err := Gene... |
package parser
import (
"encoding/json"
"fmt"
"io/ioutil"
"regexp"
"strings"
)
// FontWidthsConfig holds the pixel widths of characters in various game fonts.
type FontWidthsConfig struct {
Fonts map[string]map[string]int `json:"fonts"`
DefaultFontID string `json:"defaultFontId"`
}
... |
package main
import (
"bufio"
"context"
"fmt"
"io"
"net/http"
"path"
"regexp"
"strings"
"time"
)
type RuianFileContents int
const (
ContentBasic RuianFileContents = iota
ContentCompleteWithDescriptionAndGeneralizedBorders
ContentCompleteWithDescriptionAndOriginalBorders
ContentImages
ExtentCity = "OB... |
package incoming
import (
"encoding/json"
"fmt"
"log"
"regexp"
"strings"
"time"
)
//collectdGenericIndex value represents ElasticSearch index name for data from which it
// is not possible to clearly construct indexs name
const collectdGenericIndex = "collectd_generic"
var (
rexForInvalidVesStr = regexp.Mus... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package amplify
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/amplify/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/sm... |
package evtc
import (
"encoding/json"
"strconv"
"strings"
)
type agent struct {
Addr uint64
Prof uint32
IsElite uint32
Toughness uint16
Concentration uint16
Healing uint16
HitboxWidth uint16
Condition uint16
HitboxHeight uint16
Name [64]byte
Padding ... |
// 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 iw
import (
"bufio"
"context"
"io"
"math"
"regexp"
"strconv"
"strings"
"time"
"chromiumos/tast/dut"
"chromiumos/tast/errors"
"chro... |
package main
import (
"strconv"
"sync"
"time"
"github.com/sirupsen/logrus"
"github.com/prometheus/client_golang/prometheus"
)
//METRICS
var retentionTasksCounter = prometheus.NewCounter(prometheus.CounterOpts{
Name: "schelly_retention_tasks_total",
Help: "Total retention tasks triggered",
})
var retentionBac... |
// Copyright 2018-2019 CERN
//
// 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 sqlgen
import (
"fmt"
"go/types"
"strings"
"text/template"
"github.com/ng-vu/sqlgen/gen/strs"
)
var funcs = template.FuncMap{
"join": fnJoin,
"go": fnGo,
"quote": fnQuote,
"nonzero": fnNonZero,
"updateArg": fnUpdateArg,
"plural": fnPlural,
"toTitle": fnToTitle,
"typeName":... |
package main
import (
"math"
"github.com/go-gl/gl/v2.1/gl"
)
const (
// gridMargin controls the distance between grid points.
gridMargin = 30
// gridDestructionForce controls the amount of ripple created from entity
// destruction.
gridDestructionForce = 50
// gridMoveForce controls the amount of ripple crea... |
package pagerduty
/*
* Copyright 2016-2017 Netflix, 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 ap... |
package main
import (
"flag"
"fmt"
"github.com/gokyle/filecache"
"log"
"net/http"
"os"
"os/user"
"path/filepath"
"regexp"
"strconv"
"syscall"
"time"
)
const VERSION = "3.0.1"
var handler func(http.ResponseWriter, *http.Request)
var (
cache *filecache.FileCache
path_regexp = regexp.MustCompile(... |
// Copyright 2021 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 mtp implements the fixture for setting up the connected android device.
package mtp
import (
"context"
"io/ioutil"
"os"
"path/filepath"... |
//go:build darwin && go1.13 && !appengine
// +build darwin,go1.13,!appengine
package fastwalk
import (
"io/fs"
"os"
"sync"
"syscall"
"unsafe"
)
//sys closedir(dir uintptr) (err error)
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
func readDir(dirName string, fn func(dirName, entName ... |
package currency
type Currency string
var (
AFN Currency = "AFN"
ARS Currency = "ARS"
AWG Currency = "AWG"
AUD Currency = "AUG"
AZN Currency = "AZN"
BSD Currency = "BSD"
BBD Currency = "BDD"
BYN Currency = "BYN"
BZD Currency = "BZD"
BMD Currency = "BMD"
BOB Currency = "BOB"
BAM Currency = "BAM"
BWP Curre... |
package main
import (
"fmt"
"io"
"os"
"os/signal"
"os/user"
"strings"
"hilbish/golibs/bait"
"github.com/akamensky/argparse"
"github.com/bobappleyard/readline"
"github.com/yuin/gopher-lua"
"golang.org/x/term"
)
const version = "0.4.0-dev.3"
var (
l *lua.LState
// User's prompt, this will get set when ... |
package task
import (
"fmt"
"go.uber.org/zap"
"strings"
"teamide/pkg/data_engine"
"teamide/pkg/db"
"teamide/pkg/util"
"time"
)
var (
ImportTaskCache = map[string]*ImportTask{}
)
func StartImportTask(task *ImportTask) {
ImportTaskCache[task.Key] = task
go task.Start()
}
func GetImportTask(taskKey string) *... |
// *** 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 iap
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// > This content is derived from https://github.com/ter... |
// Copyright 2022-present PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... |
package log4go
import (
"os"
"fmt"
"strings"
"regexp"
"strconv"
"time"
)
type FileWriter struct {
rec chan *Record
rot chan bool
filename string
file *os.File
maxSize int64 //文件允许最大大小 单位:bytes
currentSize int64 //文件当前大小 单位:bytes
date bool
openDate string
dateFormat string
forma... |
// 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 trie
import (
// "fmt"
"github.com/k0kubun/pp"
"github.com/arccoza/go-trie/generic"
)
type Item = generic.Type
type ItemTrie struct{
root node
}
type node struct {
prefix []byte
hmask byte
tmask byte
leaf bool
value Item
MergeOp func(Item, Item) Item
edges edges
}
type edges []*node
func NewIte... |
package jobsd
import (
"database/sql"
"time"
"github.com/pkg/errors"
"github.com/simpleframeworks/logc"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
// Run is a database representation of a job run
type Run struct {
ID int64 `gorm:"primaryKey"`
OriginID ... |
package instruction
import (
"errors"
"fmt"
"log"
"reflect"
"strconv"
"strings"
"github.com/incognitochain/incognito-chain/common"
"github.com/incognitochain/incognito-chain/incognitokey"
)
//ReturnStakeInstruction :
// format: "return", "key1,key2,key3", "1231231,312312321,12312321", "100,100,100,100"
type ... |
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/binary"
"encoding/hex"
// "errors"
"io"
)
const AES_LEN = 32
const SeedLen = 4
// 96 bytes
type KeyMsg struct {
K1 [AES_LEN]byte
V1 [aes.BlockSize]byte
K2 [AES_LEN]byte
V2 [aes.BlockSize]byte
}
// 48 byte... |
package main
import (
"fmt"
// "io/ioutil"
"net"
// "net/http"
"os"
// "os/exec"
"path"
// "regexp"
// "strconv"
"syscall"
"time"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1"
)
const (
resourceName ... |
package configmap
import (
"reflect"
"sort"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/cache"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/errors"
apiexts "k8s.io/apiextensions-apiserver/pkg/client/clientset/clien... |
// Copyright 2020 <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 ... |
// Copyright 2020 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 ... |
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/andefined/anaconda"
"github.com/urfave/cli"
)
// Project : Project Struct
type Project struct {
ConsumerKey string
ConsumerSecret string
AccessToken string
AccessTokenSecret strin... |
// Copyright 2018-2021 <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 ... |
package xtime
import (
"bytes"
"database/sql/driver"
"encoding/json"
"ksitigarbha/timezone"
"time"
)
// Date 总是代表对应日期的 0 点
type Date struct{ time.Time }
func (date Date) format() string {
return date.Time.Format(ISO8601Date)
}
// AddDate adds any number of years, months, and days to the date.
// It proxies to... |
package manifest
import (
"fmt"
"time"
"github.com/euforia/thrap/thrapb"
"github.com/hashicorp/nomad/api"
)
const (
defaultPriority = 50
defaultRegion = "us-west-2"
defaultGroupCount = 1
defaultNetMbits = 1
defaultCPUMHz = 200 //mhz
defaultMemMB = 256 //mb
defaultPortLab... |
package devspace
import (
"../../../config"
"../../../env"
"../../../errors"
"../../../exec"
"../../../filesystem"
"../../../io"
"../../../logging"
"../../../projects"
"../../../readers/yaml"
"../../../runtime"
"../../../vars"
"./templates"
)
type F struct{}
var context string = env.F.GetContext(env.F{},... |
/*
* umoci: Umoci Modifies Open Containers' Images
* Copyright (C) 2016, 2017, 2018 SUSE LLC.
* Copyright (C) 2018 Cisco
*
* 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:/... |
package models
import (
"adexchange/lib"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
)
func GetMatrixData() (adspaceMap map[string]AdspaceData, adspaceDemandMap map[string][]string, err error) {
o := orm.NewOrm()
sql := "select matrix.priority,matrix.pmp_adspace_id, adspace.pmp_adspace_key, matrix... |
// Copyright 2021 VMware, Inc.
// SPDX-License-Identifier: MIT
package e2e
import (
"fmt"
"strings"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
"github.com/vmware-tanzu-labs/operator-builder/internal/utils"
workloadv1 "github.com/vmware-tanzu-labs/operator-builde... |
package modal
import (
"errors"
"fmt"
"time"
reqLim "github.com/Bit-Nation/panthalassa/dapp/request_limitation"
validator "github.com/Bit-Nation/panthalassa/dapp/validator"
log "github.com/ipfs/go-log"
logger "github.com/op/go-logging"
otto "github.com/robertkrimen/otto"
uuid "github.com/satori/go.uuid"
ed2... |
package handler
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"net/http"
"github.com/cruisechang/dbex"
)
//NewRoomsHandler returns RoomsHandler structure
func NewRoomsHandler(base baseHandler) *RoomsHandler {
return &RoomsHandler{
baseHandler: base,
}
}
//RoomsHandler does select and insert
type ... |
package visual1
import (
"context"
"fmt"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
"github.com/hajimehoshi/ebiten/v2/inpututil"
"golang.org/x/exp/rand"
"image"
"image/color"
"log"
"os"
"sync/atomic"
"time"
)
var (
logInfo = log.New(os.Stdout, "INFO ", log.LstdFlags)... |
package zkregistry
import (
"encoding/json"
"errors"
"fmt"
stdLog "log"
"os"
"strings"
"sync"
"time"
"github.com/agrarianlabs/zkwatcher"
"github.com/samuel/go-zookeeper/zk"
)
// ZKRegistry is an implementation of the registry with Zookeeper.
type ZKRegistry struct {
// Underlying ZK connection.
conn *z... |
package utils
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
uuid2 "github.com/google/uuid"
"log"
"net/http"
"os"
"regexp"
"strconv"
"strings"
"time"
)
func SendError(c *gin.Context, msg string) {
LogError(msg)
c.JSON(http.StatusBadRe... |
package wowlua
import (
"errors"
"strings"
)
var (
// ErrNotFound indicates the requested node wasn't found
ErrNotFound = errors.New("Node not found")
// ErrNotTable indicates the node wasn't a table
ErrNotTable = errors.New("Node not a table")
// ErrWrongType indicates that the node was the wrong type
ErrWro... |
package pearl
import (
"encoding/binary"
"errors"
"net"
"github.com/mmcloughlin/pearl/buf"
"github.com/mmcloughlin/pearl/torcrypto"
)
// Reference: https://github.com/torproject/torspec/blob/0fd44031bfd6c6c822bfb194e54a05118c9625e2/tor-spec.txt#L969-L973
//
// The relay payload for an EXTEND relay cell consi... |
// Copyright (c) 2015 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, ... |
// Package paginator provides a simple abstracting for handling pagination
// requests and offset/limit generation for HTTP requests. The most common
// usecase is arbitrary queries that need to be paginated with query params
// coming in from a UI, for instance, /things/all?page=2&per_page=5. paginator
// can parse an... |
package main
import (
"io/ioutil"
"net/http"
"os"
"sync"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/goccy/go-yaml"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/promlog"
"github.com/pro... |
// sips ref
// https://github.com/marv2097/siprocket/blob/master/sipFrom.go
// https://github.com/marv2097/siprocket/blob/master/sipTo.go
// https://github.com/marv2097/siprocket/blob/master/sipContact.go
package sips
import (
"bytes"
"strconv"
"strings"
)
// SIPUser a single line that is in the format of a from o... |
/*
Copyright 2016 <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 to i... |
package gnap
import (
"bytes"
"context"
"encoding/json"
"sort"
"strconv"
"github.com/lestrrat-go/iter/mapiter"
"github.com/pkg/errors"
)
type RequestContinuation struct {
accessToken *AccessToken
uri *string
wait *int64
extraFields map[string]interface{}
}
func NewRequestContinuation(acces... |
/*
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 server
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"runtime/debug"
"sync"
"time"
"github.com/dave/jsgo/server/servermsg"
"github.com/dave/services"
"github.com/dave/services/tracker"
"github.com/gorilla/websocket"
)
type SocketHandlerInterface interface {
Handle(ctx context.Context, req *... |
package main
import (
"context"
"fmt"
"time"
cli "gopkg.in/urfave/cli.v2"
"github.com/johnwyles/vrddt-droplets/domain"
"github.com/johnwyles/vrddt-droplets/interfaces/config"
"github.com/johnwyles/vrddt-droplets/pkg/errors"
"github.com/johnwyles/vrddt-droplets/usecases/redditvideos"
"github.com/johnwyles/vr... |
package client
// this file contains the basic set of event handlers
// to manage tracking an irc connection etc.
import (
"errors"
"fmt"
"strings"
"time"
"github.com/lfkeitel/goirc/logging"
)
// sets up the internal event handlers to do essential IRC protocol things
var intHandlers = map[string]HandlerFunc{
... |
package main
// +--------------+
// | Dependencies |
// +--------------+
import (
"os"
"fmt"
"bufio"
"strings"
"strconv"
"math/rand"
"time"
"github.com/EthanThatOneKid/garden/static"
. "github.com/EthanThatOneKid/garden/plant"
. "github.com/EthanThatOneKid/garden/user"
)
// +---------+
// | Globa... |
package lager
import(
"context"
"fmt"
)
type skipThisPair string
var SkipThisPair = skipThisPair("")
// Storage for an ordered list of key/value pairs (without duplicate keys).
type KVPairs struct {
keys []string
vals []interface{}
}
// A list type that we efficiently convert to JSON.
type AList = []int... |
package flycheck
import (
"errors"
"fmt"
"io/ioutil"
"math"
"runtime"
"strconv"
"syscall"
"time"
"github.com/fly-examples/postgres-ha/pkg/check"
chk "github.com/fly-examples/postgres-ha/pkg/check"
)
// CheckVM for system / disk checks
func CheckVM(checks *chk.CheckSuite) *chk.CheckSuite {
checks.AddCheck... |
package bump
import (
"bytes"
"errors"
"fmt"
"log"
"regexp"
"strings"
"github.com/sourcegraph/go-diff/diff"
"k8s.io/apimachinery/pkg/util/version"
)
func IsBumpPatch(patch []byte) (bool, error) {
fileDiffs, err := diff.ParseMultiFileDiff(patch)
if err != nil {
return false, err
}
var validFiles int
f... |
package dajarep
import (
"regexp"
"strings"
ipa "github.com/ikawaha/kagome-dict/ipa"
"github.com/ikawaha/kagome/v2/tokenizer"
)
//単語
type word struct {
str string
kana string
wtype string
}
//文章
type sentence struct {
str string
kana string
yomi string
words []word
}
//Dajarep :駄洒落を返す
func Dajare... |
package internal
import (
"fmt"
"go/ast"
"go/token"
"io"
"reflect"
"strings"
)
type (
FieldType int8
VariableType int8
Field struct {
Name string
Short string
VariableType VariableType
Type FieldType
Default string
}
Fields []*Field
Command struct {
Packa... |
package client
import (
"fmt"
"io"
"log"
"net"
"net/http"
"net/http/httputil"
"strconv"
"sync"
"time"
"github.com/getlantern/balancer"
"github.com/getlantern/flashlight/util"
)
const (
cloudConfigPollInterval = time.Second * 60
httpConnectMethod = "CONNECT"
httpXFlashlightQOS = "X-Flashlight... |
package engine
import (
"io"
"time"
log "github.com/sirupsen/logrus"
"github.com/storozhukBM/verifier"
)
// TODO this probably needs a new name
type Job struct {
Id int
Name string
ScenarioId int
Method string
Url string
ReqBody ... |
package model
import (
"context"
authModel "github.com/ViBiOh/auth/v2/pkg/model"
"github.com/ViBiOh/ketchup/pkg/semver"
mailerModel "github.com/ViBiOh/mailer/pkg/model"
)
// Mailer interface client
//go:generate mockgen -destination ../mocks/mailer.go -mock_names Mailer=Mailer -package mocks github.com/ViBiOh/ke... |
package ec2
import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/cloudquery/cloudquery/providers/common"
"github.com/mitchellh/mapstructure"
"go.uber.org/zap"
"gorm.io/gorm"
)
type Image struct {
ID uint `gorm:"primarykey"`
AccountID string
Region string
Archit... |
package siv
import (
"crypto/aes"
"crypto/cipher"
"crypto/subtle"
"errors"
"github.com/luc-lynx/siv/cmac"
"github.com/luc-lynx/siv/common"
)
/*
Implementation of Deterministic AES-SIV defined in https://tools.ietf.org/html/rfc5297
AES is used in CTR mode
S2V uses AES-CMAC mode
AAD is only authenticated and not ... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"regexp"
"runtime"
"strings"
"time"
"github.com/ChimeraCoder/anaconda"
)
const CHECK_TIMER = 30 * time.Second
const CONTAINER_TIMER = 10 * time.Second
const TWEET_TIMER = 10 * time.Second
type sbox struct {
twitter *Twitter
contain... |
package externalpolicy
import (
"fmt"
"github.com/open-horizon/anax/externalpolicy/plugin_registry"
"strings"
)
// This type implements all the ConstraintLanguage Plugin methods and delegates to plugin system.
type ConstraintExpression []string
func (c *ConstraintExpression) Validate() ([]string, error) {
return... |
package deployments
import (
"fmt"
"strconv"
"sync"
"github.com/cloudfoundry/bosh-cli/director"
"github.com/prometheus/common/log"
"github.com/bosh-prometheus/bosh_exporter/filters"
)
type Fetcher struct {
deploymentsFilter filters.DeploymentsFilter
}
func NewFetcher(deploymentsFilter filters.DeploymentsFil... |
package main
import (
"bytes"
"os/exec"
"path/filepath"
"strings"
)
var supportedLanguage = []string{
"bash",
"c",
"cpp",
"go",
"haskell",
"java",
"perl",
"php",
"python",
"scala",
"ruby",
"rust",
}
func goRun(workDir, stdin string, args ...string) (string, string, error) {
var stdout bytes.Buffer
... |
package main
import (
"context"
"fmt"
"log"
"math/rand"
"os"
"os/signal"
"time"
influxdb "github.com/influxdata/influxdb-client-go/v2"
)
type service struct {
Writer Writer
Mock Mock
}
func main() {
log.SetOutput(os.Stdout)
s := service{}
s.Writer = NewWriter()
s.Mock = NewMock()
err := s.Writer.... |
package template
import (
"bytes"
"github.com/golang/glog"
"github.com/qorio/maestro/pkg/registry"
"github.com/qorio/maestro/pkg/zk"
"io/ioutil"
"os"
"path/filepath"
"strings"
"text/template"
)
func ApplyTemplate(body string, context interface{}, funcs ...template.FuncMap) (string, error) {
content, err := ... |
package main
import (
"strconv"
"io/ioutil"
"fmt"
"strings"
"bytes"
)
type deviceRule struct {
deviceType string
majorType int
minorType int
read bool
write bool
mknod bool
}
func (rule *deviceRule) String() string {
var major, minor string
if rule.majorType >= 0 {
major = strconv.Itoa(rule.majorType... |
/*
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... |
/* Apache v2 license
* Copyright (C) <2019> Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
package handlers
import (
"context"
"database/sql"
"encoding/json"
"github.com/intel/rsp-sw-toolkit-im-suite-utilities/go-metrics"
"io"
"net/http"
"strconv"
"time"
"github.com/gorilla/mux"
"github.com... |
package main
import (
"fmt"
"image"
"image/color"
"math"
"math/rand"
"time"
"github.com/faiface/pixel"
"github.com/faiface/pixel/pixelgl"
)
const (
//w, h = 768, 432
w, h = 192, 108
fw, fh = float64(w), float64(h)
globalScale = 0.12
)
var (
maxSpeed = 2.1 * globalScale
friendRadius = 60 * glo... |
package cinnabot
import (
"encoding/json"
"fmt"
"log"
"math/rand"
"os"
"regexp"
"runtime"
"strings"
"time"
"gopkg.in/telegram-bot-api.v4"
)
type bot interface {
Send(c tgbotapi.Chattable) (tgbotapi.Message, error)
GetUpdatesChan(config tgbotapi.UpdateConfig) (tgbotapi.UpdatesChannel, error)
}
// Cinnabo... |
package go2lua
import (
"log"
"os"
"path"
"reflect"
"strconv"
"strings"
)
type tPkgName struct {
name string
isAlias bool
}
type tClass struct {
t reflect.Type
metaKey string // key of class meta-table
pkgName string
}
type tModule struct {
funcNameMap map[string]string /... |
// 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... |
// 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 clusteragent
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/ht... |
package flowsdecoder
import (
"bytes"
"encoding/binary"
"net"
"github.com/google/gopacket"
"github.com/google/gopacket/ip4defrag"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/reassembly"
)
type IPEndpoint struct {
IP net.IP
Port int
}
type TCPConnection struct {
ClientEndpoint IPEndpo... |
// Copyright 2020 <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 writi... |
package lsifstore
import (
"context"
"sort"
"github.com/keegancsmith/sqlf"
"github.com/opentracing/opentracing-go/log"
"github.com/sourcegraph/sourcegraph/internal/observation"
"github.com/sourcegraph/sourcegraph/lib/codeintel/precise"
)
// MaximumRangesDefinitionLocations is the maximum limit when querying d... |
package httpcache
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"regexp"
"strings"
"sync"
"github.com/caddyserver/caddy/v2"
"github.com/androidacy/cdp-cache/pkg/helper"
)
var (
bufPool = sync.Pool{
New: func() interface{} {
return new(bytes.Buffer)
},
}
purgeRepl *caddy.Replacer
)
func... |
//
// Copyright 2019 Chef Software, Inc.
// Author: <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 requ... |
package tree
import (
"errors"
"fmt"
"math/rand"
"testing"
)
// simple test interval
type ival struct {
lo, hi int
}
// implementing tree.Interface
// Equal
func (a ival) Equals(i Interface) bool {
b := i.(ival)
return a == b
}
// Covers
func (a ival) Covers(i Interface) bool {
b := i.(ival)
if a == b {
... |
package jira
import (
"fmt"
"github.com/google/go-querystring/query"
)
// ProjectService handles projects for the JIRA instance / API.
//
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project
type ProjectService interface {
GetList() (*ProjectList, *Response, error)
ListWithOptions(*GetQue... |
/*
* Minio Cloud Storage, (C) 2018 Minio, 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 la... |
package cli
import (
"fmt"
"io/ioutil"
"sort"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/beneath-hq/beneath/pkg/envutil"
)
// prefix for environment variables that override config keys
const envVarPrefix = "BENEATH"
// loads config based on the given file, or if it's not set, 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, ... |
// Copyright 2019 Reaction Engineering International. All rights reserved.
// Use of this source code is governed by the MIT license in the file LICENSE.txt.
package configuration
import (
"encoding/json"
"errors"
"fmt"
"log"
"os"
"strconv"
)
type Json struct {
//Load in the params from json
params map[strin... |
package smartadserver
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"path"
"strconv"
"github.com/mxmCherry/openrtb/v15/openrtb2"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.