text stringlengths 3.08k 10.4k |
|---|
package mangarock
import (
"encoding/json"
"net/http"
"net/url"
"github.com/pkg/errors"
)
const (
// APIURL is the mangarock api url
APIURL = "https://api.mangarockhd.com/query/web401"
// APIMETAURL is mangarock's meta url
APIMETAURL = "https://api.mangarockhd.com/meta"
)
// Client is the mangarock client
... |
package server
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"testing"
gapi "github.com/grafana/grafana-api-golang-client"
"github.com/kanopy-platform/grafana-auth-proxy/internal/jwt"
"github.com/kanopy-platform/grafana-auth-proxy/pkg/config"
"github.com/kanopy-platform/gr... |
package main
import (
"fmt"
"image"
"sort"
"time"
"github.com/fogleman/gg"
)
// https://pdfs.semanticscholar.org/3249/7c1c6c2783d39caf31451a9ef2ffec16ee16.pdf
// https://www.sciencedirect.com/science/article/pii/030505489400070O
func main() {
postmanProblem()
}
func postmanProblem() {
start := time.Now()
... |
package main
import (
"fmt"
"io"
"net/http"
"os"
"time"
"contrib.go.opencensus.io/exporter/stackdriver"
"google.golang.org/api/option"
"google.golang.org/genproto/googleapis/api/monitoredres"
"cloud.google.com/go/compute/metadata"
"cloud.google.com/go/storage"
log "github.com/sirupsen/logrus"
"go.opencen... |
package service
import (
"context"
"io"
"log"
"time"
"github.com/br3w0r/gamelist-backend/entity"
pb "github.com/br3w0r/gamelist-backend/proto"
"github.com/br3w0r/gamelist-backend/repository"
utilErrs "github.com/br3w0r/gamelist-backend/util/errors"
"golang.org/x/crypto/bcrypt"
"google.golang.org/grpc"
)
ty... |
package cmd
import (
"errors"
"fmt"
"strings"
"github.com/jinzhu/copier"
"github.com/spf13/cobra"
"github.com/alajmo/mani/core"
"github.com/alajmo/mani/core/dao"
"github.com/alajmo/mani/core/exec"
)
func execCmd(config *dao.Config, configErr *error) *cobra.Command {
var runFlags core.RunFlags
var setRunFl... |
// Copyright 2019 <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... |
// Package cmd ...
package cmd
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/spf13/cobra"
)
var (
// vars
version = "0.0.2" //
// flags
debug bool // debug output
extension string // final file extention (.md)
output string // output/directory/path
// strategy string ... |
package pkg
import (
"bufio"
"errors"
"fmt"
"log"
"math"
"os"
"regexp"
"strconv"
"strings"
)
type GPSMeasureGetFunc func(measurement GPSMeasurement) float64
func ReadData(config DataConfig) (*TrackData, error) {
trackInfo, measures, err := readTrackMeasures(config.InputFile)
if err != nil {
return nil, ... |
package main
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"github.com/drone/drone-plugin-go/plugin"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"time"
)
var debug bool
type WebHook struct {
Timestamp int64
Images []string
Namespace string
Source string
Target string
Url string
... |
package gamerules
import (
"errors"
"expvar"
"chunkymonkey/nbtutil"
"chunkymonkey/physics"
"chunkymonkey/proto"
. "chunkymonkey/types"
"nbt"
)
var (
expVarMobSpawnCount *expvar.Int
)
func init() {
expVarMobSpawnCount = expvar.NewInt("mob-spawn-count")
}
// When using an object o... |
package upload
import (
"context"
"errors"
"fmt"
"io"
"mime"
"mime/multipart"
"net/http"
"net/textproto"
"path/filepath"
"strings"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"gitlab.com/gitlab-org/gitlab/workhorse/internal/log"
"gitlab.co... |
package cmd
// This file defines fusionWriter and fusionReader. Type fusionWriter dumps
// GeneDB and Fragment into a recordio file, and fusionReader reads them back.
// The recordio file can be used to bypass the 1st phase of the af4 and run only
// the filtering phase.
import (
"bufio"
"bytes"
"context"
"encodi... |
// Copyright 2021 iLogtail 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 ... |
package main
import (
"context"
"errors"
"fmt"
"io"
"log"
"net"
"os"
"os/signal"
"strings"
"syscall"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
pb "streamtest/service"
)
func main() {
// Start the server
srv := &RPCServer{}
srv.Init()
go... |
/*
* Copyright (C) 2018 The ontology Authors
* This file is part of The ontology library.
*
* The ontology 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, or
* (a... |
// Code generated by qtc from "page.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
package views
import (
"sumbur/views/static"
)
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
type HTML inter... |
package operator
import (
"github.com/beard1ess/gauss/parsing"
"reflect"
"fmt"
"strconv"
)
func recursion(
original interface{},
modified interface{},
path *[]string,
ObjectDiff *parsing.ConsumableDifference,
) error {
// everything equals so why continue
if reflect.DeepEqual(original, modified) {
retu... |
package service
import (
"github.com/pierrre/mangadownloader/utils"
"code.google.com/p/go-html-transform/css/selector"
"errors"
"net/url"
"regexp"
)
var (
mangawall = &MangaWallService{}
serviceMangaWallHTMLSelectorMangaName, _ = selector.Selector("meta[name=og:title]")
serviceMangaWallHTMLSelector... |
/*
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... |
// Package handlers contains the full set of handler functions and routes
// supported by the web api.
package handlers
import (
"context"
"expvar"
"net/http"
"net/http/pprof"
"os"
"github.com/ardanlabs/service/app/services/sales-api/handlers/debug/checkgrp"
v1ProductGrp "github.com/ardanlabs/service/app/servi... |
package masq
import (
"fmt"
"log"
"strings"
)
// Parser represents a parser.
type Parser struct {
s *Scanner
buf struct { //todo replace with *Lexeme?
lex Lexeme
n int // buffer size (max=1)
}
}
// NewParser returns a new instance of Parser
func NewParser(s *Scanner) *Parser {
return &Parser{
s: s,
... |
package e2e
import (
"bufio"
"context"
"fmt"
"os/exec"
"testing"
"time"
"github.com/stretchr/testify/require"
authorizationv1 "k8s.io/api/authorization/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait... |
/**
* Created by GoLand.
* User: 姜伟
* Date: 2020/1/17 0017
* Time: 9:05
*/
package trace
import (
"time"
"github.com/a07061625/gompf/mpf/api/taobao"
"github.com/a07061625/gompf/mpf/api/taobao/logistics"
"github.com/a07061625/gompf/mpf/mpconstant/errorcode"
"github.com/a07061625/gompf/mpf/mper... |
package stonks
import (
"io"
"log"
"net/http"
"reflect"
"strings"
"sync"
"text/template"
"time"
cg "github.com/superoo7/go-gecko/v3"
"github.com/superoo7/go-gecko/v3/types"
"go.uber.org/ratelimit"
)
type Stonk interface {
SetCurrency(c string)
GetGems() ([]Coin, error)
GetCoinList() ([]Coin, error)
... |
package pathfinderpkg
import (
"sort"
)
// cost to buy ability score
// 1 through 6 and 19 through 45 are not
// legal values and are extrapolations
// for comparison only
func AbilityCost(ability int) (int, bool) {
ability_cost := []int{
-25, // 1
-20, // 2
-16, // 3
-12, // 4
-9, // 5
-6, // 6
-4,... |
//+build +opencl,!travis
package pircl
import (
"fmt"
"strings"
"sync"
"unsafe"
"github.com/go-gl/cl/v1.2/cl"
"github.com/privacylab/talek/common"
)
// ContextCL represents a single OpenCL context
// Currently, we only support 1 live ShardCL per ContextCL
// Before creating a new ShardCL, the old one must be ... |
package main
import (
"flag"
"fmt"
"log"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/allinbits/cosmos-cash-resolver/resolver"
"github.com/allinbits/cosmos-cash-resolver/x/did/types"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"golang.org/x/t... |
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021.
* 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 ... |
package main
import (
"errors"
"fmt"
"os"
"strconv"
"strings"
"time"
)
const (
success = 0
failed = 1
)
func main() {
os.Exit(run())
}
func run() int {
byear, bmonth, bday, err := getArgs()
if err != nil {
fmt.Println(err)
return failed
}
toyear, tomonth, today := getDate()
// 誕生日前後判定
if bmont... |
package legatoDb
import (
"encoding/json"
"errors"
"fmt"
"legato_server/env"
"legato_server/services"
"log"
"time"
"github.com/zmb3/spotify"
"golang.org/x/oauth2"
"gorm.io/gorm"
)
const spotifyType string = "spotifies"
const addTrackToPlaylist string = "addToPlaylist"
const getTopTracks string = "getTopTra... |
package main
import (
"context"
"flag"
"fmt"
"os"
"path"
"runtime"
"time"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"github.com/sourcegraph/src-cli/internal/api"
"github.com/sourcegraph/src-cli/internal/campaigns"
"github.com/sourcegraph/src-cli/internal/output"
)
func init() {
usage ... |
package runtime
import (
"fmt"
"github.com/healthy-tiger/scalc/parser"
)
const (
setSymbol = "set"
ifSymbol = "if"
whileSymbol = "while"
printSymbol = "print"
beginSymbol = "begin"
funcSymbol = "func"
)
// set組み込み関数に関するエラーコード
var (
ErrorYouCannotBindAValueToAnythingOtherThanASymbol int
ErrorYou... |
package deck
import (
"errors"
"fmt"
"regexp"
"strconv"
"strings"
)
// ErrNotWild is an error when an wild-type action is attempted on a standard card
var ErrNotWild = errors.New("the card is not wild")
// Suit represents a card suit
type Suit string
// suit constants
const (
Hearts Suit = "hearts"
Clubs ... |
// Copyright 2019 <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, publish, distribute... |
package docradle
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/shibukawa/cdiff"
)
// FileCheckResult contains file check result
type FileCheckResult struct {
pattern string
source string
dest string
rewritePattern string
required bool
... |
/*
* @Author: calmwu
* @Date: 2017-11-20 15:29:40
* @Last Modified by: calmwu
* @Last Modified time: 2017-11-21 16:44:22
* @Comment:
*/
package lock
import (
"fmt"
"math/rand"
"testing"
"time"
"github.com/hashicorp/consul/api"
)
var r *rand.Rand // Rand for this package.
func init() {
r = rand.New(rand... |
package command
import (
"fmt"
"os"
"strings"
"time"
"github.com/lunarway/release-manager/cmd/hamctl/command/actions"
"github.com/lunarway/release-manager/cmd/hamctl/command/completion"
"github.com/lunarway/release-manager/cmd/hamctl/template"
httpinternal "github.com/lunarway/release-manager/internal/http"
... |
package api
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
"github.com/goware/urlx"
"github.com/hashicorp/go-rootcerts"
"github.com/pkg/errors"
)
// HTTPClient represents an HTTP client
type HTTPClient interface {
NewRequest(ctx context.Cont... |
package memcached
import (
"container/list"
"runtime"
"sync"
"sync/atomic"
"time"
)
type MemcachedPool struct {
//自定义方法实现连接的生成.
Dial DialFunc
//连接池中最大空闲的连接数量.
MaxIdleConnections int
//连接池中最大活动的连接数量.
MaxActiveConnections int
//空闲指定时间后关闭连接.
IdleTimeout time.Duration
//连接存货检查频率.
IdleFrequency time.Durat... |
/*
Copyright 2020 The Knative 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... |
package bdodb
import (
"os"
"time"
"github.com/blevesearch/bleve/index/store"
"github.com/blevesearch/bleve/registry"
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
)
// Store implements bleve store
type Store struct {
path string
db *badger.DB
mergeOperator st... |
package handlers
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/asn1"
"encoding/base64"
"encoding/json"
"encoding/pem"
"errors"
"io/ioutil"
"log"
"math/big"
"net/http"
"time"
normalRand "math/rand"
"github.com/twrobel3/PEBC/models"
)
type Checker struct ... |
// Copyright © 2018 Kasisnu <<EMAIL>>
//
// 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, publis... |
// Copyright 2021 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 convert
import (
"fmt"
"strings"
"time"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/perm"
"code... |
/*
*Copyright (c) 2019-2021, Alibaba Group Holding Limited;
*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 a... |
package middleware
import (
"context"
"encoding/json"
"errors"
"github.com/cristalhq/jwt/v3"
"github.com/gorilla/mux"
"github.com/iagapie/cards-system/api-service/pkg/gof"
"github.com/sirupsen/logrus"
"net/http"
"net/url"
"strings"
"time"
)
type (
JWTAuthConfig struct {
Signing struct {
// Signing ke... |
// Copyright 2021 IBM Corporation
//
// 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 test
import (
"fmt"
"regexp"
"testing"
)
func expandTest() {
pat := `(((abc.)def.)ghi)`
reg := regexp.MustCompile(pat)
fmt.Println(reg.NumSubexp())
src := []byte(`abc-def-ghi abc+def+ghi`)
template := []byte(`$0 $1 $2 $3`)
// 替换第一次匹配结果
match := reg.FindSubmatchIndex(src)
fmt.Printf("%v\n", ... |
package node
import (
"crypto/rsa"
"fmt"
xc "github.com/jddixon/xlCrypto_go"
xi "github.com/jddixon/xlNodeID_go"
xo "github.com/jddixon/xlOverlay_go"
xt "github.com/jddixon/xlTransport_go"
"strings"
"sync"
"time"
)
/**
* A Peer is another Node, a neighbor.
*/
type Peer struct {
connectors []xt.ConnectorI... |
// Copyright 2018-2019 Shift Cryptosecurity AG
//
// 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 (c) 2020 BitMaelum Authors
//
// 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, publ... |
package context
import (
"bytes"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"math/big"
"path"
"time"
sdk "github.com/Conflux-Chain/go-conflux-sdk"
"github.com/Conflux-Chain/go-conflux-sdk/types"
"github.com/Conflux-Chain/go-conflux-sdk/types/cfxaddress"
address "github.com/Conflux-Chain/go-conflux-s... |
package tinycache
import (
"container/list"
"fmt"
"strings"
"sync"
)
type LRUCache struct {
cache map[string]cacheValue
clist *list.List
l sync.RWMutex
limit Limit
current Limit
}
type cacheValue struct {
value string
element *list.Element
}
// Returns a new LRUCache instance
func NewLRUCac... |
// +build integration
package splunk
import (
"encoding/csv"
"encoding/json"
"fmt"
"io"
"math/rand"
"strconv"
"strings"
"testing"
"time"
"github.com/stretchr/testify/suite"
"github.com/calyptia/fluent-bit-ci/integration/tests"
"github.com/flosch/pongo2/v4"
"github.com/gruntwork-io/terratest/modules/k8s... |
package main
import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/vidar-team/Cardinal/src/conf"
"github.com/vidar-team/Cardinal/src/locales"
"time"
)
// Score is a gorm model for database table `scores`.
// Every action (checkdown, attacked...) will be created a score record, and the total sc... |
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/syndtr/goleveldb/leveldb"
"log"
//"github.com/SomniaStellarum/StellarUtilities/slog"
)
type eventDescriber interface {
bodyToSeller(BPAddress common.Address) []byte
bodyToBuyer(BPAddress common.Address) []byte
subjectToSeller(BPA... |
package captain // import "github.com/harbur/captain"
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/harbur/captain/pkg/depgraph"
yaml "gopkg.in/yaml.v2"
)
// Config represents the information stored at captain.yml. It keeps information about images and unit te... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
package libraclient
// Address represents account address hex-encoded string
type Address = string
// Amount represents currency amount
type Amount struct {
Amount uint64 `json:"amount"`
Currency string `json:"currency"`
}
// Cu... |
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"github.com/fatih/color"
)
func main() {
f, err := os.Open("input.txt")
if err != nil {
log.Fatal(err)
}
defer f.Close()
//Print the result
fmt.Println(processInput(f))
}
type xy struct {
x int
y int
}
func abs(x int) int {
if x < 0 {
return -... |
//客户端POST的HTTP请求必须包括以下表单
//(1)、FormFiel:
//“uid”=用户的uid
//“sha1”=上传文件的sha1
//(2)、FormFile
//“uploadfile”=上传文件
//
//
//
package main
import (
//"./fsdatabase"
"crypto/sha1"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"runtime"
"strconv"
"time"
)
//var fsdb fsdatabase
type M... |
// Package yaml can marshal and unmarshal cty values in YAML format.
package yaml
import (
"errors"
"fmt"
"reflect"
"strings"
"sync"
"github.com/zclconf/go-cty/cty"
)
// Unmarshal reads the document found within the given source buffer
// and attempts to convert it into a value conforming to the given type
// ... |
// +build integrationtest
package integrationtest
import (
"flag"
"os"
"path"
"strings"
"testing"
"time"
corev1 "github.com/libopenstorage/operator/pkg/apis/core/v1"
k8sutil "github.com/libopenstorage/operator/pkg/util/k8s"
testutil "github.com/libopenstorage/operator/pkg/util/test"
"github.com/portworx/sc... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: floats.proto
package schema_proto2
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This... |
package coordinate
import (
"fmt"
"math"
"sort"
"sync"
"time"
"github.com/armon/go-metrics"
)
type Client struct {
coord *Coordinate
origin *Coordinate
config *Config
adjustmentIndex uint
adjustmentSamples []float64
latencyFilterSamples map[string][]float64
stats ClientStats
mutex sync.RWMutex
}... |
package main
import (
"context"
"devsecops-quickstart/opa-scan/pkg/app"
"encoding/json"
"fmt"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/codepipeline"
"github.com/aws/aws-sdk-go-v2/service/codepipeline/t... |
package clusterconnection
import (
"context"
"fmt"
"github.com/tigera/operator/pkg/controller/installation"
"github.com/tigera/operator/pkg/controller/status"
"github.com/tigera/operator/pkg/controller/utils"
"github.com/tigera/operator/pkg/render"
operatorv1 "github.com/tigera/operator/pkg/apis/operator/v1"
... |
package minio
import (
"bytes"
"crypto/tls"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
"time"
"github.com/appleboy/docker-backup-database/pkg/storage/core"
"github.com/h2non/filetype"
"github.com/minio/minio-go/v6"
"github.com/minio/minio-go/v6/pkg/credentials"
)
// Minio client
type Minio struct {
... |
package main
import (
"io/ioutil"
"github.com/nlopes/slack"
"net/http"
"log"
"bytes"
"strings"
)
// Sample from https://github.com/nlopes/slack/blob/master/examples/slash/slash.go
// TODO: look at https://glitch.com/edit/#!/slack-slash-command-and-dialogs-blueprint?path=src/index.js:1:0 for posting a dialog box... |
/*
configmap.go
Copyright (c) 2019-2020 VMware, Inc.
SPDX-License-Identifier: https://spdx.org/licenses/MIT.html
*/
package controllers
import (
"context"
"encoding/json"
webv1beta1 "github.com/tdhite/kwite-operator/api/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ctrl "sigs.k8s.io/controller-runtim... |
/*
* Copyright 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... |
package template
import (
"fmt"
"html/template"
"io"
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
"github.com/flxtilla/app"
"github.com/flxtilla/cxre/extension"
"github.com/flxtilla/cxre/state"
"github.com/flxtilla/cxre/template/resources"
"github.com/flxtilla/txst"
)
func testLocation()... |
/*
* 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 ... |
// named is a utility for dealing with named fiddles.
package named
import (
"errors"
"fmt"
"path/filepath"
"regexp"
"strings"
"go.skia.org/infra/fiddlek/go/store"
"go.skia.org/infra/go/sklog"
)
var (
DuplicateNameErr = errors.New("Name already exists.")
// fiddleHashRe is used to validate fiddle hashes.
... |
/*
*
* Copyright 2017 Expedia, 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 ap... |
package projecteuler
// Functions PExxx() will get one or no argument and could be
// any type, return value MUST be int type and no more, holding the answer.
type Solver struct {
Caller interface{} // Function handle of solver.
Arg interface{} // Default argument used by solver.
Finished bool // If t... |
package slack
import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"net/http"
"strconv"
"strings"
"time"
"github.com/ViBiOh/flags"
"github.com/ViBiOh/httputils/v4/pkg/httperror"
"github.com/ViBiOh/httputils/v4/pkg/httpjson"
"github.com/Vi... |
package bchd
import (
"context"
"fmt"
"github.com/Ekliptor/bchd-monitor/internal/log"
"github.com/Ekliptor/bchd-monitor/internal/monitoring"
"github.com/Ekliptor/bchd-monitor/pkg/trace"
"github.com/pkg/errors"
"github.com/spf13/viper"
"net"
"time"
)
type BchdWatcher struct {
Nodes *No... |
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/iancoleman/strcase"
"github.com/rkoval/alfred-aws-console-services-workflow/parsers"
)
func init() {
awsServices := parsers.ParseConsoleServ... |
package server
import (
"net/http"
"testing"
"time"
"github.com/viktorasm/redbutton/server/api"
"github.com/jmcvetta/napping"
"github.com/stretchr/testify/require"
)
var testServerConfig = Config{
Port: "9001",
}
func init() {
go runServer(testServerConfig)
// wait for server startup
time.Sleep(time.Dura... |
package lm
import (
"bytes"
"encoding/binary"
"encoding/gob"
"errors"
"fmt"
"log"
"math"
"sort"
"strconv"
"github.com/suggest-go/suggest/pkg/utils"
)
type (
// ContextOffset represents the id of parent nGram path
ContextOffset = uint32
key = uint64
)
// NGramVector represents one level of nGram trie
ty... |
package directory
import (
"context"
"crypto/sha256"
"encoding/json"
"fmt"
"time"
log "github.com/sirupsen/logrus"
"go-peek/pkg/ingest/logfile"
"go-peek/pkg/models/consumer"
"go-peek/pkg/models/events"
"go-peek/pkg/utils"
)
var (
// IgnoreParseErrors defines weather an individual message parse error shou... |
// Copyright (c) 2013, 2014 Akamai Technologies, Inc.
package sitejsoncache
import (
"akamai/atlas/linker"
"akamai/atlas/sitelistcache"
"akamai/atlas/stat"
"akamai/atlas/svgtext"
"bytes"
"encoding/json"
"github.com/golang/glog"
"github.com/russross/blackfriday"
"io/ioutil"
"os"
"path"
"strings"
"time"
)
... |
package upnp
import (
"errors"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"time"
)
// NotifyEvent contains information about a notify event instance
type NotifyEvent struct {
// SID is the unique ID returned to the called when they subscribed to the event
SID string
// Body is the response from the server, the ... |
package main
import (
"bytes"
"encoding/csv"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
moocfetcher "github.com/moocfetcher/moocfetcher-appliance/backend/lib"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/u... |
// Copyright (c) 2018, The GoKi Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Much of this is directly copied from Go's go/scanner package:
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is go... |
//nolint:paralleltest
package workgroups_test
import (
"bytes"
"context"
"errors"
"fmt"
"log"
"os"
"runtime"
"sync"
"testing"
"time"
"github.com/go-logr/stdr"
"github.com/stretchr/testify/require"
"github.com/tonglil/buflogr"
"go.xsfx.dev/workgroups"
)
func TestDispatcher(t *testing.T) {
require := re... |
/*
* @file remote.go
* @brief 远端负载均衡实现
* 从远端负载均衡获取可用的机器列表
* @author kunliu2
* @version 1.0
* @date 2017.12
*/
package xsf
import (
"context"
"errors"
"git.xfyun.cn/AIaaS/xsf-external/utils"
"strconv"
"time"
)
var (
NBSET = "nbest"
ROUTER = "router"
UID = "uid"
... |
// Copyright 2021 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package main
import (
"bytes"
"fmt"
"html/template"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"sort"
"time"
"github.com/google/syzkaller/pkg/htm... |
package mux
import (
"fmt"
"net/http"
"runtime"
"strings"
"github.com/ochipin/locale"
"github.com/ochipin/logger/errorlog"
"github.com/ochipin/uploadfile"
)
// PrePost : アクション関数の事前、事後にコールする関数を管理する構造体
type PrePost struct {
begins []func() Result
commits []func() Result
}
// AddBeginFunc : 事前関数の登録
func (pre... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package configservice
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/configservice/types"
smithy "github.com/awslabs/smithy-go"
"github.com/awsla... |
package handler
import (
"compress/gzip"
"crypto/md5"
"fmt"
"mime"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"github.com/zaolab/sunnified/util/validate"
"github.com/zaolab/sunnified/web/resp"
)
const gzipExt = ".gz"
const typeDefault = "application/octet-stream"
var separatorString = st... |
package main
import (
"fmt"
"log"
"net"
"github.com/golang/protobuf/proto"
"github.com/xfxdev/xtcp"
"github.com/xfxdev/xtcp/_example/exampleproto"
)
type processor func(c *xtcp.Conn, msg proto.Message)
type exampleLogger struct {}
func (*exampleLogger)Log(l xtcp.LogLevel, v ...interface{}) {
if l != xtcp.Deb... |
package internal
import (
"fmt"
"strings"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/external"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/sts"
awstrace "github.com/jippi/go-metadataproxy/internal/trace/aws"
"github.com/patrickmn/go-cache"... |
package cmd
import (
"bytes"
"errors"
"fmt"
"log"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"github.com/AlecAivazis/survey/v2/terminal"
"github.com/mitchellh/go-homedir"
"gopkg.in/yaml.v2"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/jbltx/... |
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
"time"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
appsv1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
rest "k8s.io/client-go/rest"
au "github.com/logrusorgru/aurora... |
package authorization
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/ioutils"
)
const maxBodySize = 1048576 // 1MB
// NewCtx creates new authZ context, it is used to store authorization information related to a specific docker
// REST http... |
// Copyright 2018 <NAME>, 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 main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"errors"
"fmt"
"io"
"os"
)
// Takes two strings, cryptoText and keyString.
// cryptoText is the text to be decrypted and the keyString is the key to use for the decryption.
// The function will output the resul... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package datasync
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource schema for AWS::DataSync::Agent.
t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.