text stringlengths 3.08k 10.4k |
|---|
package jsontime
import (
"github.com/json-iterator/go"
"time"
"strconv"
"unsafe"
)
var (
ConfigWithCustomTimeFormat = jsoniter.ConfigCompatibleWithStandardLibrary
commonFormats = map[string]string{
"ANSIC": "Mon Jan _2 15:04:05 2006",
"UnixDate": "Mon Jan _2 15:04:05 MST 2006"... |
/*
Sniperkit-Bot
- Status: analyzed
*/
package v1
import (
"encoding/json"
"log"
"github.com/TIBCOSoftware/flogo-lib/app"
"github.com/TIBCOSoftware/flogo-lib/engine"
"github.com/sniperkit/snk.fork.tibcosoftware-mashling/internal/pkg/consul"
gwerrors "github.com/sniperkit/snk.fork.tibcosoftware-mashling/intern... |
package monitor
import (
"database/sql"
"github.com/joaosoft/logger"
"fmt"
errors "github.com/joaosoft/errors"
manager "github.com/joaosoft/manager"
)
type StoragePostgres struct {
conn manager.IDB
logger logger.ILogger
}
func (monitor *Monitor) NewStoragePostgres(connection manager.IDB) *StoragePostgres {
... |
package main
import (
"fmt"
"os"
"strconv"
"strings"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/lego"
"gopkg.in/yaml.v2"
)
const (
envCertDestinationKey = "DOTEGE_CERT_DESTINATION"
envCertDestinationDefault = "/data/certs/"
envCertUserIdKey = "DOTEGE_... |
//-----------------------------------------------------------------------------
// FILE: domain_describe_reply.go
// CONTRIBUTOR: <NAME>
// COPYRIGHT: Copyright (c) 2016-2019 by neonFORGE, LLC. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file exce... |
package servicefabric
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regen... |
package scenes
import (
. "github.com/gabz57/goledmatrix/canvas"
. "github.com/gabz57/goledmatrix/components"
"github.com/gabz57/goledmatrix/components/shapes"
"image"
"image/color"
"image/draw"
"math/rand"
"time"
)
type PhotoGallery struct {
dir string
images []*shapes.Img
elapsed time... |
package logs
import (
"errors"
"fmt"
"github.com/jinzhu/gorm"
"github.com/jonas747/discordgo"
"github.com/jonas747/yagpdb/bot"
"github.com/jonas747/yagpdb/common"
"github.com/jonas747/yagpdb/common/configstore"
"golang.org/x/net/context"
"strconv"
"strings"
)
var (
ErrChannelBlacklisted = errors.New("Chann... |
package BLC
import (
"flag"
"fmt"
"log"
"os"
)
type CLI struct {
}
func printUsage(){
fmt.Println("Usage:")
fmt.Println("\t createwallet --创建钱包")
fmt.Println("\t addresslist --输出所有钱包地址")
fmt.Println("\t createblockchian -address address --余额")
fmt.Println("\t send -from FROM -to TO -amount AMOUNT -转账")
fmt... |
package dwolla
import (
"context"
"errors"
"fmt"
"net/url"
)
const (
// MassPaymentStatusDeferred is when a mass payment is deferred
MassPaymentStatusDeferred MassPaymentStatus = "deferred"
// MassPaymentStatusPending is when the mass payment is pending
MassPaymentStatusPending MassPaymentStatus = "pending"
... |
// Copyright (c) 2019 Uber Technologies, 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 o... |
package pythoncode
import (
"fmt"
"sort"
"strings"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonimports"
)
// PackageStats contains raw counts for how many incantations are part of the
// named Package. It includes a breakdown by method.
type PackageStats struct {
Package string
Count int
Methods []*... |
package db
import (
"database/sql"
"log"
"strconv"
"strings"
"github.com/camd67/moebot/moebot_bot/util/db/types"
)
const (
roleGroupTable = `CREATE TABLE IF NOT EXISTS role_group(
Id SERIAL NOT NULL PRIMARY KEY,
ServerId INTEGER NOT NULL REFERENCES Server(Id),
Name TEXT NOT NULL CHECK(char_length(Name... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type DescribeHostReservationsInput struct {
_ struct{} `type:"structure"`
// The filters.
//
// * instance-family - The ... |
package spotlight
import (
"bufio"
"bytes"
"encoding/binary"
"os"
"runtime"
"unicode/utf16"
"unicode/utf8"
)
// ReadUTF16 required to correctly read the metadata JSON files
// via https://stackoverflow.com/questions/15783830/how-to-read-utf16-text-file-to-string-in-golang/15794113
func ReadUTF16(... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package simpledb
import (
"context"
"fmt"
"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"
"github.com/aws/aws-sdk-go-v2/private/protocol/query"
)
type PutAttr... |
package resolvers
import (
"context"
"database/sql"
"fmt"
"reflect"
"testing"
"time"
"github.com/graph-gophers/graphql-go"
"github.com/graph-gophers/graphql-go/relay"
"github.com/keegancsmith/sqlf"
"github.com/sourcegraph/sourcegraph/cmd/frontend/backend"
"github.com/sourcegraph/sourcegraph/cmd/frontend/gr... |
// +build js
package hid
import (
"log"
// "os"
"runtime"
"runtime/pprof"
"syscall/js"
"korok.io/korok/asset/res"
"korok.io/korok/hid/gl"
"strconv"
"time"
)
var windowCallback WindowCallback
var inputCallback InputCallback
var Keys [1024]int
var AudioCtx js.Value
var AudioCheck bool
... |
package main
import (
"bytes"
"crypto/sha256"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"text/template"
"time"
)
type entry struct {
FullPath string
RelativePath string
Checksum string
SizeMb float64
}
type release struct {
Name string
Project string
SourceURL... |
package core
import (
"bufio"
"fmt"
"io"
"lxsoft/amwj/data"
"lxsoft/amwj/logx"
"os"
"strconv"
"strings"
"sync"
"time"
)
var (
//主链
chainMap sync.Map
//每店同标签最多显示数量
maxGoodsCountPerShopTag int
)
func init() {
if len(os.Args) < 3 {
logx.Fatalln("Usage: bin.exe siteIndexTempl... |
package hcltest
import (
"fmt"
"github.com/hashicorp/hcl2/hcl"
"github.com/zclconf/go-cty/cty"
)
// MockBody returns a hcl.Body implementation that works in terms of a
// caller-constructed hcl.BodyContent, thus avoiding the need to parse
// a "real" zcl config file to use as input to a test.
func MockBody(conten... |
package ssh
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"strings"
"syscall"
"time"
"github.com/blacknon/lssh/conf"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal"
)
type Run struct {
ServerList []string
Conf conf.Config
IsTerm bool
IsPar... |
package application
import (
"github.com/Sirupsen/logrus"
"github.com/carbocation/interpose"
"github.com/gomodule/redigo/redis"
gorilla_mux "github.com/gorilla/mux"
"github.com/jfardello/dsc-go/handlers"
"github.com/spf13/viper"
"github.com/throttled/throttled"
"github.com/throttled/throttled/store/memstore"
... |
package request
import (
"bytes"
"encoding/json"
"io"
"mime/multipart"
"net/http"
"net/url"
"sort"
"strings"
"github.com/spf13/cast"
)
type Request struct {
Opts *ReqOptions `json:"opts"`
HttpReq *http.Request `json:"http_req"`
}
// http request options
type ReqOptions struct {
Method string
... |
// Copyright 2020 rnrch
//
// 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 erago
import (
"context"
"fmt"
"runtime"
"github.com/mzki/erago/infra/repo"
"github.com/mzki/erago/infra/script"
"github.com/mzki/erago/scene"
"github.com/mzki/erago/state"
"github.com/mzki/erago/state/csv"
"github.com/mzki/erago/uiadapter"
"github.com/mzki/erago/uiadapter/event/input"
)
//
// Game... |
package main
import (
"context"
"fmt"
"os"
"github.com/abulo/ratel/v2"
"github.com/abulo/ratel/v2/logger"
"github.com/abulo/ratel/v2/logger/hook"
"github.com/abulo/ratel/v2/store/mongodb"
"github.com/abulo/ratel/v2/store/mysql"
"github.com/abulo/ratel/v2/store/query"
"github.com/abulo/ratel/v2/store/redis"
... |
package main
import (
"fmt"
"net/http"
"os"
"strings"
"github.com/onedr0p/radarr-exporter/internal/collector"
"github.com/onedr0p/radarr-exporter/internal/handlers"
"github.com/onedr0p/radarr-exporter/internal/utils"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/promet... |
package main
import (
"encoding/json"
"flag"
"io/ioutil"
"log"
"os"
"path/filepath"
)
const (
configFileDir = "/usr/local/etc"
configFileName = "mioswitch.json"
logFilePath = "/var/tmp/mioswitch.log"
couponEndpoint = "https://api.iijmio.jp/mobile/d/v2/coupon/"
packetEndpoint = "https://api.iijmio.jp/mo... |
package model
var (
_ = Progresser(new(DefaultProgresser))
_ = Task(new(DefaultTask))
)
// ProgressListener listener for progresser
type ProgressListener interface {
Notify(int)
End()
}
type plistener struct {
notifier func(int)
end func()
}
func (p *plistener) Notify(progress int) {
if p.notifier != ni... |
package kubernetes
import (
"errors"
"sort"
"github.com/kelda/kelda/db"
log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientv1 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/util/retry"
)
const providerKey = "kelda.io/host.provider"... |
// Copyright 2019 <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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... |
package funcs
import (
"encoding/json"
"fmt"
"strconv"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/open-falcon/falcon-plus/common/model"
"github.com/open-falcon/falcon-plus/modules/agent/g"
)
type PidNet struct {
TcpSend int64
TcpRecv int64
UdpSend int64
UdpRecv int64
}
func (this *PidNet) Str... |
// Copyright 2019 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 ash
import (
"context"
"strings"
"time"
"chromiumos/tast/errors"
"chromiumos/tast/local/chrome"
"chromiumos/tast/testing"
)
// Notific... |
package main
import (
"context"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/eximcha... |
// Copyright 2020 IBM Corp.
// SPDX-License-Identifier: Apache-2.0
package modules
import (
app "fybrik.io/fybrik/manager/apis/app/v1alpha1"
taxonomymodels "fybrik.io/fybrik/pkg/taxonomy/model/policymanager/base"
)
// Selector is responsible for finding an appropriate module
type Selector struct {
Module ... |
package parser
import (
"fmt"
"sort"
"strconv"
"strings"
"github.com/lestrrat-go/hsup/ext"
"github.com/lestrrat-go/hsup/internal/genutil"
"github.com/lestrrat-go/jshschema"
"github.com/lestrrat-go/jsval"
"github.com/pkg/errors"
)
type Result struct {
Schema *hschema.HyperSchema
Methods ... |
package win
import (
"syscall"
"unsafe"
)
var (
// Library
libgdi32 = syscall.NewLazyDLL("gdi32.dll")
//libmsimg32 = syscall.NewLazyDLL("msimg32.dll")
// Functions
procCreateDC = libgdi32.NewProc("CreateDCW")
procCreateCompatibleDC = libgdi32.NewProc("CreateCompatibleDC")
procDeleteDC ... |
package parser
// Notes:
// GeoLite1 is IPv4 only.
// GeoLite2 supports IPv4 and IPv6.
import (
"encoding/binary"
"encoding/csv"
"errors"
"io"
"log"
"math"
"net"
"reflect"
"strconv"
)
const (
ipNumColumnsGlite1 = 3
locationNumColumnsGlite1 = 9
gLite1Prefix = "GeoLiteCity"
)
// Glit... |
/*
Copyright 2022 logan.
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
distribu... |
// Copyright 2020 RTrade Technologies Ltd
//
// licensed under GNU AFFERO GENERAL PUBLIC LICENSE;
// you may not use this file except in compliance with the License;
// You may obtain the license via the LICENSE file in the repository root;
//
// Unless required by applicable law or agreed to in writing, software
// di... |
package engine
import (
"fmt"
)
// A Move is a transformation on the game board. Each player can make moves
// to advance the game. Moves are all encoded in a compact manner as 16-bit
// integers for the sake of performance.
//
// ## Encoding
// The encoding of a move is like this:
// * 6 bits - source square
// *... |
package v0
import (
"cve-tracker/pkg/db"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
func Router(addr string) error {
var eng = gin.Default()
eng.Use(cors())
v0 := eng.Group("v0")
session := v0.Group("/session")
{
session.POST("/login", login) //curl -v -X POST http://127.0.0.1:10808/v0/session/log... |
// 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... |
package tinylb
import (
"os"
"sync"
"time"
"github.com/fsnotify/fsnotify"
"github.com/sirupsen/logrus"
)
type LoadBalancer struct {
sync.RWMutex
Config
// configPath is the path to the load balancer's config file.
configPath string
// stop signals that all long-running goroutines for this target group sho... |
/*
* Copyright © 2016-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 o... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: tensorflow/core/framework/versions.proto
package framework
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
v... |
package data
import (
"fmt"
"strings"
"unicode/utf8"
)
const (
// Deprecated Box Drawing Characters
//topLeftCorner = "╭─"
//bottomLeftCorner = "╰─"
//dash = "─"
//bottomRightCorner = "─╯"
//bottomSeparator = "─┴─"
//topRightCornerWithNewLine = "─╮... |
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"bytes"
"context"
"encoding/json"
"io"
"io/ioutil"
"github.com/go-openapi/errors"
"github.com/go-openapi/r... |
package main
import (
"fmt"
"os"
"runtime"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/kolide/kolide/config"
"github.com/kolide/kolide/model"
"github.com/kolide/kolide/router"
"github.com/kolide/kolide/server"
"github.com/kolide/kolide/shared/formatter"
"github.com/kolide/kolide/ver... |
package sparse_test
import (
"bytes"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"strings"
"testing"
"github.com/dnesting/sparse"
)
func TestFromReader(t *testing.T) {
type R struct {
data string
skipped int64
}
type T struct {
input string
consec int64
expected []R
}
for ci, c := range []T{... |
package boardgame
import (
"errors"
"strings"
"testing"
"github.com/jkomoros/boardgame/enum"
"github.com/workfit/tester/assert"
)
const (
colorRed = iota
colorBlue
colorGreen
)
var testEnums = enum.NewSet()
var testColorEnum = testEnums.MustAdd("color", map[int]string{
colorRed: "Red",
colorBlue: "Blu... |
package form
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"net/http"
"net/url"
"reflect"
"strconv"
"strings"
)
// Decode form struct from given input.
func Decode(form interface{}, input interface{}) error {
var t = typeOf(form)
var d, ok = decoders[t]
if !ok {
d = &decoder{typ: t}
d.init()
... |
package mesh
import (
"fmt"
discoveryv1 "github.com/solo-io/gloo-mesh/pkg/api/discovery.mesh.gloo.solo.io/v1"
"github.com/solo-io/gloo-mesh/pkg/openmeshctl/output"
"github.com/solo-io/gloo-mesh/pkg/openmeshctl/resource"
"github.com/solo-io/gloo-mesh/pkg/openmeshctl/resource/apply"
"github.com/solo-io/gloo-mesh/... |
package blip
import (
"errors"
"unsafe"
)
type buf_t = int32
// Sample buffer that resamples to output rate and accumulates samples until they're read out
type Blip struct {
factor uint64
offset uint64
avail int32
size int32
integrator int32
buffer []buf_t
}
// Creates new buffer that... |
// SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Cloud Security Client Go contributors
//
// SPDX-License-Identifier: Apache-2.0
package oidcclient
import (
"crypto/rsa"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"github.com/pquerna/cachecontrol"
"golang.org/x/sync/singleflight"
"i... |
package timeseries
import (
"math"
"strings"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)
func TestLoad(t *testing.T) {
input := `Date,FONDS 0,FONDS 1
1999-01-29,"5,648","4,161"
1999-02-26,"0,686","2,190"
`
want := map[string]Data{
"FONDS 0": Data{
Name: "<NA... |
package runner
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"strings"
"syscall"
"github.com/hashicorp/go-multierror"
"go.uber.org/zap"
)
type StandardRunner struct {
executorFactory ExecutorFactory
defaultToBackground bool
caughtSignals []os.Signal
logger *zap.Logger
}
func NewStandardRunner(
logge... |
// Copyright 2018 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 autocaps determines the DUT's capabilities by parsing autotest-capability YAML files.
//
// autotest-capability is a pre-Tast system develop... |
package antifraud
import (
"context"
"encoding/json"
"fmt"
"math"
"strings"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/rcrowley/go-metrics"
"github.com/sonm-io/core/connor/price"
"github.com/sonm-io/core/connor/types"
"github.com/sonm-io/core/util"
"go.uber.org/atomic"
"go.uber.org/zap"
... |
// Copyright 2020 OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
package main
import (
"go/ast"
"go/token"
"log"
)
func init() {
register(mainretFix)
}
var mainretFix = fix{
"mainret",
"2015-02-27",
mainret,
`Replace return statements with calls to os.Exit in the "main" function.`,
false,
}
func mainret(file *ast.File) bool {
// Only check main package.
if file.Name.N... |
package cast
import (
"encoding/json"
"fmt"
"reflect"
"strings"
"time"
)
// ToTimeE casts an interface to a time.Time type.
func ToTimeE(i interface{}) (tim time.Time, err error) {
i = indirect(i)
switch v := i.(type) {
case time.Time:
return v, nil
case string:
return StringToDate(v)
case int:
retur... |
/*
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 not use this fi... |
package kit
import (
"fmt"
"path/filepath"
"runtime"
"strings"
)
//common resource
var MessageMap = map[string]map[int]string{
"en": {
10001: "System error",
10002: "A required parameter is missing or doesn't have the right format:%v",
10003: "%v is required",
10004: "The parameter format should be %v",
... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package resourcegroups
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2... |
package types
import (
"bytes"
"context"
"fmt"
"strings"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/threefoldtech/tfexplorer/models"
generated "github.com/threefoldtech/tfexplorer/models/generated/phonebook"
"github.com/threefoldtech/tfexplorer/schema"
"github.com/threefoldtech/zos/pkg... |
package go_ohm
import (
"reflect"
"strings"
"github.com/gomodule/redigo/redis"
)
type structObject struct {
*compoundObject
// all exported fields of the struct, include anonymous struct.
fields []*object
}
func (o *structObject) addField(obj *object) {
o.fields = append(o.fields, obj)
}
func (o *structObj... |
package route
import (
"bytes"
"fmt"
"io"
"strconv"
"strings"
"github.com/olekukonko/tablewriter"
"github.com/gogo/protobuf/types"
"github.com/solo-io/gloo/pkg/api/types/v1"
)
// Destination represents a single destination of a route
// It can be either an upstream or upstream-function pair
type Destination... |
// Use of this source code is governed by a MIT license that can be found
// in the LICENSE file.
// Package gowav implements wav audio file reading and writing.
package gowav
import (
"bytes"
"errors"
"fmt"
"io"
"os"
)
type WavFile struct {
AudioFormat int
FileSize int
NumChannels int
SampleRate ... |
package kit
import (
"fmt"
"strings"
"time"
)
const createThemeMaxRetries int = 3
// ThemeClient is the interactor with the shopify server. All actions are processed
// with the client.
type ThemeClient struct {
Config *Configuration
httpClient *httpClient
filter fileFilter
}
// NewThemeClient will bu... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"github.com/tidwall/gjson"
)
const (
productid = "Aic-hWgBz42mve0cIOaP"
sizeid = "e2e8cbc4-20a7-11e9-9206-02420a000220"
)
type payload struct {
ID string `json:"id"`
SizerunID string `json:"si... |
// Copyright 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package datavalues
import (
"fmt"
"strings"
"github.com/k14s/ytt/pkg/schema"
"github.com/k14s/ytt/pkg/template"
"github.com/k14s/ytt/pkg/workspace/ref"
"github.com/k14s/ytt/pkg/yamlmeta"
)
// Schema is a definition of types and default valu... |
package gorest
import (
"golang.org/x/net/context"
"log"
"net/http"
)
/*
way to define HTTP routing, middleware etc.
to create new routing:
r := NewRouter()
r.Get("/ualist", c.getUAListHandler)
g.Post("/ualist/ua", c.updateUAHandler)
you can define routing groups, and then define routing rule under group
g := ... |
package tracking
import (
"fmt"
"sigs.k8s.io/aws-load-balancer-controller/pkg/algorithm"
"sigs.k8s.io/aws-load-balancer-controller/pkg/model/core"
)
//we use AWS tags and K8s labels to track resources we have created.
//
//For AWS resources created by this controller, the tagging strategy is as follows:
// * `elb... |
package models
import (
"database/sql"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
)
const (
PairTableName = "user_course_pair"
CourseTableName = "courses"
FULL = 0
OPEN = 1
WAITLIST = 2
NONEXISTENT = 3
DELETED = 4
ENTRYEXISTS = 5
NOTDELETED = 6
... |
package cmd
import (
"encoding/json"
"fmt"
"html"
"io/ioutil"
"log"
"math/rand"
"net/http"
"os"
"os/exec"
"time"
"github.com/spf13/cobra"
)
// quizCmd represents the quiz command
var quizCmd = &cobra.Command{
Use: "quiz",
Short: "A simple quiz",
Long: `Golang quiz which requires to fill the following... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
package zenhub
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"path"
"strconv"
"time"
"github.com/44smkn/zenhub_exporter/pkg/model"
)
const (
ZenhubRootEndpoint = "https://api.zenhub.com"
ZenhubWorkspacesEndpoint = "/p2/repositories/%s/workspaces"
ZenhubBoardEndpoint ... |
/*
Copyright 2021 The acm-manager 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 config
import (
"flag"
"fmt"
"io/ioutil"
"os"
"os/user"
"path"
"path/filepath"
"runtime"
"time"
"github.com/openshift-pipelines/release-tests/pkg/assert"
)
const (
// APIRetry defines the frequency at which we check for updates against the
// k8s api when waiting for a specific condition to be tr... |
// Copyright © 2020-2021 <NAME> <<EMAIL>>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is d... |
package wx
import (
"encoding/xml"
"time"
)
const (
Text = "text"
Location = "location"
Image = "image"
Link = "link"
Event = "event"
Music = "music"
News = "news"
Voice = "voice"
Video = "video"
)
type baseResponseMessage struct {
ErrCode int `json:"errcode"`
ErrMsg strin... |
package main
import (
"bytes"
"flag"
"fmt"
"image"
"image/color"
"image/draw"
"image/png"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/alecthomas/chroma"
"github.com/alecthomas/chroma/formatters"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/go... |
// Copyright 2019 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 runtime
import "unsafe"
type sigctxt struct {
info *siginfo
ctxt unsafe.Pointer
}
//go:nosplit
//go:nowritebarrierrec
func (c *sigctxt) regs() *mco... |
package blockchain
import (
"bufio"
"context"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"math"
"math/big"
"os"
"time"
)
// zeroHash represents a hash code of zeros.
const zeroHash string = "00000000000000000000000000000000"
// ======================================================... |
package variables
import (
"fmt"
"regexp"
"strconv"
"strings"
"github.com/go-logr/logr"
"github.com/nirmata/kyverno/pkg/engine/context"
)
const (
variableRegex = `\{\{([^{}]*)\}\}`
singleVarRegex = `^\{\{([^{}]*)\}\}$`
)
//SubstituteVars replaces the variables with the values defined in the context
// - if... |
/*
Synctera API
<h2>Let's build something great.</h2><p>Welcome to the official reference documentation for Synctera APIs. Our APIs are the best way to automate your company's banking needs and are designed to be easy to understand and implement.</p><p>We're continuously growing this library and what you see here is j... |
package dataset
import (
"archive/tar"
"bytes"
"errors"
"io"
"path"
"strings"
)
// DataBuffer contains data that can be read and written.
type DataBuffer struct {
Buffer bytes.Buffer
ReadOnly bool
}
// Read reads bytes from the buffer.
func (b *DataBuffer) Read(p []byte) (n int, err error) {
return b.Buff... |
package ipfscluster
import (
"context"
"encoding/hex"
"github.com/ipfs/ipfs-cluster/config"
libp2p "github.com/libp2p/go-libp2p"
autonat "github.com/libp2p/go-libp2p-autonat-svc"
relay "github.com/libp2p/go-libp2p-circuit"
connmgr "github.com/libp2p/go-libp2p-connmgr"
corepnet "github.com/libp2p/go-libp2p-cor... |
package schema
import (
"fmt"
"net/http"
"os"
"regexp"
"github.com/jtacoma/uritemplates"
)
var (
validFieldIDRegex = regexp.MustCompile(`^([A-Za-z0-9_\-\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$`)
validIdentifierRegex = regexp.MustCompile(`^[a-z0-9](?:[-]?[a-z0-9]){2,}$`)
maxIdentifierLength = 32
maxNameLength ... |
package simulator
import (
"fmt"
"os"
"strings"
"github.com/kubernetes-simulator/simulator/pkg/childminder"
"github.com/kubernetes-simulator/simulator/pkg/util"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
// PrepareTfArgs takes a string with the terraform command desired and returns
// a slice of s... |
package arts
import (
"encoding/json"
"fmt"
"strings"
"github.com/xztaityozx/owari/aa"
)
// Kanban は
// //
////| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|
////| 終 |
////| 制作・著作 |
////|  ̄ ̄ ̄ ̄ ̄ ̄ ̄ |
////| O W R |
////|_________|
//// ∧∧ ||
//// ( ゚д゚)||
//// / づΦ
// です
type Kanban struct {
aa.AsciiArt
// 終 の... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package icon // import "miniflux.app/reader/icon"
import (
"encoding/base64"
"fmt"
"io"
"strings"
stdlib_url "net/url"
"miniflux.app/config"
"miniflux.app/... |
// Copyright 2017 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
package drouter
import (
"bufio"
"fmt"
"net"
"os"
"strings"
"sync"
log "github.com/Sirupsen/logrus"
"github.com/TrilliumIT/iputil"
dockertypes "github.com/docker/engine-api/types"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
"golang.org/x/net/context"
)
const (
addRoute = true
delRou... |
// Copyright (c) 2020 <NAME> and contributors
// SPDX-License-Identifier: MIT
// Package address handles address representation, validation and formatting.
package address
import (
"bytes"
"encoding/json"
"fmt"
"regexp"
"sort"
)
// Address represents an address.
type Address struct {
Line1 string `json:"line1"... |
/*
-- @Time : 2021/3/8 15:30
-- @Author : raoxiaoya
-- @Desc :
*/
package ColorOutput
import (
"fmt"
"runtime"
"strings"
"github.com/gogf/gf/container/garray"
)
// Linux -------------------------
// 前景 背景 颜色
// -------------------------
// 30 40 黑色
// 31 41 红色
// 32 42 绿色
// 33 43 黄色
// 34 44 蓝色
// 35... |
// The code in this test file is copied from the Go standard library's
// Mutex tests, with slight modifications to account for stat and registration drains.
//
// The original license is as follows:
// Copyright (c) 2009 The Go Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, wit... |
/*
Copyright The containerd 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.