text
stringlengths
3.08k
10.4k
package main import ( "bytes" "fmt" //"strconv" "strings" "time" "live_server/common" "strconv" ) func benchmarkStringFunction(n int, index int) (d time.Duration) { v := "ni shuo wo shi bu shi tai wu liao le a?" var s string var buf bytes.Buffer t0 := time.Now() for i := 0; i < n; i++ { switch index {...
package mailer import ( "fmt" cmn "github.com/vit1251/golden/pkg/common" "github.com/vit1251/golden/pkg/config" "github.com/vit1251/golden/pkg/eventbus" "github.com/vit1251/golden/pkg/mailer/cache" "github.com/vit1251/golden/pkg/mapper" "github.com/vit1251/golden/pkg/registry" "log" "strconv" "time" ) type ...
package systemd import ( "bytes" "fmt" "os" "os/exec" "strconv" "strings" "testing" "github.com/msaf1980/relaymon/pkg/checker" "github.com/msaf1980/relaymon/pkg/linuxproc" ) func getServicePID(t *testing.T, service string) int64 { cmd := exec.Command("sh", "-c", fmt.Sprintf("/bin/systemctl status %s | gr...
package geoip import ( "errors" "log" "net" "net/http" "strconv" "strings" "github.com/caddyserver/caddy" "github.com/caddyserver/caddy/caddyhttp/httpserver" "github.com/mmcloughlin/geohash" "github.com/oschwald/maxminddb-golang" ) // GeoIP represents a middleware instance type GeoIP struct { Next ht...
// // Copyright (c) 2014-2019 Cesanta Software Limited // 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 // // Un...
package main import ( "bytes" "encoding/base64" "encoding/json" "fmt" "io/ioutil" "net/http" "os" "strings" "github.com/joho/godotenv" "github.com/urfave/cli/v2" "github.com/ybbus/jsonrpc/v2" ) var Version = "dev" var envFile = "../conf/.env" var COINS = map[string]string{ "btc": "5000", "ltc": "5001"...
// +build windows package fs import ( "fmt" "os" "path/filepath" "syscall" "unsafe" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" ) // Fslock : lock a file type Fslock struct { FileName string handle syscall.Handle } var ( modkernel32 = syscall.NewLazyDLL("kernel32.dll") // https://docs.micro...
package client /* 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 ...
// Copyright © 2013-2018 <NAME> <<EMAIL>> // Use of this file is governed by the license that can be found in LICENSE. package main import ( "errors" "io" "os" "path/filepath" "sort" "strconv" "sync" "time" "github.com/yookoala/realpath" ) // Basename is like filepath.Base but do not strip the trailing sla...
package knxproj import ( "encoding/xml" "io/ioutil" "log" ) type ManufacturerData map[string]string func parseManufacturerData(path string) ManufacturerData { xmlFile, err := ioutil.ReadFile(path) if err != nil { log.Fatal("Error reading file:", err) } var q ManufacturerData2 err = xml.Unmarshal(xmlFile, ...
package main import ( "bufio" "flag" "fmt" "github.com/pkg/errors" "io" "log" "os" "regexp" "strings" ) const ( sZero = "z" sAll = "a" ) func digitsOnly(n string) string { tobeString := n // Get digits only re := regexp.MustCompile("[0-9]") digits := re.FindAllString(n, -1) tobeString = strings.Join...
package main import ( "bytes" "crypto/tls" "crypto/x509" "encoding/json" "encoding/pem" "errors" "fmt" "github.com/gorilla/websocket" "io/ioutil" "net/http" "os" "regexp" "strconv" ) type Api struct { OauthToken string UserAgent string Config *Config } type Hateos struct { Rel string `json:"re...
/** * Copyright 2022 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requir...
package gointerfacer import ( "bytes" "fmt" "go/ast" "go/build" "go/parser" "go/printer" "go/token" "path/filepath" "strconv" "strings" "golang.org/x/tools/imports" ) // FindInterface returns the import path and identifier of an interface. // For example, given "http.ResponseWriter", FindInterface returns...
/* * Copyright (c) 2018-2021 Codenotary, Inc. All Rights Reserved. * This software is released under Apache License 2.0. * The full license information can be found under: * https://www.apache.org/licenses/LICENSE-2.0 * */ package bundle import ( "fmt" "strings" "github.com/dustin/go-humanize" "github.com/...
// // Author:: <NAME> (<<EMAIL>>) // Copyright:: Copyright 2020, Lacework Inc. // License:: Apache License, Version 2.0 // // 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://ww...
package identity import ( "context" "encoding/json" "io/ioutil" "net/http" "strings" "github.com/ONSdigital/dp-api-clients-go" "github.com/ONSdigital/dp-api-clients-go/headers" "github.com/ONSdigital/dp-rchttp" "github.com/ONSdigital/go-ns/common" "github.com/ONSdigital/log.go/log" "github.com/pkg/errors"...
package cftracker import ( "errors" "github.com/cloudfoundry-community/go-cfclient" "github.com/dgruber/drmaa2interface" "github.com/dgruber/drmaa2os/pkg/helper" "github.com/dgruber/drmaa2os/pkg/jobtracker/cftracker/fakes" "time" ) // clientwrapper interface declares methods of cfclient.Client which // are used...
package main import ( "bytes" "fmt" "html/template" "io/ioutil" "log" "net/http/httptest" "reflect" "testing" "time" rediscounter "github.com/slavrd/go-redis-counter" ) // TestNewHandler passes a mock function that returns a known *counterCtx. // It then calls the resulting http.Handler and checks the resp...
// //Created by xuzhuoxi //on 2019-03-18. //@author xuzhuoxi // package binaryx import ( "strconv" ) type ValueKind uint8 //简单类型定义 const ( KindNone ValueKind = iota KindBool KindInt8 KindInt16 KindInt32 KindInt64 KindUint8 KindUint16 KindUint32 KindUint64 KindFloat32 KindFloat64 KindComplex64 KindComp...
/* * SPDX-FileCopyrightText: 2022-present Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ package gnmi_utils import ( "context" "fmt" "github.com/gogo/protobuf/proto" configapi "github.com/onosproject/onos-api/go/onos/config/v2" "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnm...
package cmd import ( "io" "time" "github.com/jenkins-x/jx/pkg/apis/jenkins.io/v1" "github.com/jenkins-x/jx/pkg/client/clientset/versioned" "github.com/jenkins-x/jx/pkg/gits" "github.com/jenkins-x/jx/pkg/kube" "github.com/jenkins-x/jx/pkg/log" "github.com/jenkins-x/jx/pkg/util" "github.com/spf13/cobra" "gopk...
// Use of this software is governed by an Apache 2.0 // licence which can be found in the license file package bplustree import ( "bplustree/common" "fmt" "sort" "github.com/golang/glog" ) // treeNodeElem -- This structure represent each element in the slice/array // within a treeNode. If the treeNode is a lea...
package main import ( "archive/tar" "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "os" "path/filepath" "strconv" "strings" "github.com/pkg/errors" ) const ( PortEnvVar = "PORT" ApiKeysEnvVar = "VALID_API_KEYS" MessageLimitEnvVar = "MESSAGE_LIMIT" RequiredEnvVarNotSetErrorFor...
package server import ( "fmt" "strings" "path" "os" "bufio" "io" "bytes" remotepath "path" srv "github.com/pkg/sftp" "golang.org/x/crypto/ssh" ) type sftp struct { client *srv.Client conn *ssh.Client basepath string } // Connect to the SFTP server. func ConnectSsh(cfg Params) (*sftp, error) { var...
// 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 network import ( "context" "time" "github.com/golang/protobuf/ptypes/empty" "chromiumos/tast/common/network/diag" "chromiumos/tast/erro...
package chunkymonkey import ( "bytes" "fmt" "log" "math/rand" "net" "regexp" "time" "github.com/huin/chunkymonkey/command" . "github.com/huin/chunkymonkey/entity" "github.com/huin/chunkymonkey/gamerules" "github.com/huin/chunkymonkey/nbt" "github.com/huin/chunkymonkey/player" "github.com/huin/chunkymonke...
// // server + client for tcpconn nonblocking read/write test package main import ( "flag" "fmt" "net" "os" "os/signal" "runtime" "sync/atomic" "syscall" "time" "lowlevel/extnet" ) var exit_signal int64 = 0 var chunklen int = 4096 // max group length is 1024, limit by writev syscall var groupNum int = ...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Creates a saved query in a parent project/fo...
package docspec import ( "fmt" "io" ) /* DocSpec is a DSL for rendering rectangle-based layouts. While it currently targets PDF rendering, any backend (think, SDL, image formats, HTML) could theoretically be constructed that walks the document tree and follows the spec laid out by the current PDF renderer. The fu...
package timezh import "bytes" type format struct { mixed bool day uint8 dayPoint uint8 month uint8 monthPoint uint8 pm uint8 pmPoint uint8 buf *bytes.Buffer } func (f *format) init(s string) { f.day = 0 f.dayPoint = 1 f.month = 0 f.monthPoint = 1 f.pm = 0 f.pmPoint ...
// Copyright 2020 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License...
/* Author => <NAME> Email => <EMAIL> Date => 3-1-2022 */ package main import ( "C" "crypto/tls" "errors" "net/http" "net/url" "regexp" "strings" "unsafe" "github.com/gocolly/colly" ) func StartCrawler(url string, threads int, depth int, subsInScope bool, insecure bool, rawHeaders string) []string { //...
package main import ( "errors" "fmt" "github.com/Masterminds/semver" "go/build" "golang.org/x/net/html" "golang.org/x/net/html/atom" "log" "net/http" "os" "os/user" "path/filepath" "regexp" "runtime" "sort" "strings" ) const ( VersionsUrl = "https://golang.org/dl/" DownloadPrefix = "/dl/go" ) con...
package pig 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 ( peggyBirthday = nook.Birthday{ Day: 23, Month: ...
// Provide string-matching based on fnmatch.3 package fnmatch // There are a few issues that I believe to be bugs, but this implementation is // based as closely as possible on BSD fnmatch. These bugs are present in the // source of BSD fnmatch, and so are replicated here. The issues are as follows: // // * FNM_PERIOD...
package binarytree import ( "testing" "github.com/stretchr/testify/assert" ) func TestIntKeyLessThan(t *testing.T) { x := IntKey(1) y := IntKey(2) z := IntKey(3) a := IntKey(-5) assert.True(t, x.LessThan(y)) assert.True(t, x.LessThan(z)) assert.False(t, x.LessThan(a)) assert.False(t, x.LessThan(x...
package middleware import ( "Togo/utils" "errors" "github.com/dgrijalva/jwt-go" "github.com/gin-gonic/gin" "strings" "time" ) // 参考: https://godoc.org/github.com/dgrijalva/jwt-go // 实践: https://www.jianshu.com/p/1f9915818992 const ( //正常 TokenOK = 200 //异常 TokenError = 400 //头字段认证信息缺失 TokenMissHeader = 4...
package stores import ( "fmt" "strconv" "strings" ) const mapSeparator = "__map_" const listSeparator = "__list_" // flattenAndMerge flattens the provided value and merges into the // into map using prefix func flattenAndMerge(into map[string]interface{}, prefix string, value interface{}) { flattenedValue := fla...
package main import ( "encoding/csv" "fmt" "io/ioutil" "strings" "github.com/spf13/cast" "github.com/tidwall/gjson" ) func main() { m1 := read("./a.csv") read1("./g.csv", m1) // read1("./c.csv", m1) } // 游戏读取数据,读取游戏配置数据 func read(fileName string) map[string]string { cntb, err := ioutil.ReadFile(fileName) ...
package approver import ( "context" "crypto/sha256" "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/acm" "github.com/aws/aws-sdk-go/service/acm/acmiface" "github.com/aws/aws-sdk-go/service/route53...
// Code generated by go-swagger; DO NOT EDIT. package widget_types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github...
package main import ( "context" "encoding/json" "fmt" "github.com/midtrans/midtrans-go" "github.com/midtrans/midtrans-go/coreapi" "github.com/midtrans/midtrans-go/example" "net/http" ) var c coreapi.Client func setupGlobalMidtransConfigApi() { midtrans.ServerKey = example.SandboxServerKey1 // change value t...
// MIT License // // Copyright (c) 2021 <NAME> and EASE lab // // 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,...
package lib import ( "fmt" "strings" ) const ( pdBdevType = "000" pdLvsType = "001" vdBeBdevType = "002" vdFeNvmeType = "003" aggBdevType = "004" daLvsType = "005" secNvmeType = "006" grpBdevType = "007" raid0BdevType = "100" beNqnPrefix = "be" feNqnPrefix = "fe" expNqnPrefix = "ex...
package scrapers import ( "context" "crypto/sha1" "encoding/json" "fmt" "math/rand" "net/url" "os" "strings" "sync" "time" "github.com/gocolly/colly" "github.com/google/uuid" tspb "google.golang.org/protobuf/types/known/timestamppb" pb "github.com/attilaolah/cad-rs/proto" ) const ( eKatFindObj = eKa...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: yandex/cloud/endpoint/api_endpoint.proto package endpoint import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = m...
/* Copyright 2018 Google LLC /* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
package main import ( "encoding/json" "fmt" "errors" "io/ioutil" "net/http" "net/url" "strings" "os" extapi "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" "github.com/jets...
package main import ( "encoding/base64" "encoding/json" "log" "net" "net/http" "strings" "github.com/hossner/bankid" "github.com/rs/xid" "github.com/gorilla/websocket" ) // bidConn holds the connection with the server var bidConn *bankid.Connection // queueToClient is used to transfer messages from server...
// Copyright (c) 2021 Teal.Finance // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. package rainbow import ( "strconv" "strings" ) const ( // digitsInFractionalPart is the number of digits to keep in the fracti...
package main import ( "bufio" "fmt" "os" "runtime" "github.com/viveknathani/maketest/pkg/exporter" "github.com/viveknathani/maketest/pkg/generators" "github.com/viveknathani/maketest/pkg/utils" ) const ( asciiLogo = ` __ __ _______ ___ _ _______ _______ _______ _______ _______ | |_| || _ ...
package agglos import ( "bytes" "encoding/hex" "errors" "fmt" "io" "math/rand" "os" "strings" "github.com/proofrock/snapkup/model" "github.com/proofrock/snapkup/util" ) func Plan(modl *model.Model, treshold, target int64) (agglos map[string][]string, blobs map[string]model.AggloRef, err err...
package main import ( "context" "flag" "fmt" "log" "net" "os" "os/signal" "sync" "sync/atomic" "time" tcp "github.com/tevino/tcp-shaker" ) // Counter is an atomic counter for multiple metrics. type Counter struct { counters map[int]*uint64 } // NewCounter creates Counter with given IDs. func NewCounter(...
package lsp // WatchKind defines the kind of the file system watcher. type WatchKind int const ( // WKCreate means the watcher is interested in create events. WKCreate WatchKind = 1 << iota // WKChange means the watcher is interested in change events. WKChange // WKDelete means the watcher is interested in del...
package webhook import ( "context" "encoding/json" "fmt" policyv1beta1 "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1" "github.com/loft-sh/jspolicy/pkg/metrics" "github.com/loft-sh/jspolicy/pkg/util/compress" "github.com/loft-sh/jspolicy/pkg/util/loghelper" "github.com/loft-sh/jspolicy/pkg/vm/vmpool" "g...
//go:build linux // +build linux package main import ( "fmt" "os" "path/filepath" "regexp" "strings" "golang.org/x/sys/unix" ) const ( // A line of self/mountinfo has the following structure: // 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue // (0) (1) (2) (3) (4) ...
package main import ( "crypto/tls" "flag" "fmt" "github.com/grepplabs/kafka-proxy/plugin/local-auth/shared" "github.com/hashicorp/go-multierror" "github.com/hashicorp/go-plugin" "github.com/sirupsen/logrus" "gopkg.in/ldap.v2" "net" "net/url" "os" "strings" ) //TODO: connection pooling, credential caching ...
package TokenManager import ( "crypto/tls" "crypto/x509" "encoding/json" "errors" "fmt" "io/ioutil" "log" "net/http" "net/http/httputil" "os" "strings" ) // ReadToken reads either given token file or string and return the token func ReadToken(r string) string { if _, err := os.Stat(r); err == nil { b, e...
package config import ( "context" "testing" "time" "github.com/devjoes/github-runner-autoscaler/apiserver/pkg/runnerclient" runnerv1alpha1 "github.com/devjoes/github-runner-autoscaler/operator/api/v1alpha1" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/m...
package v2 // Source: https://github.com/pivotal-golang/s3cli // Copyright (c) 2013 <NAME> and <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 with...
package ckks import ( "errors" "fmt" "github.com/ldsec/lattigo/utils" "math" ) // Parameters is a struct storing the necessary parameters to instantiate a new ckkscontext. // // logN : the ring degree such that N = 2^logN // // modulichain : a list of moduli in bit size, such that prod(moduli) <= logQ, where logQ...
package dtree import ( "fmt" "math" "strings" pbc "github.com/davedotdev/proto/eddie/proto_common" ) var ( // UnFoldCount is exported because of an intra-package error UnFoldCount int // UnFoldCountTN is exported because of an intra-package error UnFoldCountTN int ) const ( debugPrint = false ) // Yes, I'...
// Copyright 2021 The Prometheus 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...
package fhslib import ( // "bytes" // "encoding/binary" // "bufio" // "crypto/md5" // "fmt" "github.com/golang/snappy" // "io" "regexp" ) // read from conn, decode data, write to conn type RequestDecoder struct { id string key string } type ResponseDecoder struct { id string key string } type Decoder ...
package client import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "sync" "github.com/akutz/goof" "golang.org/x/net/context/ctxhttp" "github.com/rexray/rexray/libstorage/api/context" "github.com/rexray/rexray/libstorage/api/types" ) type headerKey int const ( transactionHeaderKey headerK...
package dbsession import ( "time" dbr "github.com/gocraft/dbr" "github.com/kyma-incubator/compass/components/kyma-environment-broker/internal" "github.com/kyma-incubator/compass/components/kyma-environment-broker/internal/storage/dberr" "github.com/kyma-incubator/compass/components/kyma-environment-broker/intern...
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package config import ( "bytes" "fmt" "io/ioutil" "os" "runtime" "github.com/rs/zerolog" "github.com/spf13/viper" ) const ( Version = "0.2" Title = "HellPot" ) var ( // BindAddr is defined via our toml configuration file. It is the address that HellPot listens on. BindAddr string // BindPort is define...
package sessions import ( "context" "fmt" "net/http" "net/http/httptest" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/pomerium/pomerium/internal/cryptutil" "github.com/pomerium/pomerium/internal/encoding/ecjson" "gopkg.in/square/go-jose.v2/jwt" ) func TestNewContext(t *testing.T) ...
package tezos import ( "github.com/spf13/viper" "github.com/trustwallet/blockatlas/coin" "github.com/trustwallet/blockatlas/pkg/blockatlas" "github.com/trustwallet/blockatlas/pkg/errors" services "github.com/trustwallet/blockatlas/services/assets" "math" "strconv" "time" ) type Platform struct { client Cl...
package contractmanager import ( "encoding/binary" "errors" "sync" "sync/atomic" "github.com/pachisi456/sia-hostdb-profiles/build" "github.com/pachisi456/sia-hostdb-profiles/crypto" "github.com/pachisi456/sia-hostdb-profiles/modules" ) var ( // errDiskTrouble is returned when the host is supposed to have eno...
//go:build ignore // +build ignore package main import ( "bytes" "fmt" "go/format" "io" "io/ioutil" "path" "path/filepath" "runtime" "strings" "github.com/danielbaenabird/fyne/v2" ) const fontFace = "NotoSans" const fileHeader = "// auto-generated\n" + // to exclude this file in goreportcard (it has to b...
package amqp import ( "bytes" "context" "text/template" "github.com/golang/protobuf/proto" "github.com/pkg/errors" log "github.com/sirupsen/logrus" pb "github.com/brocaar/chirpstack-api/go/v3/as/integration" "github.com/lovlar-cyber/chirpstack-application-server/internal/config" "github.com/lovlar-cyber/chi...
// +build unit package tsdbtest import ( "go/build" "os" "path/filepath" "strings" "testing" "github.com/v3io/v3io-tsdb/pkg/config" "github.com/stretchr/testify/assert" ) func createTestConfig(t *testing.T, path string) { fullPath := filepath.Join(path, config.DefaultConfigurationFileName) _, err := os.Cre...
/* Copyright 2019 The OpenEBS Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
/* 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 unde...
// Copyright 2019 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...
// Copyright 2020 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...
// Copyright hyperjumptech/grule-rule-engine 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 ap...
package metronome import ( "time" ) const apiTimeFormat = "2006-01-02T15:04:05.000-0700" const notAvailable = "N/A" // Job represents a Job returned by the Metronome API. type Job struct { ID string `json:"id"` Description string `json:"description"` Labels map[string]string `...
// Copyright 2015 CoreOS, 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...
package request import ( "context" "fmt" "io" "io/ioutil" "log" "net/http" "testing" "time" "github.com/stretchr/testify/require" ) func clientEncoder(v interface{}) (reader io.Reader, e error) { return nil, nil } func ExampleClientRequest_Query() { ctx := context.TODO() req, err := NewRequest(ctx, With...
package difficulty type Modifier int64 const ( None = Modifier(iota) NoFail = Modifier(1 << (iota - uint(1))) Easy TouchDevice Hidden HardRock SuddenDeath DoubleTime Relax HalfTime Nightcore // Only set along with DoubleTime. i.e: NC only gives 576 Flashlight Autoplay SpunOut Relax2 // Autopilot Pe...
/* Copyright 2015 The Kubernetes 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 ag...
package server import ( "context" "crypto/tls" "net/http" "net/http/pprof" "sync" "sync/atomic" "time" "go.uber.org/zap" "github.com/prometheus/client_golang/prometheus/promhttp" ) const ( serverReadTimeout = 5 * time.Second serverWriteTimeout = 10 * time.Second serverIdleTimeout = 15 * time.Second s...
/** * Copyright 2019 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: message.proto /* Package message is a generated protocol buffer package. It is generated from these files: message.proto It has these top-level messages: Msg */ package message import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math ...
/* * AMF Configuration Factory */ package factory import ( "time" "github.com/free5gc/logger_util" "github.com/free5gc/openapi/models" ) const ( AMF_EXPECTED_CONFIG_VERSION = "1.0.2" ) type Config struct { Info *Info `yaml:"info"` Configuration *Configuration `yaml:"configuratio...
package state import ( "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethState "github.com/ethereum/go-ethereum/core/state" ethTypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "gith...
// Copyright Istio Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wri...
package rest import ( "github.com/eyebluecn/tank/code/core" "github.com/eyebluecn/tank/code/tool/i18n" "github.com/eyebluecn/tank/code/tool/result" "github.com/eyebluecn/tank/code/tool/util" jsoniter "github.com/json-iterator/go" "net/http" "strconv" ) type PreferenceController struct { BaseController prefer...
/* * Copyright 2020 The FATE 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 a...
// Copyright 2020 <NAME>. 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...
// Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package files import ( "testing" repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/json" ...
// // Copyright (c) 2014-2019 Cesanta Software Limited // 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 // // Un...
/* * ZCrypto Copyright 2017 Regents of the University of Michigan * * 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 appl...
package agent import ( "strings" "unicode/utf8" "github.com/pkg/errors" "github.com/havoc-io/mutagen/pkg/prompt" ) // unameSToGOOS maps uname -s output values to their corresponding GOOS values. // Although some Windows environments (Cygwin, MSYS, and MinGW) support uname, // their values are handled by unameSI...
/////////////////////////////////////////// // Copyright(C) 2020 // Author : <NAME> // Version: 0.0.1 /////////////////////////////////////////// package service_test import ( "digger/crawler" "digger/models" "digger/services/service" "fmt" "github.com/hetianyi/gox/logger" "os" "testing" ) func TestPluginServi...
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...