text stringlengths 3.08k 10.4k |
|---|
package api
import (
"net/http"
log "github.com/Sirupsen/logrus"
"github.com/codegangsta/negroni"
"github.com/ericflo/gradientzoo/blobstorage"
"github.com/ericflo/gradientzoo/models"
"github.com/ericflo/gradientzoo/utils"
"github.com/julienschmidt/httprouter"
negronilogrus "github.com/meatballhat/negroni-logr... |
// Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package ttn
import (
"context"
"sync"
"time"
"github.com/TheThingsNetwork/api/discovery"
"github.com/TheThingsNetwork/api/discovery/discoveryclient"
"github.com/TheThingsNetwo... |
package main
import (
"flag"
"fmt"
"net"
"os"
"os/signal"
"strings"
"sync"
"syscall"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/google/uuid"
)
var options struct {
listenAddress string
hosts string
vschemaFilePath string
logLevel string
}
func main() ... |
package quiz
import (
"errors"
"net"
"strconv"
)
var (
// ErrInvalidNetwork unable to parse network.
ErrInvalidNetwork = errors.New("unable to parse network")
// ErrInvalidQuestionKind invalid question kind.
ErrInvalidQuestionKind = errors.New("invalid question kind")
// solvers maps a question kind to the f... |
package cherry
import (
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/http"
"strconv"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
)
var (
//BaseURL for main site
BaseURL = "https://cherry.ee"
// Categories is an url and category map, move this map to config file
Categories = map[string]string{
... |
// Copyright 2020 The Embedded 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 uarths
import (
"embedded/rtos"
"sync/atomic"
"time"
"github.com/embeddedgo/kendryte/hal/fpioa"
)
type DriverError uint8
const (
// Er... |
// Code generated by go-swagger; DO NOT EDIT.
package crypto_config
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/r... |
package handlers
import (
"fmt"
"os"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
goUUID "github.com/nu7hatch/gouuid"
"github.com/patrickmn/go-cache"
"github.com/pkg/errors"
"github.com/rancher/agent/host_info"
"github.com/rancher/agent/utils"
revents "github.com/rancher/event-s... |
/*
Copyright 2018 Google, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"fmt"
"io"
"runtime"
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol"
"github.com/keybase/go-updater"
"github.com/keybase/go-upd... |
package importer
import (
"fmt"
"go/ast"
"go/build"
"go/parser"
"go/token"
"os"
"strconv"
"strings"
"github.com/pkg/errors"
)
// Importer retrieves an object representing a package
type Importer func(path string) (*ast.Object, error)
func ignoreTestFiles(file os.FileInfo) bool {
return !strings.HasSuffix(... |
package network
import (
"bytes"
"errors"
"net"
"net/http"
"net/rpc"
"net/rpc/jsonrpc"
"reflect"
"strconv"
"strings"
"sync"
"time"
)
var timeout = time.Second * 5
// addrString is a helper function that converts an Address to a string
// that can be passed to net.Dial().
func addrString(a Address) string ... |
// garbaged - clean up manually modified hosts, quick
// NewTrashHandler.go: The handler for trash/new
//
// Copyright 2018 Threat Stack, Inc.
// Licensed under the BSD 3-clause license; see LICENSE.md for more information.
// Author: <NAME> <<EMAIL>>
package server
import (
"crypto/x509"
"encoding/json"
"encoding... |
package main
type RedisType string
type RedisCommand string
type RedisKeyword string
var types map[rune]RedisType = map[rune]RedisType{
plusByte: "Simple String",
dollarByte: "Bulk String",
asteriskByte: "Array",
colonByte: "Integer",
minusByte: "Error",
notApplicableByte: "... |
package ReflectUtils
import (
"errors"
"fmt"
"github.com/stretchr/testify/assert"
"reflect"
"testing"
)
func TestSetFieldValue(t *testing.T) {
type Addr struct {
country string
province string
}
type User struct {
Id int
IdPtr *int
username string
Addr Addr
AddrPtr *Addr
}
us... |
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.18
// +build go1.18
package gcimporter_test
import (
"bytes"
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/token"
"go/types"
"os"
"path... |
package main
import (
/*"net/http"
"os"*/
"time"
"github.com/gin-gonic/gin"
"../utilities"
"../dao/factory"
"../models"
"../models/custom/structfaces"
"../models/custom"
"database/sql"
"os"
"net/http"
"io/ioutil"
"bytes"
"github.com/appleboy/gin-jwt"
)
const SECRECT_KEY = "<KEY>"
func main() {
... |
/**
* Copyright 2020 Appvia Ltd <<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 ... |
/*
* Minio Cloud Storage, (C) 2016 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 main
import "time"
type Post struct {
Filename string
FeaturedImage string
PublishedFilename string
Slug string
Title string
Date time.Time
Category categoryType
Tags []tagType
}
var blogPosts = []Post{
{
Filename: "../f... |
package main
import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"sort"
)
// stock struct for json serialize
type StockData struct {
Source map[string][]float64
Origin map[string][]float64
Cluster [][]int
Centers [][]float64
Sort_keys []string
Id string
}
//function for concate two maps
fu... |
package models
type DenariusBlockchainInfo struct {
Result struct {
Chain string `json:"chain"`
Blocks int `json:"blocks"`
Bestblockhash string `json:"bestblockhash"`
Difficulty struct {
ProofOfWork float64 `json:"proof-of-work"`
ProofOfStake float64 `json:"proof-of-stake"`
} `js... |
// 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 wmp
import (
"context"
"fmt"
"time"
"chromiumos/tast/ctxutil"
"chromiumos/tast/errors"
"chromiumos/tast/local/apps"
"chromiumos/tast/l... |
package commands
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/phase2/rig/util"
"github.com/urfave/cli"
"gopkg.in/yaml.v2"
)
// ProjectScript is the struct for project defined commands
type ProjectScript struct {
Alias string
Description string
Run []string
}
// Sync ... |
package actions
import (
"fmt"
"github.com/dgrijalva/jwt-go"
"github.com/gobuffalo/buffalo"
"github.com/gobuffalo/envy"
csrf "github.com/gobuffalo/mw-csrf"
forcessl "github.com/gobuffalo/mw-forcessl"
paramlogger "github.com/gobuffalo/mw-paramlogger"
tokenauth "github.com/gobuffalo/mw-tokenauth"
"github.com/g... |
package api
import (
"encoding/json"
"errors"
"fmt"
"io/fs"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"runtime"
"strings"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/gmail/v1"
"github.com/tsiemens/gmail-tools/prnt"
"github.com/tsiemens/gmail... |
package main
import (
"encoding/json"
"errors"
"fmt"
//"strconv"
"strings"
//"time"
"github.com/hyperledger/fabric/core/chaincode/shim"
)
// ============================================================================================================================
// Build Full Owner Key
// =================... |
//
//Copyright [2016] [SnapRoute 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 main
import (
"crypto/sha256"
"crypto/tls"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service... |
package hubspot
import (
"fmt"
"github.com/spf13/cast"
)
const hubspotDefinedType = "HUBSPOT_DEFINED"
// AssociationType - type of data association
type AssociationType int8
const (
AssociationContactToCompany AssociationType = 1
AssociationCompanyToContact AssociationType = 2
Associatio... |
/*
Copyright (c) 2015, Alcatel-Lucent Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of condi... |
package gocto
import (
"fmt"
"github.com/jonas747/discordgo"
"sync"
"time"
)
const (
EmojiLeft = "◀️"
EmojiRight = "▶️"
EmojiFirst = "⏪"
EmojiLast = "⏩"
EmojiStop = "⏹️"
)
type Paginator struct {
Running bool
Session *discordgo.Session
ChannelID int64
Template func() *Embed
Pages []*discord... |
package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"golang.org/x/net/html"
)
// main is designed such that the program can except either input via an
// UNIX type operating system pipe or as addresses given as arguments after the
// program is called.
func main() {
out := os.Stdout
//... |
package jc
import (
"reflect"
"unicode"
"fmt"
"errors"
"strings"
"gopkg.in/mgo.v2/bson"
"gopkg.in/mgo.v2"
"github.com/kalcok/jc/tools"
)
type document interface {
setCollection(string)
CollectionName() string
SetDatabase(string)
Database() string
GetField(string) (interface{}, error)
ID() interface{}
I... |
// Copyright 2012 - 2013 The Fn Authors. All rights reserved. See the LICENSE file.
package fn
// Special math functions.
import (
"math"
)
const π = float64(math.Pi)
const ln2 = math.Ln2
const lnSqrt2π = 0.918938533204672741780329736406 // log(sqrt(2*pi))
const min64 = math.SmallestNonzeroFloat64 // DBL... |
// Copyright Suneido Software Corp. All rights reserved.
// Governed by the MIT license found in the LICENSE file.
package runtime
// see also: ArgSpec
import (
"strconv"
"github.com/apmckinlay/gsuneido/util/assert"
"github.com/apmckinlay/gsuneido/util/ints"
)
func (t *Thread) Args(ps *ParamSpec, as *ArgSpec) [... |
//https://www.youtube.com/watch?v=W5b64DXeP0o
//https://tutorialedge.net/golang/creating-restful-api-with-golang/
package api
import (
"encoding/json"
"fmt"
"github.com/gorilla/mux"
"github.com/pranganmajumder/go-basic-restApi/auth"
"io/ioutil"
"log"
"net/http"
)
// User is a struct type data structure
type U... |
package bootstrap
import (
"bytes"
"context"
"fmt"
"os"
"path"
"path/filepath"
"sync"
"github.com/ghodss/yaml"
"github.com/maistra/istio-operator/pkg/controller/common"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pk... |
// +build testnet
package commands
import (
"encoding/hex"
"fmt"
"math/rand"
"strconv"
"strings"
"github.com/abiosoft/ishell"
rpc "github.com/qlcchain/jsonrpc2"
"github.com/qlcchain/go-qlc/cmd/util"
"github.com/qlcchain/go-qlc/common/types"
cutil "github.com/qlcchain/go-qlc/common/util"
"github.com/qlcch... |
package permissions
import (
"context"
"fmt"
"net"
mapset "github.com/deckarep/golang-set"
"go.aporeto.io/a3s/pkgs/api"
"go.aporeto.io/elemental"
"go.aporeto.io/manipulate"
)
// A Retriever is an object that can retrieve permissions
// for the given informations.
type Retriever interface {
// Permissions re... |
package rice
import (
"errors"
"sync"
)
type IFSM interface{}
type StateType int
type EventType int
type Transition int
type CallbackType int
const (
None CallbackType = iota
BeforeEvent
LeaveState
EnterState
AfterEvent
)
type EventDesc struct {
Name EventType
Src []StateType
Dst StateType
}
type Event... |
// Copyright 2021 Workrise 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 ... |
package main
import (
"fmt"
"strconv"
)
type StandardSuite struct {
c *Config
}
func (t *StandardSuite) Name() string {
return "Standard"
}
func (t *StandardSuite) RunTests() {
// Test Keygroups
logNodeAction(t.c.nodeA, "Creating keygroup testing")
t.c.nodeA.CreateKeygroup("testing", true, 0, false)
logNod... |
// Copyright 2019 Intel Corporation and Smart-Edge.com, 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
//
//... |
// Copyright © 2018 data.world, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package p2p
import (
"sync"
"github.com/lianxiangcloud/linkchain/libs/log"
)
// IPeerSet has a (immutable) subset of the methods of PeerSet.
type IPeerSet interface {
HasID(id string) bool
HasIP(ip string) bool
GetByID(id string) Peer
GetByIP(ip string) Peer
List() []Peer
Size() int
}
//--------------------... |
package middle
import (
"fmt"
"neekity.com/leetcode/src/common"
"strings"
)
func LongestPalindrome(s string) string {
manacher := ManacherString(s)
lenManacher := len(manacher)
charArray := make([]int, lenManacher)
curRight, maxIndex, curIndex, maxLen, left := -1, -1, -1, 0, 0
for i := 0; i < lenManacher; i++... |
package main
import (
"bufio"
"context"
"flag"
"fmt"
"io"
"net"
"os"
"strconv"
"strings"
"sync/atomic"
"time"
)
var BuildTime string
var AppVersion = "0.0.2 build on " + BuildTime
var activeConnNum int32
var isShowVersion bool
var isServer bool
var port int
var serverAddr string
var laddrStart string
var... |
package models
import (
"encoding/json"
"fmt"
"time"
"github.com/toolkits/pkg/cache"
)
type HostRegisterForm struct {
SN string `json:"sn"`
IP string `json:"ip"`
Ident string `json:"ident"`
Name string `json:"name"`
Cate strin... |
package main
import (
"encoding/json"
"flag"
"fmt"
"runtime"
"k8s.io/kubernetes/pkg/api"
)
var store map[int]*api.Pod
// let's get the plain size of a Pod in memory
// assume each field takes about 16 bytes additional space
// unversioned.TypeMeta = 2 -> 32 bytes
// ObjectMeta = 16 -> 256 bytes
// PodSpec = 14... |
package cli
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"os"
"reflect"
"time"
"github.com/juanfont/headscale"
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang... |
package mathg
import "math"
type Vec2 struct {
X float64
Y float64
}
func (v *Vec2) IsZero() bool {
return math.Abs(v.X) < epsilon && math.Abs(v.Y) < epsilon
}
func (v *Vec2) IsEqual(v2 *Vec2) bool {
return math.Abs(v.X-v2.X) < epsilon && math.Abs(v.Y-v2.Y) < epsilon
}
func (v *Vec2) Zero() {
v.X = 0.0
v.Y =... |
// *** 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 cloudflare
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides a Cloudflare Zone Lockdown resource. ... |
// Copyright 2012, The gohg Authors. All rights reserved.
// Use of this source code is governed by a BSD style license
// that can be found in the LICENSE.md file.
package gohg
import (
// "fmt"
"os"
"os/exec"
// "path/filepath"
"strings"
"testing"
)
func TestHgClient_Branches(t *testing.T) {
hct := setup(t)... |
package builder
import (
"bytes"
"errors"
"fmt"
"github.com/falcosecurity/driverkit/pkg/kernelrelease"
"io"
"net/http"
"regexp"
"strconv"
"strings"
"text/template"
)
const mainlineUrl = "http://kernel.ubuntu.com/~kernel-ppa/mainline/v"
var errFailedKernelRelease = errors.New("failed kernel release for ubun... |
package gisp
import (
"reflect"
p "github.com/Dwarfartisan/goparsec2"
)
//Type 对象定义了一个可空的反射类型,用于 Lisp 对象定义
type Type struct {
reflect.Type
option bool
}
func (typ Type) String() string {
str := typ.Type.String()
if typ.option {
return str + "?"
}
return str
}
// Option 指示类型是否是可空的
func (typ Type) Option()... |
package besu
import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
hyperledgerv1alpha1 "github.com/Sumaid/besu-kubernetes/besu-operator/pkg/apis/hyperledger/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
... |
// Copyright (c) 2018 <NAME> <<EMAIL>>
// MIT Licence - http://opensource.org/licenses/MIT
package aw
import (
"errors"
"fmt"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
// Mock magic action
type mockMA struct {
keyCalled bool
descCalled bool
runTextCalled bool
runCalled bool
returnEr... |
package main
import (
"bufio"
"os"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
_ "github.com/heroku/x/hmetrics/onload"
)
const bufferLen = 500
type logData struct {
app *string
tags *[]string
prefix *string
line *string
}
type ServerCtx struct {
Port string
Allo... |
// Copyright (c) 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
package lib
import (
"fmt"
)
// Holds a matrix of pixel values
type Matrix [][]int
// Holds one row of pixel values from a matrix
type MatrixRow []int
// Return pixel matrix as pattern packed into a [u32] array.
// pat[0]: ((width of bli... |
package util
import (
"database/sql"
"fmt"
"strings"
"github.com/go-logr/logr"
. "github.com/icza/gox/gox"
_ "github.com/lib/pq" // NOLINT
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/yugabyte/yb-tools/yugatool/api/yb/common"
"github.com/yugabyte/yb-tools/yugatool/api/yb/server"
"github.co... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package organizations
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListAWSServiceAccessForOrganizationInput struct {
_ struct{} `type:"structure"`
// The total number of results... |
// +build linux
//-----------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license.
// See LICENSE.txt file in the project root for full license information.
//---------------------------------------------------------------... |
package ostrich
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
sandyBirthday = nook.Birthday{
Day: 21,
Mon... |
/*
Copyright 2017, 2018 Ankyra
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
package model
import (
"fmt"
"github.com/A11Might/shuangpin/pkg/shuangpin"
"github.com/A11Might/shuangpin/pkg/util"
"time"
"github.com/charmbracelet/bubbles/progress"
tea "github.com/charmbracelet/bubbletea"
"github.com/muesli/termenv"
)
const (
width = 60.
// charsPerWord 2 个字母等于一个汉字
charsPerWord = 2.
)
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.11.4
// source: message.proto
package message
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/p... |
package go_thunder
import (
"bytes"
"github.com/clarketm/json" // "encoding/json"
"io/ioutil"
"util"
)
type Management struct {
UUID ManagementInstance `json:"management,omitempty"`
}
type TxDot1Cfg struct {
LinkAggregation int `json:"link-aggregation,omitempty"`
Vlan int `json:"vlan,omitempty"`
T... |
// Copyright 2016 The G3N 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 gui
import (
"github.com/hecate-tech/engine/window"
)
/***************************************
Button Panel
+-----------------------... |
package parallel
import (
"context"
"fmt"
"sync"
"golang.org/x/sync/errgroup"
)
// Error is an error type for wrapping errors returned from worker goroutines.
// It contains the worker number of the goroutine that produced the error.
type Error struct {
N int
Err error
}
func (e Error) Error() string {
ret... |
package framework
import (
"errors"
"fmt"
"github.com/PucklaMotzer09/GoHomeEngine/src/gohome"
"github.com/PucklaMotzer09/GoHomeEngine/src/loaders/defaultlevel"
"github.com/PucklaMotzer09/mathgl/mgl32"
"github.com/gopherjs/gopherjs/js"
"io"
"log"
"net/http"
"strconv"
"time"
)
type JSFramework struct {
defa... |
package main
import (
"encoding/csv"
"errors"
"flag"
l "log"
"math"
"os"
"os/exec"
"regexp"
"sort"
"strconv"
"strings"
"time"
)
// Transaction represents a basic statement transaction, as shown by Chase in their Credit Card PDF statements.
type Transaction struct {
Amount float64
MerchantName stri... |
// Copyright 2017 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 agreed to i... |
package controller
import (
"fmt"
"net/http"
"testing"
"github.com/mvisonneau/gitlab-ci-pipelines-exporter/pkg/config"
"github.com/mvisonneau/gitlab-ci-pipelines-exporter/pkg/schemas"
"github.com/stretchr/testify/assert"
)
func TestPullRefPipelineJobsMetrics(t *testing.T) {
c, mux, srv := newTestController(co... |
// Package link provides a measured transport.Socket link
package link
import (
"io"
"sync"
"time"
"github.com/micro/go-micro/config/options"
"github.com/micro/go-micro/transport"
)
type link struct {
sync.RWMutex
// the link id
id string
// the remote end to dial
addr string
// channel used to close t... |
package main
import (
"bufio"
"encoding/csv"
"flag"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
)
func main() {
logDir := flag.String("dir", "/Volumes/data/Google Drive/archive/gh-logs", "")
flag.Parse()
err := processDir(*logDir)
if err != nil {
log.Fatal(err)
}
//log.Printf("%s", data)... |
package main
import (
"bufio"
"strings"
"fmt"
"os"
"os/exec"
"time"
)
/* Mongodb integration for saving Waypoints and other data. Break Server and Player command
/ parsers into seperate Go files for organization sake. Online time monitoring.
*/
func main() {
fmt.Println("< Minecraft Handler ... |
package engine
import (
"context"
"sort"
"time"
"github.com/windmilleng/tilt/internal/logger"
"github.com/windmilleng/tilt/internal/model"
"github.com/windmilleng/tilt/internal/ospath"
"github.com/windmilleng/tilt/internal/store"
)
type BuildController struct {
b BuildAndDeployer
lastAction... |
package main
import (
"embed"
"encoding/json"
"fmt"
"github.com/docopt/docopt-go"
"github.com/fatih/color"
"github.com/joeljunstrom/go-luhn"
"io/fs"
"net/http"
"os"
"regexp"
"strconv"
)
var buildNumber = "21.05"
type card struct {
Number string
Valid bool
Issuer string
MII string
PAN s... |
package types
import (
"fmt"
"strings"
"k8s.io/api/policy/v1beta1"
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
rbacV1APIVersion = "rbac.authorization.k8s.io/v1"
rbacAPIGroup = "rbac.authorization.k8s.io"
Role = "Role"
RoleBinding = "RoleBinding"
... |
package scraper
import (
"encoding/csv"
"fmt"
"github.com/antchfx/htmlquery"
"infoimprese-scraping-tool/decrypt"
"infoimprese-scraping-tool/request"
"infoimprese-scraping-tool/settings"
"infoimprese-scraping-tool/tree"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
"strconv"
"strings"
"time"
)
co... |
package server
import (
"encoding/json"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"sort"
"strings"
"github.com/dawsonalex/image-rest/imageservice"
"github.com/sirupsen/logrus"
)
// FilesHandler returns a http.HandlerFunc that accepts requests for an image stores
// file list.
func FilesH... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ssm
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type CreateResourceDataSyncInput struct {
_ struct{} `type:"structure"`
// Amazon S3 configuration details for the sync. This... |
package timer
import (
"fmt"
"github.com/duanhf2012/origin/log"
"github.com/duanhf2012/origin/util/sync"
"reflect"
"runtime"
"time"
)
// Timer
type Timer struct {
name string
cancelled bool //是否关闭
C chan *Timer //定时器管道
interval time.Duration // 时间间隔(用于循环定时器)
fireTime tim... |
package operator
import (
"encoding/json"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog"
"github.com/openshift/cluster-node-tuning-operator/pkg/util"
igntypes "github.com/coreos/ignition/v2... |
package app
import (
"container/list"
"context"
"sync"
"github.com/pkg/errors"
)
var errQueueFull = errors.New("queue full")
// multiLock allows a fixed number of Lock calls to succeed
// with a maximum ordered-queue.
type multiLock struct {
queue *list.List
lockCount int
maxLock int
maxWait int
lock... |
package xorm
import (
"fmt"
"sort"
"strings"
"github.com/xormplus/xorm/schemas"
)
type TagGenerator struct {
TypeTransformRule map[string]string // 类型转换规则 例如:int => int64
FieldTransformRule map[string]string // 字段类型转换规则(强制转换) 例如:created_at => time.Time
ColHandlerChain []ColumnHandler // 字段处理
Long... |
/*
Copyright NetFoundry, 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 writing, software
... |
package main
import (
"fmt"
"os"
"strings"
"github.com/BurntSushi/toml"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
"github.com/oasisprotocol/oasis-core/go/common"
"github.com/oasisprotocol/oasis-core/go/common/version"
"github.com/oasisprotocol/oasis-core/go/runtime/bundle"
)
const (
cargoToml... |
package fast
import (
"bytes"
"context"
"github.com/rjansen/haki"
"github.com/rjansen/haki/media/json"
"github.com/rjansen/haki/media/proto"
"github.com/rjansen/l"
"github.com/valyala/fasthttp"
"net/http"
"time"
)
//SimpleHTTPHandler is a contract for fast http handlers
type SimpleHTTPHandler interface {
Ha... |
package bidengine
import (
"bytes"
"context"
lifecycle "github.com/boz/go-lifecycle"
"github.com/ovrclk/akash/provider/cluster"
"github.com/ovrclk/akash/provider/event"
"github.com/ovrclk/akash/provider/session"
"github.com/ovrclk/akash/types"
"github.com/ovrclk/akash/util/runner"
"github.com/ovrclk/akash/va... |
// +build go1.5
package obf
import (
"crypto/rand"
"fmt"
)
const (
MASK_HI = 1
MASK_LO = 0
)
/*
I NEED TO DEFINE MASKs as a pair of byte constants..
const (
MASK0 = []byte { 0x55, 0x55 }
MASK1 = []byte { 0xf0, 0x0f }
MASK2 = []byte { 0x0f, 0xf0 }
)
*/
type ObfuscateError struct {
value int // t... |
package sporos
import (
"context"
"fmt"
"time"
shelmanv1alpha1 "github.com/shelmangroup/sporos/pkg/apis/shelman/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller... |
// Code generated by "stringer -output stringer.go -linecomment -type=Kind,Linkage"; DO NOT EDIT.
package cc
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Inval... |
package storage
import (
"fmt"
"io"
"hash"
"strings"
"io/ioutil"
"path/filepath"
"github.com/hyper-ml/hyperml/server/pkg/utils"
"github.com/hyper-ml/hyperml/server/pkg/base"
"github.com/hyper-ml/hyperml/server/pkg/config"
)
type ObjectType string
const (
Object ObjectType = "objects"
Log Ob... |
package ui
import (
"github.com/gpayer/pixelext/nodes"
"github.com/gpayer/pixelext/services"
"github.com/faiface/pixel/pixelgl"
"github.com/faiface/pixel"
)
type ButtonState int
const (
ButtonInit ButtonState = iota
ButtonEnabled
ButtonDisabled
ButtonHover
ButtonPressed
)
type Button struct {
UIBase
st... |
// Package traefikplugins
// Package plugindemo a demo plugin.
package traefikplugins
import (
"context"
"encoding/json"
"fmt"
"net/http"
"strings"
"github.com/juetun/traefikplugins/logic"
"github.com/juetun/traefikplugins/pkg"
"github.com/juetun/traefikplugins/pkg/permit_get"
)
var mapHandlerConfig = map[st... |
package daemon
import (
"errors"
"sync"
"time"
"fmt"
"math"
"github.com/Polarishq/middleware/framework/log"
"github.com/declanshanaghy/bbqberry/hardware"
)
// tickableIFC objects are executed in the background by a runner
type tickableIFC interface {
// start is called when the goroutine is starting up, bef... |
package plan
import (
"bytes"
"fmt"
"log"
"os/exec"
"path/filepath"
"strings"
"sourcegraph.com/sourcegraph/makex"
"sourcegraph.com/sourcegraph/srclib/buildstore"
"sourcegraph.com/sourcegraph/srclib/config"
"sourcegraph.com/sourcegraph/srclib/unit"
)
type Options struct {
ToolchainExecOpt string
// When... |
/*
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.