text stringlengths 3.08k 10.4k |
|---|
package main
import (
"fmt"
"log"
"os"
"time"
"github.com/gookit/color"
"github.com/gookit/goutil/strutil"
"github.com/qiangyt/jog/config"
"github.com/tj/go-naturaldate"
)
// OptionsT ...
type OptionsT struct {
LogFilePath string
ConfigFilePath string
Debug bool
ConfigItemPath string
Con... |
package object_test
import (
"bytes"
"io"
"io/ioutil"
"testing"
"time"
"github.com/ncw/rclone/fs"
"github.com/ncw/rclone/fs/hash"
"github.com/ncw/rclone/fs/object"
"github.com/stretchr/testify/assert"
)
func TestStaticObject(t *testing.T) {
now := time.Now()
remote := "path/to/object"
size := int64(1024)... |
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"errors"
"fmt"
"time"
"github.com/keybase/client/go/kbcrypto"
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
)
// Dev... |
/*
* Copyright 2019-2021 VMware, 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 w... |
package rainforest
import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"mime"
"net/http"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
"testing"
)
func TestGetUploadedFiles(t *testing.T) {
setup()
defer cleanup()
const reqMethod = "GET"
const testID = 1337
files := []upload... |
// 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 ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: infra/engine/driver/bigquery/proto/bigquery.proto
package proto
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... |
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
package bootstrapping
import (
"fmt"
"math"
"github.com/tuneinsight/lattigo/v3/ckks"
"github.com/tuneinsight/lattigo/v3/ckks/advanced"
"github.com/tuneinsight/lattigo/v3/rlwe"
)
// Bootstrapper is a struct to stores a memory pool the plaintext matrices
// the polynomial approximation and the keys for the bootst... |
package oscal
import (
"bytes"
"encoding/json"
"encoding/xml"
"errors"
"io"
"io/ioutil"
"github.com/docker/oscalkit/types/oscal/catalog"
"github.com/docker/oscalkit/types/oscal/profile"
yaml "gopkg.in/yaml.v2"
)
// OSCAL contains specific OSCAL components
type OSCAL struct {
XMLName xml.Name `json:... |
package grpc
import (
"context"
"math/rand"
"strings"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
// options struct
type Options struct {
Dial func(address string) (*grpc.ClientConn, error)
PoolModel i... |
package identity_store
import (
"encoding/json"
"github.com/raito-io/cli/common/api/identity_store"
"github.com/stretchr/testify/assert"
"io/ioutil"
"math/rand"
"os"
"strconv"
"testing"
"time"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func TestIdentityStoreFileCreator_Users(t *testing.T) {
tempFi... |
package pay
import (
"bytes"
"crypto/md5"
"encoding/hex"
"encoding/json"
"net/url"
"strconv"
"time"
"go-common/library/log"
"github.com/pkg/errors"
)
// Pay is.
type Pay struct {
ID string
Token string
OrderTTL int
NotifyURL string
RefundNotifyURL string
}
// Creat... |
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package main
import (
"fmt"
"os"
"path"
"github.com/cloudrecipes/lambda-wrapper/pkg/cli"
c "github.com/cloudrecipes/lambda-wrapper/pkg/commander"
f "github.com/cloudrecipes/lambda-wrapper/pkg/fs"
"github.com/cloudrecipes/lambda-wrapper/pkg/options"
s "github.com/cloudrecipes/lambda-wrapper/pkg/sourcer"
git "... |
package types
import (
"fmt"
"github.com/okex/exchain/libs/tendermint/libs/compress"
"github.com/spf13/viper"
"sync"
"time"
)
const (
// use delta from bcBlockResponseMessage or not
FlagApplyP2PDelta = "apply-p2p-delta"
// save into deltastore.db, and add delta into bcBlockResponseMessage
FlagBroadcastP2PDel... |
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"github.com/yaegashi/msgraph.go/jsonx"
"github.com/yaegashi/msgraph.go/msauth"
msgraph "github.com/yaegashi/msgraph.go/v1.0"
"golang.org/x/oauth2"
)
const (
defaultExtensionName = "dev.l0w.ssh_public_keys"
defaultT... |
package dtofactory
import (
"github.com/turbonomic/kubeturbo/pkg/discovery/repository"
"github.com/turbonomic/kubeturbo/pkg/discovery/util"
api "k8s.io/api/core/v1"
sdkbuilder "github.com/turbonomic/turbo-go-sdk/pkg/builder"
"github.com/turbonomic/turbo-go-sdk/pkg/proto"
"fmt"
"github.com/golang/glog"
"githu... |
package order_format
import (
"github.com/foxiswho/shop-go/models/session_models"
"github.com/foxiswho/shop-go/models/service_models/order_service_models"
"github.com/foxiswho/shop-go/models"
"github.com/foxiswho/shop-go/module/number"
"github.com/foxiswho/shop-go/dao/crud"
"github.com/foxiswho/shop-go/util"
"g... |
package endpoints
import (
"context"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"errors"
"net"
"net/url"
"testing"
"time"
"github.com/imkira/go-observer"
"github.com/sirupsen/logrus/hooks/test"
"github.com/spiffe/spire/pkg/common/bundleutil"
"github.com/spiffe/spire/pkg/server/svid"
"github.com/spiff... |
package phpfpm
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"sync"
"github.com/influxdb/telegraf/plugins"
)
const (
PF_POOL = "pool"
PF_PROCESS_MANAGER = "process manager"
PF_ACCEPTED_CONN = "accepted conn"
PF_LISTEN_QUEUE = "listen qu... |
package perceptron
import (
"compress/gzip"
"encoding/gob"
"fmt"
"io"
"math/rand"
"os"
"strings"
"time"
"github.com/schollz/progressbar/v3"
"github.com/bububa/jiagu/perceptron/model"
"github.com/bububa/jiagu/utils"
)
var (
DefaultStarts = []string{"-START-", "-START2-"}
DefaultEnds = []string{"-END-"... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudformation
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudformation/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp ... |
// Copyright 2022 anoweb Author. 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 2020 The Shipwright 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... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/type/semantic_version.proto
package envoy_type
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = p... |
package smf
import (
"fmt"
"math"
"time"
)
var (
_ TimeFormat = MetricTicks(0)
_ TimeFormat = TimeCode{}
)
// TimeFormat is the common interface of all SMF time formats
type TimeFormat interface {
String() string
timeformat() // make the implementation exclusive to this package
}
// TimeCode is the SMPTE tim... |
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package cloud
import (
"bytes"
"context"
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"sync"
"time"
"github.com/jonboulle/clockwork"
"github.com/tilt-dev/tilt/internal/cloud/cloudurl"
"github.com/tilt-dev/tilt/internal/store"
"github.com/tilt-dev/tilt/internal/token"
"github.com/tilt-dev/tilt/pkg/lo... |
package filesystem
import (
"bufio"
"github.com/pivotal-cf/scantron"
"github.com/pivotal-cf/scantron/scanlog"
"os"
"path/filepath"
"regexp"
"sync"
)
type WalkedFile struct {
Path string
Info os.FileInfo
RegexMatches []scantron.RegexMatch
}
type FileConfig struct {
ExcludedPaths []string
R... |
package service
import (
"errors"
"fmt"
"github.com/360EntSecGroup-Skylar/excelize"
"go-admin/app/plugins/content/models"
"go-admin/app/plugins/content/service/dto"
"go-admin/common/core/sdk/service"
"gorm.io/gorm"
"time"
"go-admin/common/actions"
cDto "go-admin/common/dto"
)
type Article struct {
service... |
/**
* 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 main
import (
"github.com/hyperledger/fabric/core/chaincode/shim"
"fmt"
"github.com/hyperledger/fabric/protos/peer"
"encoding/json"
"bytes"
)
type CouchDBChaincode struct {
}
func(t *CouchDBChaincode) Init(stub shim.ChaincodeStubInterface)peer.Response {
return shim.Success(nil)
}
func (t *CouchDBCh... |
package catalog
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"reflect"
"testing"
"github.com/golang/mock/gomock"
"github.com/redhat-developer/odo/pkg/preference"
"github.com/redhat-developer/odo/pkg/testingutil/filesystem"
)
func TestGetDevfileRegistries(t *testing.T) {
tempConfigFile, err := i... |
package aop
import (
"encoding/gob"
"strconv"
"testing"
"time"
"fmt"
"github.com/darciopacifico/enablecache/cache"
"github.com/op/go-logging"
"math/rand"
"os"
"sync"
)
var (
cacheAreaAuto = "dyna_test:" + strconv.Itoa(int(time.Now().Unix()))
cacheStorageRedis = cache.NewRedisCacheStorage("localhost:6379"... |
// 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 content
import (
"context"
"fmt"
"strings"
"sync"
"github.com/pkg/errors"
"github.com/kopia/kopia/repo/blob"
)
// IterateOptions contains the options used for iterating over content
type IterateOptions struct {
Range IDRange
IncludeDeleted bool
Parallel int
}
// IterateCallback is t... |
package hstspreload
import (
"errors"
"net/http"
"net/url"
"strings"
)
const (
// The maximum number of redirects when you visit the root path of the
// domain over HTTP or HTTPS.
maxRedirects = 3
httpsScheme = "https"
)
// preloadableHTTPRedirects checks for two kinds of issues:
//
// 1. General HTTP redir... |
// Quo Vadis is a really simple and fast HTTP router
package quo_vadis
import (
"io"
"net/http"
"strings"
)
type endpoint struct {
handler http.Handler
parameters []string
}
type node struct {
methodEndpoints map[string]*endpoint
staticBranches map[string]*node
parameterBranch *node
}
type Router struct... |
/*
Copyright 2019 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 egin
import (
"context"
"fmt"
"io"
"net"
"net/http"
"strings"
"sync"
"time"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
"github.com/gotomicro/ego/core/constant"
"github.com/gotomicro/ego/core/elog"
"github.com/gotomicro/ego/server"
)
const PackageName = "server.egin"
// Component ... |
package server
import (
"encoding/json"
"fmt"
"github.com/parvez0/metric-ingestion/custom_logger"
"github.com/parvez0/metric-ingestion/objects"
sqlite_db "github.com/parvez0/metric-ingestion/sqlite-db"
"io"
"net"
"net/http"
"os"
)
var clog = custom_logger.NewLogger()
var db = sqlite_db.CreateDbConnection()
v... |
package statedb
import (
"encoding/json"
"fmt"
"reflect"
"github.com/incognitochain/incognito-chain/common"
)
type Pdexv3PoolPairOrderRewardState struct {
tokenID common.Hash
nftID string
value uint64
}
func (state *Pdexv3PoolPairOrderRewardState) Value() uint64 {
return state.value
}
func (state *Pdex... |
// Copyright 2018 the membuffers authors
// This file is part of the membuffers library in the Orbs project.
//
// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
// The above notice should be included in all copies or substantial portions of the s... |
// Copyright 2017 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 main
import (
"testing"
"golang.org/x/build/dashboard"
)
func TestBuildersExist(t *testing.T) {
for _, b := range builds {
_, ok := dashboard.Bu... |
package main
import (
"bytes"
"encoding/json"
"errors"
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
"time"
"code.google.com/p/go-uuid/uuid"
"github.com/coreos/go-log/log"
)
// Prediction is the parsed result from the Python worker
type Prediction struct {
ModelID string `json:"model_id"`... |
// Copyright 2018 The go-python 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 pytest
import (
"bytes"
"io"
"os"
"path"
"path/filepath"
"strings"
"testing"
"github.com/go-python/gpython/compile"
"github.com/go-py... |
package asm
import (
"fmt"
"github.com/llir/ll/ast"
"github.com/llir/llvm/internal/enc"
"github.com/llir/llvm/ir/metadata"
"github.com/pkg/errors"
)
// irMetadataAttachments returns the IR metadata attachments corresponding to
// the given AST metadata attachments.
func (gen *generator) irMetadataAttachments(ol... |
// Code generated by protoc-gen-go.
// source: user.proto
// DO NOT EDIT!
/*
Package user is a generated protocol buffer package.
It is generated from these files:
user.proto
It has these top-level messages:
UserRequest
UserResponse
*/
package user
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"... |
package alog
import (
"bytes"
"errors"
"fmt"
"time"
"unicode"
)
func NewLayout(format string) (*Layout, error) {
l := &Layout{}
if err := l.Parse(format); err != nil {
return nil, err
}
return l, nil
}
// 解析规则:%{width}key[params],例如,%t,%2p,%c[yyyy-MM-ddTHH:mm:ss]
// %% %
// %m log message
// %L full log ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: yandex/cloud/mdb/redis/v1/resource_preset.proto
package redis
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 _... |
package signer
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"github.com/gracenoah/tezos-hsm-signer/signer/watermark"
)
// Server holds all configuration data from the signer
type Server struct {
signer Signer
keys []Key
bindString string
filter Operation... |
package main
import (
"github.com/gin-gonic/gin"
r "github.com/qsock/qim/api_gateway/controller"
_ "github.com/qsock/qim/api_gateway/docs"
"github.com/qsock/qim/lib/ginproxy"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
func SetRoute(e *gin.Engine) {
e.Any("/", ginproxy.O... |
package webhook
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/google/go-github/v43/github"
"github.com/openshift-pipelines/pipelines-as-code/pkg/cli"
"github.com/openshift-pipelines/pipelines-as-code/pkg/cli/prompt"
"github.com/openshift-pipelines/p... |
/***
Copyright 2020 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
d... |
package sysdialogs
import (
"fmt"
"strings"
"github.com/containers/podman-tui/ui/dialogs"
"github.com/containers/podman-tui/ui/utils"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
"github.com/rs/zerolog/log"
)
const (
formFieldHasFocus = 0 + iota
textviewHasFocus
)
// EventsDialog implements system... |
/*
Copyright 2021 The KCP 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, softwar... |
package beeorm
import (
"errors"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"net/url"
"strings"
)
// 封装一层 getAll 获取列表 ,方便使用
func GetAll(c *beego.Controller, model interface{}, contains interface{}, defaultLimit int64) (err error) {
f, err := BuildFilter(c, defaultLimit)
if err != nil {
return
... |
package link
import (
"fmt"
"github.com/mp-hl-2021/lenkeforkortelse/internal/domain/link"
"github.com/mp-hl-2021/lenkeforkortelse/internal/domain/status"
"math/rand"
"time"
"unsafe"
)
const (
linkLength = 6
letterIdxBits = 6
letterIdxMask = 1<<letterIdxBits - 1
letterIdxMax = 63 / letterIdxBits
letterB... |
package cherrygo
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
"net/url"
"os"
"strconv"
)
const (
libraryVersion = "2.0.0"
apiURL = "https://api.cherryservers.com/v1/"
cherryAuthTokenVar = "CH<PASSWORD>Y_AUTH_TOKEN"
mediaType = "ap... |
package radiko
import (
"encoding/base64"
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/YuheiNakasaka/radiorec/config"
"github.com/YuheiNakasaka/radiorec/internal/filemanager"
"github.com/YuheiNakasaka/radiorec/internal/r... |
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package log
import (
"log"
"os"
"path"
)
// Writer defines methods to write and configure tkg writer
type Writer interface {
// Write writes message to stdout/stderr, logfile and sends to the channel if channel is set
//... |
package types
import (
"testing"
"github.com/stretchr/testify/require"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func TestParamKeyTable(t *testing.T) {
require.NotNil(t, ParamKeyTable())
}
func TestValidateVotePeriod(t *testing.T) {
err := validateVotePeriod("invalidUint64")
require.ErrorContains(t, err, "i... |
package obj3d
import (
"io"
"bufio"
"bytes"
"os"
)
const (
WS = byte(' ')
T = '\t'
BS = 64 // bitSize for strconv.Parse
)
var (
WSS = []byte{' '} // whitespace separator
WT = []byte{'\t'} // table separator
SL = []byte{'/'} // table separator
)
// prototype
type Obj struct {
Name *string
Shapes *[]Sh... |
package github
import (
"context"
"fmt"
"github.com/sirupsen/logrus"
"github.com/updatecli/updatecli/pkg/core/result"
"github.com/shurcooL/githubv4"
)
// Source retrieves a specific version tag from Github Releases.
func (g *Github) Source(workingDir string) (value string, err error) {
versions, err := g.Sea... |
// Copyright 2018 The LevelDB-Go and Pebble 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 pebble
import (
"encoding/binary"
"fmt"
"io/ioutil"
"sync"
"sync/atomic"
"testing"
"time"
"github.com/cockroachdb/pebble/in... |
// Code generated by go-swagger; DO NOT EDIT.
package stickers
// 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/runtim... |
package local
import (
"fmt"
"sync"
clienterrors "github.com/open-policy-agent/frameworks/constraint/pkg/client/errors"
"github.com/open-policy-agent/frameworks/constraint/pkg/core/templates"
"github.com/open-policy-agent/frameworks/constraint/pkg/regorewriter"
"github.com/open-policy-agent/opa/ast"
)
// Compi... |
package main
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"os/exec"
"path/filepath"
"runtime/pprof"
"strings"
"time"
"github.com/zgg-lang/zgg-go/parser"
"github.com/zgg-lang/zgg-go/repl"
"github.com/zgg-lang/zgg-go/runtime"
_ "github.com/go-sql-driver/mysql"
)
var (
BUILD_TIME = "N/A"
BUILD_HASH ... |
//go:build !windows
// +build !windows
package rootless
import (
"io/ioutil"
"net"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/pkg/errors"
"github.com/rootless-containers/rootlesskit/pkg/child"
"github.com/rootless-containers/rootles... |
// 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"... |
package common
import (
"errors"
"fmt"
"github.com/keep94/finance/fin"
"github.com/keep94/finance/fin/categories"
"github.com/keep94/toolbox/date_util"
"github.com/keep94/toolbox/http_util"
"html/template"
"net/url"
"strconv"
"strings"
"time"
)
const (
kMaxSplits = 10
)
var (
// Error for date being wro... |
// Copyright (c) 2021 Terminus, 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 agree... |
package generator
import (
"elljo/compiler/js-parser/ast"
"elljo/compiler/parser"
"strconv"
)
type ElseIfBlock struct {
entry *parser.Entry
name string
renderer string
variable string
}
func (self *Generator) VisitIf(children parser.Entry, current *Fragment) *Fragment {
self.ifCounter++
name := "ifBl... |
package netserver
import (
"fmt"
"log"
"strings"
"github.com/caddyserver/caddy"
"github.com/caddyserver/caddy/caddyfile"
"github.com/caddyserver/caddy/caddytls"
)
const serverType = "net"
// directives for the net server type
// The ordering of this list is important, host need to be called bef... |
package wework
import (
"encoding/json"
"fmt"
"github.com/go-laoji/wecom-go-sdk/internal"
)
type Message struct {
ToUser string `json:"touser,omitempty" validate:"omitempty,required_without=ToParty ToTag"`
ToParty string `json:"toparty,omitempty" validate:"omitempty,required_withou... |
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"math"
"os"
"sort"
"strconv"
)
type SharePrice struct {
ticker string
price float64 // Current share' price
}
type ShareDividend struct {
ticker string
dividend float64 // dividend in USD per share
tax float64 // tax for this particular share... |
/*
Copyright 2014 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 gorelic
import (
"errors"
"fmt"
"log"
"net/http"
metrics "github.com/yvasiyarov/go-metrics"
"github.com/yvasiyarov/newrelic_platform_go"
)
const (
// DefaultNewRelicPollInterval - how often we will report metrics to NewRelic.
// Recommended values is 60 seconds
DefaultNewRelicPollInterval = 60
// ... |
package crd
import (
"time"
"github.com/pkg/errors"
"github.com/solo-io/gloo/pkg/api/types/v1"
"github.com/solo-io/gloo/pkg/storage"
crdclientset "github.com/solo-io/gloo/pkg/storage/crd/client/clientset/versioned"
crdv1 "github.com/solo-io/gloo/pkg/storage/crd/solo.io/v1"
apiexts "k8s.io/apiextensions-apiserv... |
package core
import (
"context"
"fmt"
"time"
"github.com/opctl/opctl/sdks/go/opspec/interpreter/call/loop"
"github.com/opctl/opctl/sdks/go/opspec/interpreter/call/loop/iteration"
"github.com/opctl/opctl/sdks/go/opspec/interpreter/call/parallelloop"
"github.com/opctl/opctl/sdks/go/opspec/interpreter/loopable"
... |
// Package gdb interacts with thegamedb.net's API.
//
// Example:
// resp, err := gdb.GetGame(GGReq{ID: "5"})
package gdb
import (
"encoding/xml"
"fmt"
"net/http"
"net/url"
)
const (
GDBURL = "http://thegamesdb.net"
GGPath = "/api/GetGame.php"
GGLPath = "/api/GetGamesList.php"
CGDBURL = "https://stevensel... |
package scaleway
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"runtime/debug"
"strings"
"time"
"github.com/TimothyYe/godns/internal/settings"
"github.com/TimothyYe/godns/internal/utils"
"github.com/TimothyYe/godns/pkg/notification"
log "github.com/sirupsen/logrus"
)
var (
Sca... |
// Author <NAME>
// License MIT
// SerialForwarder connection library.
package sfconnection
import "net"
import "fmt"
import "strconv"
import "bufio"
import "io"
import "time"
import "errors"
import "sync"
import "sync/atomic"
import "github.com/proactivity-lab/go-loggers"
type Packet interface {
Dispatch() byte... |
// Copyright (c) 2018 Northwestern Mutual.
//
// 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, p... |
package service
import (
// "encoding/base64"
"fmt"
// "log"
// "io"
// "net/http"
"os"
"strconv"
"time"
echosession "github.com/go-session/echo-session"
"github.com/labstack/echo"
"github.com/cloud-barista/cb-webtool/src/model"
)
var SpiderURL = os.Getenv("SPIDER_URL")
var TumbleBugURL = os.Getenv("TUMB... |
package ocicrypt_keyprovider
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/json"
"fmt"
"github.com/containers/ocicrypt/keywrap/keyprovider"
cLog "github.com/intel-secl/intel-secl/v4/pkg/lib/common/log"
ocicrypt_keyprovider "github.com/intel-secl/intel-secl/v4/pkg/model/ocicrypt"
"github.com/in... |
package job
import (
"context"
"errors"
"fmt"
"sync/atomic"
"time"
"github.com/odpf/salt/log"
"github.com/robfig/cron/v3"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/store"
"github.com/odpf/optimus/utils"
)
const (
deployAssignInterval = "@every 1m"
)
type... |
// Copyright (c) 2018 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the cod... |
// SPDX-FileCopyrightText: 2020-2021 SAP SE or an SAP affiliate company and Cloud Security Client Go contributors
//
// SPDX-License-Identifier: Apache-2.0
package env
import (
"encoding/json"
"fmt"
"github.com/google/uuid"
"gopkg.in/yaml.v3"
"os"
"path"
)
const iasServiceName = "identity"
const iasSecretKeyDe... |
package ujson_test
import (
"testing"
. "github.com/olvrng/ujson"
)
type quoteTest struct {
in string
out string
ascii string
graphic string
}
var quotetests = []quoteTest{
{"\a\b\f\r\n\t\v", `"\a\b\f\r\n\t\v"`, `"\a\b\f\r\n\t\v"`, `"\a\b\f\r\n\t\v"`},
{"\\", `"\\"`, `"\\"`, `"\\"`},
{"abc\xffde... |
// This file is part of MinIO Direct CSI
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) an... |
package storage
import (
"context"
"encoding/base64"
"fmt"
"hash/crc32"
"io"
"net/http"
"strconv"
"github.com/qiniu/x/bytes.v7"
"github.com/qiniu/x/rpc.v7"
"github.com/qiniu/x/xlog.v7"
)
// ResumeUploader 表示一个分片上传的对象
type ResumeUploader struct {
client *rpc.Client
cfg *Config
}
// NewResumeUploader 表... |
package odoo
import (
"fmt"
)
// BaseAutomation represents base.automation model.
type BaseAutomation struct {
LastUpdate *Time `xmlrpc:"__last_update,omptempty"`
ActionServerId *Many2One `xmlrpc:"action_server_id,omptempty"`
Active *Bool `xmlrpc:"active,omptempty"`
BindingModelId... |
// Copyright (c) 2019, The Emergent 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 navenv
import (
"github.com/emer/emergent/erand"
"github.com/goki/ki/kit"
"github.com/goki/mat32"
)
// Policy provides a parameterized d... |
// Copyright (c) 2019-2029 DY All Rights Reserved.
//
// Author : yangping
// Email : <EMAIL>
//
// Prismy.No | Date | Modified by. | Description
// -------------------------------------------------------------------
// 00001 2020/10/30 yangping New version
// --------------------------------------... |
// Code generated by go-swagger; DO NOT EDIT.
package private
// 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.com/... |
package monitor
import (
"github.com/Vientiane/scheduler"
"time"
"github.com/Vientiane/errors"
"fmt"
"golang.org/x/net/context"
"runtime"
"encoding/json"
)
//用于监控调度器
//参数:scheduler 代表作为监控目标的调度器
//参数:checkInterval 代表监控时间间隔,单位:纳秒
//参数:summarizeInterval 代表摘要获取的时间间隔 单位:纳秒
//参数:maxIdleCount 代表最大空闲计数
//参数:autoStop 用... |
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) 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
*
* ... |
package macro
import (
"fmt"
"github.com/jamespfennell/typesetting/pkg/tex/context"
"github.com/jamespfennell/typesetting/pkg/tex/errors"
"github.com/jamespfennell/typesetting/pkg/tex/expansion"
"github.com/jamespfennell/typesetting/pkg/tex/token"
"github.com/jamespfennell/typesetting/pkg/tex/tokenization/catcod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.