text stringlengths 3.08k 10.4k |
|---|
// Copyright 2016-present Liferay, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package filter
import (
"github.com/henvic/wedeploy-sdk-go/geo"
"github.com/henvic/wedeploy-sdk-go/qrange"
)
// Filter is a map with the filter data
t... |
package dstore
import (
"hash/fnv"
"sync"
)
const (
// 最少保留 MINKEYS/count 的 key 在某一个节点上
MINKEYS = 1
)
// 一致性哈希变种
type Partition struct {
sync.RWMutex
count int
offsets []int
}
/* --- Partition -------------------------------------------------------------- */
func NewPartition(count int, nodesNum int) *Par... |
package handlers
import (
"context"
"encoding/json"
"net/http"
"time"
"github.com/gorilla/websocket"
"github.com/sirupsen/logrus"
"github.com/id-tarzanych/lets-go-chat/api/wss"
"github.com/id-tarzanych/lets-go-chat/db/message"
"github.com/id-tarzanych/lets-go-chat/db/token"
"github.com/id-tarzanych/lets-go... |
package query
import (
"reflect"
"github.com/yaoapp/xun/dbal"
)
// Join Add a join clause to the query.
func (builder *Builder) Join(table string, first interface{}, args ...interface{}) Query {
operator, second := builder.joinPrepare(args...)
return builder.join(dbal.NewName(table), "", first, operator, second... |
package agent
import (
"context"
"github.com/go-logr/logr"
"github.com/google/uuid"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
"net/http"
ctrl "sigs.k8... |
package normalize
import (
"encoding/csv"
"errors"
"log"
"os"
"strconv"
"sync"
"time"
"github.com/kiteco/kiteco/kite-go/lang/python/pythoncomplete/api"
"github.com/kiteco/kiteco/kite-go/lang/python/pythoncomplete/pythonproviders"
"github.com/kiteco/kiteco/kite-go/response"
"github.com/kiteco/kiteco/kite-go... |
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
/**
* Copyright 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 ... |
package router
import (
"basic-antd/api"
"basic-antd/api/upload"
"basic-antd/middleware"
handler2 "basic-antd/middleware/handler"
"basic-antd/pkg/jwt"
"github.com/gin-gonic/gin"
)
func initAppRouter(r *gin.Engine, auth *jwt.GinJWTMiddleware) *gin.RouterGroup {
var (
g = r.Group("")
authGroup = r.Gr... |
package day10
import (
"context"
"fmt"
"math/big"
"os"
"sort"
"strconv"
"strings"
"github.com/segwin/adventofcode-2020/internal/input"
)
type Solution struct{}
func (s *Solution) Run(ctx context.Context, inputFile string) {
scanner, err := input.NewFileScanner(ctx, inputFile)
if err != nil {
fmt.Printf(... |
// +build binary_log
package zerolog
// This file contains bindings to do binary encoding.
import (
"time"
"github.com/rs/zerolog/internal/cbor"
)
func appendInterface(dst []byte, i interface{}) []byte {
return cbor.AppendInterface(dst, i)
}
func appendKey(dst []byte, s string) []byte {
return cbor.AppendKey(... |
package tcsh
import (
"os"
"os/exec"
"path/filepath"
"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/fileutils"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/osutils"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/i... |
package views
import "time"
// VideoViews provides access to the Mux Data Video Views API
type VideoViews struct{}
// ListData is the data in the response from the List method
type ListData struct {
ViewerOSFamily string `json:"viewer_os_family"`
ViewerApplicationName string `json:"viewer_applicat... |
// Copyright 2014 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris <EMAIL>
package service
import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"time"... |
package dispatch
import (
"github.com/changsongl/delay-queue/bucket"
"github.com/changsongl/delay-queue/job"
"github.com/changsongl/delay-queue/pkg/log"
"github.com/changsongl/delay-queue/pool"
"github.com/changsongl/delay-queue/queue"
"github.com/changsongl/delay-queue/timer"
"github.com/prometheus/client_gola... |
// Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
// Copyright 2017 The Cockroach 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... |
//(C) Copyright [2020] Hewlett Packard Enterprise Development LP
//
//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 a... |
package validate
import (
"fmt"
"io"
"log"
"regexp"
"strings"
"github.com/Knetic/govaluate"
"github.com/danielecook/still/src/output"
"github.com/danielecook/still/src/reader"
"github.com/danielecook/still/src/schema"
"github.com/danielecook/still/src/utils"
"github.com/logrusorgru/aurora"
)
func isNil(va... |
package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] != ' ' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
return i
}
func readNum(scanne... |
package main
import (
"io/ioutil"
"log"
"os"
"path/filepath"
"runtime"
"sync"
"lec/lecimg"
"lec/lecio"
"lec/lecpdf"
"lec/leczip"
)
type IWork interface {
Run() bool
IsQuit() bool
}
// Work contains an information of image file to process
type Work struct {
dir string
filename string
destDir str... |
// This file is part of CycloneDX GoMod
//
// 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 bsh
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
)
const (
mageVerboseEnvVar = "MAGEFILE_VERBOSE"
)
type Bsh struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
DisableColor bool
fnErr func(error)
echoFilters []string
// defaults to Mage's verbose flag, ... |
package meta
import "time"
type flickrVisibility string
const (
// FlickrPublic means that the photo is visible to the public.
FlickrPublic flickrVisibility = "public"
// FlickrPrivate means that the photo is not visible to the public,
// It may also be visible to friends, family, or both.
FlickrPrivate = "pri... |
package group
import (
"encoding/json"
"fmt"
"net/http"
"regexp"
"sync"
"time"
"github.com/openshift/managed-cluster-validating-webhooks/pkg/webhooks/utils"
admissionv1 "k8s.io/api/admission/v1"
admissionregv1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apima... |
package m2mpdb
import (
"encoding/json"
"github.com/gocql/gocql"
"log"
"time"
)
const DEBUG = false
const DATE_FORMAT = "2006-01-02"
func indexTSDate(i, d, t string) {
// We need to make it better: create a go routine that will get it, index last stored value (to avoid doing it again), and store it
shared.ses... |
package main
import (
"errors"
"fmt"
"io/ioutil"
"log"
"os"
fp "path/filepath"
"github.com/spf13/pflag"
)
const usageString = `Usage: passgen [OPTION]... [FILE]...
passgen is a simple, configurable password generator.
Available Options:
-i, --include {clns} Character GROUPS to include.
-l, ... |
package step
import (
"context"
"fmt"
v1 "github.com/mmlt/environment-operator/api/v1"
"strings"
"sync"
"time"
)
// Step is an unit of execution.
type Step interface {
Meta
// Execute a step.
Execute(context.Context, []string)
}
// Meta is behaviour that all steps have in common.
type Meta interface {
GetI... |
package eap
import (
"crypto/rand"
"crypto/subtle"
"encoding"
"encoding/binary"
"fmt"
"github.com/theaaf/radius-server/eap/mschapv2"
)
type MSCHAPv2 struct {
OpCode int
Id int
Data []byte
}
func NewMSCHAPv2(Id int, op interface{}) (*MSCHAPv2, error) {
ret := &MSCHAPv2{
Id: Id,
}
var err error
... |
// Package digest contains functions to simplify handling content digests.
package digest
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"os"
"regexp"
"strconv"
"strings"
"github.com/golang/protobuf/proto"
repb "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
)
var (
// hexStringRe... |
package node
import (
"context"
"crypto/ecdsa"
"fmt"
"io"
"github.com/ethereum/go-ethereum/common"
"github.com/sonm-io/core/blockchain"
"github.com/sonm-io/core/insonmnia/auth"
"github.com/sonm-io/core/insonmnia/benchmarks"
"github.com/sonm-io/core/insonmnia/matcher"
"github.com/sonm-io/core/insonmnia/npp"
... |
package docker
import (
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strings"
"github.com/docker/distribution/manifest/schema2"
"github.com/heroku/docker-registry-client/registry"
)
type ImageIdentifiers struct {
Repository string
Tag string
}
var Reg... |
package bus
import (
"database/sql"
"fmt"
"log"
"strings"
"transport/lib/nulltypes"
"github.com/lib/pq"
"gopkg.in/guregu/null.v3"
)
// Constants
const AverageDistanceBetweenStops = 317
// StopDistances
type StopDistance struct {
RouteID string
DirectionID int
FromID string
ToID string
D... |
package engine
import (
"errors"
"fmt"
"github.com/storozhukBM/verifier"
"sync"
"time"
log "github.com/sirupsen/logrus"
)
type Configuration struct {
Name string
Parameters Parameters
Certificates Certificates
Scenarios []Scenario
}
type Parameters struct {
NoOfRequest int
NoOfWarmupR... |
package gtmetrix
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type TestRequest struct {
Data struct {
Type string `json:"type"`
Attributes TestRequestParams `json:"attributes"`
} `json:"data"`
}
type TestRequestParams struct {
//The URL of the page to test
Url string ... |
package resources
import (
routeV1 "github.com/openshift/api/route/v1"
"github.com/stackrox/rox/pkg/sync"
v1 "k8s.io/api/core/v1"
k8sLabels "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
)
type routeRef struct {
namespace string
name string
}
// serviceStore stores service objects (by n... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
log "github.com/sirupsen/logrus"
)
type Config struct {
WdaFolder string `json:"wda_folder"`
BundleidCompanion string `json:"bundleid_companion"`
Network NetConfig `json:"network"`
Stf STFConfig... |
// Copyright 2015 - 2016 Square 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 ... |
// Copyright 2021 Dolthub, 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 proxy
import (
"context"
"net/http"
"sort"
"strconv"
"github.com/rancher/steve/pkg/accesscontrol"
"github.com/rancher/steve/pkg/attributes"
"github.com/rancher/steve/pkg/schemaserver/types"
"golang.org/x/sync/errgroup"
"k8s.io/apimachinery/pkg/util/sets"
)
type filterKey struct{}
func AddNamespaceC... |
package emgorm
import (
"errors"
"github.com/go-emix/utils"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"gopkg.in/yaml.v3"
"os"
"strconv"
"strings"
"time"
)
type DbSet map[string]*gorm.DB
var _dbs = DbSet{}
var DefaultPageCount int64 = 10
func GetDb(name string) *gorm.DB {
return _... |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
package diagnostics
import (
"context"
"encoding/hex"
"fmt"
"net/textproto"
"regexp"
"strconv"
"strings"
"... |
package rogger
import (
"io"
"os"
"sync"
"time"
)
// Params type is used to pass to WithParams
type Params map[string]interface{}
// Level type
type Level uint32
// convert level to a string
func (l Level) String() string {
switch l {
case DebugLevel:
return "debug"
case InfoLevel:
return "info"
case Wa... |
/*
* 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 ... |
// Copyright (c) 2018 The Biodv Authors.
// All rights reserved.
// Distributed under BSD2 license that can be found in the LICENSE file.
//
// Originally written by <NAME> <<EMAIL>>.
package cmdapp
import (
"bufio"
"fmt"
"io"
"os"
"sort"
"strings"
"sync"
"unicode"
"unicode/utf8"
"github.com/pkg/errors"
)
... |
package indieauth
import (
"errors"
"fmt"
"net/http"
urlpkg "net/url"
"strings"
)
var (
ErrInvalidCodeChallengeMethod error = errors.New("invalid code challenge method")
ErrInvalidGrantType error = errors.New("grant_type must be authorization_code")
ErrNoMatchClientID error = errors.New("... |
// Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
// isula-build licensed under the Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS ... |
// Code generated by go-swagger; DO NOT EDIT.
package file
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"io"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/st... |
package incrdump
import (
"encoding/binary"
"fmt"
"strings"
"time"
. "github.com/go-mysql-org/go-mysql/mysql"
"github.com/go-mysql-org/go-mysql/replication"
"github.com/shopspring/decimal"
)
var (
emptyUnsignedMap = map[int]bool{}
emptyEnumStrValueMap = map[int][]string{}
emptySetStrValueMap = map[int... |
package src
import (
"encoding/json"
"fmt"
pluginDriver "github.com/brokercap/Bifrost/plugin/driver"
"github.com/gmallard/stompngo"
"log"
"net"
"strconv"
"strings"
"time"
)
const VERSION = "v1.6.0"
const BIFROST_VERION = "v1.6.0"
func init() {
pluginDriver.Register("ActiveMQ", NewConn, VERSION, BIFROST_VER... |
// Package conformance is a test suite for testing CLI parsing into jsonnext
// data structures. It can be used to check conformance of a CLI parsing
// implementation.
package conformance
import (
"strings"
"testing"
"foxygo.at/s/test"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
... |
package tomox_state
import (
"encoding/json"
"errors"
"github.com/tomochain/tomochain/crypto"
"math/big"
"time"
"github.com/tomochain/tomochain/common"
)
const (
OrderCacheLimit = 10000
)
var (
EmptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
Ask = "SEL... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sagemaker
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCompilationJobsRequest
type Li... |
/*
Copyright IBM Corp. 2016 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 wri... |
package main
import (
"fmt"
"net/http"
"os"
"strings"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ses"
"golang.org/x/net/html"
)
func scrape(url string, ch chan FoundW... |
package internal
import (
"context"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"fmt"
"io"
"math/big"
"net"
"time"
quic "github.com/lucas-clemente/quic-go"
)
var (
// PeerQuicProtocol quic peer protocl
peerQuicProtocol = []string{"quic-peer"}
)
type quicServer struct {
Cancla... |
// 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 model
// 0 0 0 0 0 0 处理中
// 0 0 0 0 x 1 已发送
// 0 0 0 0 1 x 已回调
// 0 0 0 1 0 0 已屏蔽
// 0 0 1 0 0 0 被收敛
// 0 1 0 0 x 0 无接收人
// 1 0 0 0 x 0 升级发送
const (
FLAG_SEND = iota
FLAG_CALLBACK
FLAG_MASK
FLAG_CONVERGE
FLAG_NONEUSER
FLAG_UPGRADE
)
const (
STATUS_DOING = "doing" // 处理中
STATUS_SEND = "send"... |
package model
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/qianxiaoming/lightsched/util"
)
// TaskState 表示Task的状态
type TaskState int32
const (
// TaskQueued 任务等待调度
TaskQueued TaskState = iota
// TaskScheduled 任务已经分配到某个节点
TaskScheduled
// TaskDispatching 任务正在被分发到调度的节点
TaskDispatching
// TaskExec... |
package main
import (
"bufio"
"bytes"
"errors"
"fmt"
"log"
"os"
"os/exec"
"runtime"
"strings"
"sync"
"github.com/urfave/cli/v2"
)
const (
NULL uint8 = 0
LOG uint8 = 1
STDOUT uint8 = 2
STDERR uint8 = 3
PASS uint8 = 4
ECHO uint8 = 5
)
type logStruct struct {
isError bool
command []string
... |
package dao
import (
"database/sql"
"leeBlogCli/definition"
"log"
"strconv"
"strings"
)
// 搜索标签并附带含有对应标签的文章ID
func (s *DBServer) SelectTagsWithArticleID() (c definition.CategoryWithArticleIDListResult, err error) {
rows, err := s.DB.Queryx("SELECT * FROM category;")
if err != nil {
log.Printf("%v", err)
}
... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package kernel
import (
"fmt"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/astaxie/beego"
"github.com/astaxie/beego/config"
"github.com/astaxie/beego/context"
"github.com/astaxie/beego/logs"
"github.com/gadelkareem/go-helpers"
)
const (
Dev = ... |
/*
** Copyright [2012-2014] [Megam Systems]
**
** 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 autotest
import (
"bufio"
"fmt"
"math"
"regexp"
"strconv"
"strings"
"github.com/logrusorgru/aurora"
)
var Println = fmt.Println
var Printf = fmt.Printf
var Print = fmt.Print
// PrintTest is used to print a single test results to the console
func PrintTest(result *TestResult) {
margin := (80 - len(re... |
package fiat
import (
"context"
"encoding/json"
"testing"
"time"
"github.com/shopspring/decimal"
"github.com/stretchr/testify/require"
)
// TestCoinCapGetPrices tests splitting of a query period into the number of
// requests required to obtain the desired granularity.
func TestCoinCapGetPrices(t *testing.T) {... |
///usr/bin/env true; exec /usr/bin/env go run "$0" "$@"
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
)
const (
red = "\033[1;31m"
green = "\033[1;32m"
blue = "\033[1;34m"
yellow = "\033[1;33m"
reset = "\033[0;0m"
)
var (
searchExpr ... |
package main
import (
"flag"
"fmt"
"go/ast"
"go/parser"
"go/types"
"os"
"path/filepath"
"strings"
"golang.org/x/tools/go/loader"
"github.com/gojuno/generator"
)
type (
options struct {
InputFile string
OutputFile string
InterfaceName string
SourceTypeName string
Package string
... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// A configuration for CloudWatch monitoring. You can configure your jobs to send
// log information to CloudWatch Logs.
type CloudWatchMonitoringConfiguration struct {
// The na... |
/* (c) 2019, Blender Foundation - <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, pub... |
package validate
import (
"errors"
"fmt"
"reflect"
"strings"
"time"
)
type (
// Validator holding the tag name and taglists available
Validator struct {
TagName string
ValidatorFns map[string]validatorFn
}
validatorTag struct {
Name string
Param string
Fn validatorFn
}
validatorRespons... |
/*
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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... |
// 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.
package store
import (
"context"
"errors"
"fmt"
"math/rand"
"sort"
"sync"
"time"
)
// MemStore is an in-memory implementation of Store, for testing.
ty... |
package store
import (
"github.com/zhukovaskychina/xmysql-server/server/common"
"github.com/zhukovaskychina/xmysql-server/server/innodb/buffer_pool"
"github.com/zhukovaskychina/xmysql-server/server/innodb/innodb_store/store/storebytes/segs"
"github.com/zhukovaskychina/xmysql-server/server/innodb/tuple"
"github.co... |
/*
Copyright 2021 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... |
/*
Package varparse implements functions to create variable declarations
and references from syntax trees.
License
Governed by a 3-Clause BSD license. License file may be found in the root
folder of this module.
Copyright © 2017–2021 <NAME> <<EMAIL>>
*/
package varparse
import (
"github.com/npillmayer/gorgo/ter... |
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package t8ntool
import (
"encoding/json"
"errors"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core/types"
)
var _ ... |
package querynode
import (
"context"
"fmt"
"path"
"strconv"
"sync"
grpcquerynodeclient "github.com/milvus-io/milvus/internal/distributed/querynode/client"
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/proto/querypb"
"github.com/milvus-io/milvus/internal/util"
"github.com/m... |
// Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
package lambda
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"reflect"
"github.com/aws/aws-lambda-go/lambda/handlertrace"
)
type Handler interface {
Invoke(ctx context.Context, payload []byte) ([]byte, error)
}
type hand... |
package main
import (
"fmt"
"golang.org/x/net/context"
"google.golang.org/appengine/datastore"
"google.golang.org/appengine/log"
"hash/fnv"
"time"
)
/* When a user "checks in" at a location, we load existing route info
* and also want to keep track of new/changed routes created/edited
* during checkin.
*/
ty... |
/*
* MinIO Cloud Storage, (C) 2019 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... |
/*
Copyright 2021 The Crossplane 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 jlibhttp
import (
"context"
"encoding/json"
//log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/superisaac/jlib"
"net/http"
"strings"
"testing"
"time"
)
func TestWSHandlerClient(t *testing.T) {
assert := assert.New(t)
rootCtx, cancel := context.WithCancel(context.Ba... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package firecampdockerlog
import (
"context"
"encoding/binary"
"fmt"
"io"
"os"
"path/filepath"
"sync"
"syscall"
"time"
"github.com/Sirupsen/logrus"
"github.com/cloudstax/firecamp/pkg/plugins/log/awslogs"
"github.com/docker/docker/api/types/plugins/logdriver"
"github.com/docker/docker/daemon/logger"
prot... |
//Package gateserver strcut
package gateserver
import (
tcore "TCore"
tnet "TNet"
tp "TProtocol"
"encoding/binary"
"time"
)
type LogType uint8
const (
LT_DEBUG LogType = 0
LT_LOG LogType = 1
LT_WARNING LogType = 2
LT_ERROR LogType = 3
)
func _LOG(aType LogType, aFormat string, aParms ...interface{}... |
package parser
import (
"bytes"
"fmt"
"strings"
"github.com/tomlaflamme/Sip-Go/log"
)
// The error returned by the GetNextChunk and GetNextLine methods of Parserbuffer
// when the buffer has ben stopped.
var ERR_BUFFER_STOPPED error = fmt.Errorf("Parser has stopped")
// The number of writes to the buffer that c... |
package ff
import (
"flag"
"fmt"
"math/rand"
"os"
"path/filepath"
"testing"
"time"
)
func TestParsePriority(t *testing.T) {
type want struct {
s string
i int
b bool
d time.Duration
}
for _, testcase := range []struct {
name string
args []string
file string
env map[string]string
want want... |
package hook
import (
"encoding/json"
"fmt"
"github.com/devspace-cloud/devspace/pkg/devspace/kubectl"
"github.com/mgutz/ansi"
"io"
"os"
"strings"
"github.com/devspace-cloud/devspace/pkg/devspace/config/versions/latest"
"github.com/devspace-cloud/devspace/pkg/util/command"
logpkg "github.com/devspace-cloud/d... |
/*
* Copyright 2018 The microkube 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 ... |
package controller
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"time"
"github.com/daheige/gomux/app/config"
"github.com/daheige/gomux/app/helper"
"github.com/gomodule/redigo/redis"
"github.com/gorilla/mux"
)
// IndexController index ctrl.
type IndexController struct{}
// Home hom... |
package main
import (
"fmt"
"os"
"path"
)
// instrment for sparse-read pattern
func instrumentControllerForSparseRead(controller_runtime_filepath string) {
// Mainly two pieces of instrumentation we should do for sparse-read:
// In controller.go, we need to invoke NotifySparseReadBeforeReconcile before calling R... |
package main
import (
"flag"
"io"
"io/ioutil"
"log"
"math"
"net"
"net/http"
"sort"
"strings"
"time"
)
type Request struct {
Method string
URL string
Body string
BodyType string
}
type SampleSettings struct {
SampleSize int
RequestTimeout time.Duration
NThrowaways int
}
type indexT... |
package cmdexport
import (
"context"
"encoding/json"
"os"
"strconv"
"strings"
"time"
"github.com/hashicorp/go-hclog"
"github.com/pinpt/agent/cmd/cmdexport/process"
"github.com/pinpt/agent/pkg/commitusers"
"github.com/pinpt/agent/pkg/expin"
"github.com/pinpt/agent/pkg/expsessions"
"github.com/pinpt/agent/r... |
package bolt
import (
"fmt"
"math"
)
// Force - type of force
type Force float64
func (f Force) String() string {
return fmt.Sprintf("%.1f kN", float64(f)*1e-3)
}
// Factor - type of factors
type Factor float64
func (f Factor) String() string {
return fmt.Sprintf("%.3f", float64(f))
}
// ανThreadShear - facto... |
package election
import (
"fmt"
"strings"
"sync"
"github.com/FactomProject/factomd/electionsCore/imessage"
"github.com/FactomProject/factomd/electionsCore/messages"
"github.com/FactomProject/factomd/electionsCore/primitives"
)
// Display is a 2D array containing all the votes seen by all leaders
type Display ... |
package stadium
import (
"time"
log "github.com/Sirupsen/logrus"
)
//Handles unverified distribution phase
func (vz *VZServer) handleUnverifiedDistributionPhase(distPhase int, args *MessageBatchArgs) {
defer vz.timer.trackDist(distPhase, time.Now())
if distPhase == mailboxdist {
//Handle threshold decryption
... |
// Package extract provides provides functions for working with compressed files
/*
* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
*/
package extract
import (
"archive/zip"
"io"
"github.com/NVIDIA/aistore/cmn"
"github.com/NVIDIA/aistore/memsys"
jsoniter "github.com/json-iterator/go"
)
var (
_... |
package main
import (
"fmt"
"sort"
"github.com/budavariam/advent_of_code/2018/utils"
)
func main() {
data := utils.LoadInput("13_2")
result := LastCartLocation(data)
fmt.Println(result)
}
//LastCartLocation simulates the ride and gets the location of the last standing cart
func LastCartLocation(input []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 iot
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.