text stringlengths 3.08k 10.4k |
|---|
package execution
import (
"context"
"github.com/kurtosis-tech/kurtosis-client/golang/core_api_bindings"
"github.com/kurtosis-tech/kurtosis-client/golang/networks"
"github.com/kurtosis-tech/kurtosis-libs/golang/lib/rpc_api/bindings"
"github.com/kurtosis-tech/kurtosis-libs/golang/lib/testsuite"
"github.com/palant... |
// Copyright (c) 2019 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package cbor
import (
"encoding/binary"
"errors"
"io"
"strconv"
)
// SyntaxError is a description of a CBOR syntax error.
type SyntaxError struct {
msg string
}
func (e *SyntaxE... |
// Copyright 2015 <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 common
import (
"bufio"
"errors"
"fmt"
"io/ioutil"
"os"
"strconv"
"sync"
"sync/atomic"
"time"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
"github.com/hyperledger/fabric-sdk-go/pkg/util/pathvar"
"github.com/xixuejia/viper"... |
// Copyright 2018 ekino. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package godim
import (
"fmt"
"strings"
)
// AppProfile represents the differents Profile of your application
// see @Profile for Profile detail
type AppProfile stru... |
// fov: Calculate horizontal or vertical FOV values for a given aspect ratio
//
// Copyright © 2018-2020 <NAME> and contributors
//
// 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 ... |
package cache
import (
"fmt"
"math"
"sync"
"columbia.github.com/privatekube/dpfscheduler/pkg/scheduler/util"
columbiav1 "columbia.github.com/privatekube/privacyresource/pkg/apis/columbia.github.com/v1"
)
type DemandState struct {
Availability bool
Share float64
IsValid bool
}
type BlockState str... |
package mongo
import (
. "common/log15"
"sync"
"time"
mgo "gopkg.in/mgo.v2"
)
type dbInstance struct {
Session *mgo.Session
// 请求队列
requestQueue chan IDBRequest
// 如果请求的方法OnExecute返回true, 那么这个请求将被放入同步队列
syncQueue chan IDBRequest
DbUrl string
}
var __dbInstance dbInstance
func Open(addr string, user s... |
/*******************************************************************************
* Copyright 2021 EdgeSec Ltd
*
* 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/lic... |
// Copyright 2019 Liquidata, 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... |
package pl
import (
crand "crypto/rand"
"encoding/binary"
"fmt"
"math/rand"
"time"
"shanhu.io/smlvm/builds"
"shanhu.io/smlvm/dagvis"
"shanhu.io/smlvm/lexing"
"shanhu.io/smlvm/pl/ast"
"shanhu.io/smlvm/pl/codegen"
"shanhu.io/smlvm/pl/sempass"
"shanhu.io/smlvm/pl/tast"
"shanhu.io/smlvm/pl/types"
"shanhu.io... |
// Code generated by transpiler. DO NOT EDIT.
/**
* Go Video Downloader
*
* Copyright 2019 Tenta, 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.or... |
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package mutation
import (
"fmt"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/cli-utils/pkg/object"
)
// ApplyTimeMutation is a list of substitutions to perform in the tar... |
package zmemif
import (
"container/list"
"encoding/binary"
"fmt"
"os"
"sync"
"syscall"
"github.com/sirupsen/logrus"
)
// Socket represents a UNIX domain socket used for communication
// between memif peers
type Socket struct {
appName string
filename string
listener *listener... |
package openapi3lint
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"sort"
"strings"
oas3 "github.com/getkin/kin-openapi/openapi3"
"github.com/grokify/simplego/encoding/jsonutil"
"github.com/grokify/simplego/log/severity"
"github.com/grokify/simplego/text/stringcase"
"github.com/grokify/simplego/type/... |
// Copyright 2016 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... |
package dns
/*
#include <stdlib.h>
#include <memory.h>
*/
import "C"
import (
"fmt"
"net"
"syscall"
"time"
"unsafe"
"github.com/DataDog/datadog-agent/pkg/network/driver"
"github.com/pkg/errors"
"golang.org/x/sys/windows"
)
const (
dnsReadBufferCount = 100
)
// This is the type that an overlapped read retur... |
package vpc
// FINCLOUD_APACHE_NO_VERSION
// NatGatewayInstanceStatusCode enumerates the values for nat gateway instance status code.
type NatGatewayInstanceStatusCode string
const (
// INIT ...
INIT NatGatewayInstanceStatusCode = "INIT"
// RUN ...
RUN NatGatewayInstanceStatusCode = "RUN"
// TERMTING ...
TERMT... |
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obta... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
smithy "github.com/awslabs/smithy-go"
"github.com/awslabs/smithy-... |
package backend
import (
"encoding/json"
"fmt"
"net/http/cookiejar"
"strings"
"time"
"github.com/tstromberg/campwiz/pkg/cache"
"github.com/tstromberg/campwiz/pkg/campwiz"
"k8s.io/klog/v2"
)
// RCalifornia handles RCalifornia queries
type RCalifornia struct {
store cache.Store
jar *cookiejar.Jar
}
// Nam... |
package penguin
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 (
sprinkleBirthday = nook.Birthday{
Day: 20,
... |
package gw
import (
"fmt"
"game/global"
"game/lib"
"game/player"
"github.com/liangmanlin/gootp/db"
"github.com/liangmanlin/gootp/gate/pb"
"github.com/liangmanlin/gootp/kernel"
)
func doReConnect(state *global.TcpClientState, ctx *kernel.Context, m *global.TcpReConnectGW) {
if state.SendID-m.RecID > CacheSize ... |
package api
import (
"context"
"errors"
"github.com/chromedp/chromedp"
"log"
"strings"
)
//---------------------------------------------OLD AND NOT USED---------------------------------------------------------
type Traffic struct {
Start string
Arrive string
Traffic []string
Duration string... |
package server
import (
"fmt"
"log"
"net/url"
"strings"
"sync"
"github.com/sourcegraph/sourcegraph/pkg/api"
"github.com/sourcegraph/sourcegraph/pkg/conf"
)
type prefixAndOrgin struct {
Prefix string
Origin string
}
func init() {
if err := originMaps.setup(); err != nil {
log.Fatal(err)
}
first := true... |
// Copyright 2021 PairMesh, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
/*
Copyright 2020 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, ... |
// Copyright 2020 Booking.com
//
// 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 zerolog
import (
"fmt"
"os"
"path/filepath"
"sync"
"github.com/albertwidi/go-project-example/internal/pkg/log/logger"
"github.com/rs/zerolog"
)
var _ logger.Logger = (*Logger)(nil)
// Logger struct
type Logger struct {
logger zerolog.Logger
config logger.Config
mu sync.Mutex
}
// DefaultLogger... |
package labyrinth
import "github.com/hajimehoshi/ebiten"
import "time"
type wizard struct {
image *ebiten.Image
imageShoot *ebiten.Image
shooting bool
TopLeft *coord
moveSpeed int
fireballs []*fireball
powerups []*powerup
fireCreator *fireba... |
package onepasswordcli
import (
"context"
"encoding/json"
"fmt"
"github.com/slok/terraform-provider-onepasswordorg/internal/model"
)
func (r *Repository) EnsureVaultGroupAccess(ctx context.Context, groupAccess model.VaultGroupAccess) error {
// Delete first to revoke every access and then add the required one a... |
package mangerattack
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"log"
"math/big"
)
// countQueries is a counter to know how many queries were necessary
var countQueries int
// Constants
const (
byteSize = 8
)
// A few useful big.Int :
var (
zero = new(big.Int).SetInt64(int64(0))
two = new(big.Int).SetIn... |
package main
import (
"fmt"
"io/ioutil"
"strconv"
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/buger/jsonparser"
"github.com/kellydunn/golang-geo"
"github.com/parnurzeal/gorequest"
"github.com/robfig/cron"
"github.com/x-cray/logrus-prefixed-formatter"
"github.com/xconstruct/go-pushbullet"
)
... |
package main
import (
"bufio"
"os"
"strings"
ui "github.com/gizak/termui"
)
func loadDepositAddresses() map[string]string {
m := make(map[string]string)
f, err := os.Open("addresses.cfg")
if err != nil {
Log.Println(err)
return m
}
sc := bufio.NewScanner(f)
if err != nil {
Log.Println(err)
return ... |
// Copyright 2020 gcs-exporter 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 agre... |
package application
import (
"context"
"io"
"regexp"
"time"
"github.com/reddec/trusted-cgi/templates"
"github.com/reddec/trusted-cgi/types"
)
type FileSystem interface {
// List files and dirs
ListFiles(path string) ([]types.File, error)
// Get content of file
ReadFile(path string, output io.Writer) error
... |
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package directory
import (
"github.com/cihub/seelog"
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/team"
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/team_common"
"github.com/watermint/dcfg/cli/explorer"
"github.com/watermint/dcfg/integration/context"
)
type DropboxDirectory struct {
executionC... |
package template
import (
"fmt"
"math"
"strconv"
"github.com/coveooss/gotemplate/v3/collections"
)
func toInt(value interface{}) int {
// We convert to the string representation to ensure that any type is converted to int
return must(strconv.Atoi(fmt.Sprintf("%v", value))).(int)
}
func toInt64(value interface... |
package btox
import (
"fmt"
"gopp"
"log"
"strings"
funk "github.com/thoas/go-funk"
)
const (
STM_INIT = iota
STM_WAIT_RESP_INFO
STM_INVITE_X_DONE_1
STM_WAIT_RESP_GROUP_CREATED
STM_RESP_GROUP_CREATED
STM_INVITE_X2 // tmp group #xxx
STM_DONE
)
type StmState struct {
state int
need_creates []strin... |
/*
* 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 ... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package nodeinfo
import (
"errors"
"fmt"
"net/url"
"sync"
"sync/atomic"
"time"
"github.com/trustbloc/edge-core/pkg/log"
apstore "github.com/trustbloc/orb/pkg/activitypub/store/spi"
"github.com/trustbloc/or... |
/*
Copyright 2018 Turbine Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
// Copyright 2017 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... |
package signalr
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"github.com/go-kit/kit/log"
"os"
"reflect"
"sync"
)
// Client is the signalR connection used on the client side
type Client interface {
Party
Start() error
Stop() error
// Closed() <-chan error TODO Define connection state
Invoke(... |
package sloc
import "path"
type Commenter struct {
LineComment string
StartComment string
EndComment string
Nesting bool
}
var (
noComments = Commenter{"\000", "\000", "\000", false}
xmlComments = Commenter{"\000", `<!--`, `-->`, false}
cComments = Commenter{`//`, `/*`, `*/`, false}
cssCo... |
package main
import (
"context"
"encoding/json"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
//_ "github.com/jinzhu/gorm/dialects/sqlite"
"fmt"
"github.com/caarlos0/env"
_ "github.com/jinzhu/gorm/dialects/postgres"
"io/ioutil"
"log"
"math/rand"
"net/http"
"os"
"os/signal"
"time"
)
//global databas... |
// https://www.hackerrank.com/challenges/queens-attack-2/problem
/*
You are given a square chess board with one queen and a number of obstacles placed on it.
Determine how many squares the queen can attack.
A queen is standing on an n x n chessboard.
The chess board's rows are numbered from 1 to n, going from bottom ... |
package turtleware
import (
"github.com/rs/zerolog"
"errors"
"net/http"
"strings"
"time"
)
type loggingOptions struct {
logHeaders bool
headerWhitelist map[string]struct{}
headerBlacklist map[string]struct{}
}
// LoggingOption represents an option for the logging parameters.
type LoggingOption func(*lo... |
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
package mscalendar
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/golang/mock/gomock"
"golang.org/x/oauth2"
"github.com/mattermost/mattermost-plugin-mscalendar/server/co... |
package stripe
import "encoding/json"
// PaymentMethodType is the list of allowed values for the payment method type.
type PaymentMethodType string
// List of values that PaymentMethodType can take.
const (
PaymentMethodTypeCard PaymentMethodType = "card"
PaymentMethodTypeCardPresent PaymentMethodType = "ca... |
package scoring
import (
"sort"
"testing"
"time"
"github.com/activedefense/submarine/ctf"
"github.com/activedefense/submarine/rules"
)
func genJeopardy(chals []ctf.Challenge, teams []ctf.Team, submissions []ctf.Submission) rules.JeopardyRule {
rule := jeopardy{
Submission: make([]ctf.Submission, 0),
Team: ... |
package gitdb
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/bouggo/log"
"github.com/gogitdb/gitdb/v2/internal/db"
)
func (g *gitdb) loadBlock(blockFile string) (*db.Block, error) {
if g.loadedBlocks == nil {
g.loadedBlocks = map[string]*db.Block{}
}
//if block file is not cached... |
/*
Copyright 2016 Continusec Pty Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... |
// Copyright 2016 The Serviced 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... |
/*
This file is part of rclgo
Copyright © 2021 Technology Innovation Institute, United Arab Emirates
Licensed under the Apache License, Version 2.0 (the "License");
http://www.apache.org/licenses/LICENSE-2.0
*/
/*
THIS FILE IS AUTOGENERATED BY 'rclgo-gen generate'
*/
package px4_msgs_msg
import (
"unsafe"
"gith... |
package demozoo
import (
"database/sql"
"fmt"
"reflect"
"strings"
"time"
"github.com/gookit/color" //nolint:misspell
"github.com/Defacto2/df2/lib/database"
"github.com/Defacto2/df2/lib/download"
"github.com/Defacto2/df2/lib/logs"
"github.com/Defacto2/df2/lib/str"
)
type records struct {
rows *sql.Row... |
package pastes
import (
"net/http"
"regexp"
"strconv"
"strings"
"time"
"github.com/alecthomas/chroma/lexers"
"github.com/labstack/echo"
"go.dev.pztrn.name/fastpastebin/internal/captcha"
"go.dev.pztrn.name/fastpastebin/internal/database/dialects/flatfiles"
"go.dev.pztrn.name/fastpastebin/internal/structs"
"... |
package monkey
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 (
montyBirthday = nook.Birthday{
Day: 7,
Month... |
package main
var LoginPage = `<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<me... |
package main
import (
"bytes"
"encoding/base64"
"flag"
"fmt"
"io/ioutil"
"mime"
"os"
"path/filepath"
"regexp"
"text/template"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
"github.com/russross/blackfriday"
"github.com/sourcegraph/go-webkit2/webkit2"
"path"
"strings"
)
func getCss(filena... |
package completion
import (
"errors"
"fmt"
"io"
"os"
"github.com/eiladin/k8s-dotenv/pkg/options"
"github.com/spf13/cobra"
)
const defaultBoilerPlate = `
# The MIT License (MIT)
#
# Copyright © 2022 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and ... |
package cmd
import (
"errors"
"fmt"
"os"
"strings"
"time"
"github.com/exoscale/cli/table"
egoscale "github.com/exoscale/egoscale/v2"
exoapi "github.com/exoscale/egoscale/v2/api"
"github.com/spf13/cobra"
)
type nlbServerStatusShowOutput struct {
InstanceIP string `json:"instance_ip"`
Status string `jso... |
/*
* Copyright (c) 2018 Works Applications Co., Ltd.
*
* 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 applica... |
// Copyright 2018 ETH Zurich
//
// 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... |
// Copyright © 2019 NAME HERE <EMAIL ADDRESS>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law ... |
package main
import (
"encoding/json"
"io/ioutil"
"net/http"
"bytes"
"time"
"fmt"
"strings"
log "github.com/sirupsen/logrus"
"gopkg.in/alecthomas/kingpin.v2"
)
const (
ver string = "0.15"
logDateLayout string = "2006-01-02 15:04:05"
)
var (
verbose = kingpin.Flag("verbose", "Verbose mode.").Short('v').B... |
package ini
import (
"io"
"strings"
)
const (
// DefaultComment is the default value used to prefix comments.
DefaultComment = ";"
// DefaultSliceSeparator is the default slice separator used to decode and encode slices.
DefaultSliceSeparator = ','
// DefaultMapKeySeparator is the default map key separator use... |
// Copyright Red Hat, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
package web
import (
"bytes"
"html/template"
"log"
"net/http"
"strings"
"github.com/alicebob/verssion/core"
)
var (
baseTempl = template.Must(
template.New("base").
Funcs(template.FuncMap{
"title": core.Title,
"version": func(s string) template.HTML {
h := core.TextMarkdown(s)
h = templ... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisvideoarchivedmedia
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
smithy "github.com/awslabs/smithy-go"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com... |
package geco
import (
"bytes"
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"io"
"strings"
"github.com/gregoryv/nexus"
)
func NewTypeUnderTest(pkg, rec, typ, filename string, src interface{}) *TypeUnderTest {
return &TypeUnderTest{
Package: pkg,
Receiver: rec,
Type: typ,
filename: filenam... |
/* license: https://mit-license.org
*
* Ming-Ke-Ming : Decentralized User Identity Authentication
*
* Written in 2020 by Moky <<EMAIL>>
*
* ==============================================================================
* The MIT License (MIT)
*
* Copyright (c) 2020 <NAME>
*
* ... |
// This code is available on the terms of the project LICENSE.md file,
// also available online at https://blueoakcouncil.org/license/1.0.0.
package orderbook
import (
"bytes"
"fmt"
"sort"
"sync"
"decred.org/dcrdex/dex/calc"
"decred.org/dcrdex/dex/order"
)
// orderPreference represents ordering preference for... |
package storage
import (
"encoding/base32"
"fmt"
"net/http"
"strings"
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
log "github.com/sirupsen/logrus"
"github.com/fezho/oidc-auth/storage/internal"
)
// Storage is a custom session store which provides an abstraction of
// common session store... |
package grafeas
import (
"context"
"errors"
"github.com/antihax/optional"
"github.com/docker/distribution/reference"
voucher "github.com/grafeas/voucher/v2"
"github.com/grafeas/voucher/v2/attestation"
"github.com/grafeas/voucher/v2/docker/uri"
"github.com/grafeas/voucher/v2/grafeas/objects"
"github.com/grafe... |
/*
Copyright 2021 The CI/CD Operator 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 status
import (
"fmt"
"github.com/ngaut/log"
"gitlab.alibaba-inc.com/RDS_PG/polardb_cluster_manager/pkg/common"
"strconv"
"time"
)
type StatusType string
const (
EngineStatusType StatusType = "EngineStatus"
PodStatusType StatusType = "PodStatus"
ProxyStatusType StatusType = "ProxyStatus"
)
type ... |
package smallbank
import (
_ "encoding/binary"
"fmt"
"log"
"os"
"sync"
"github.com/golang/protobuf/proto"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
_ "github.com/tendermint/tendermint/libs/log"
"time"
)
const (
sleepTime = 0
txsNumberOfPreBlock = 10... |
package errors
import (
"bytes"
"encoding/json"
"fmt"
"reflect"
"runtime"
)
// Debug print stack information flag
var Debug = true
type callStackError struct {
callStack *callStack
err error
message string
}
func newCallStackError(message string, err error, skip int) *callStackError {
callStack :=... |
package dota2api
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"image"
"image/jpeg"
"image/png"
"io"
"sort"
"sync"
"sync/atomic"
)
const itemPrefix = "item_"
func (api Dota2) getItemsUrl() string {
return fmt.Sprintf("%s/%s/%s/", api.dota2EconUrl, "GetGameItems", api.dota2ApiVersion)
}
func getItemIma... |
package log4go
import (
"fmt"
"os"
"path/filepath"
"regexp"
"strings"
"syscall"
"time"
)
// This log writer sends output to a file
type PanicFileLogWriter struct {
LogCloser //for Elegant exit
rec chan *LogRecord
// The opened file
filename string
baseFilename string // abs path
file *os.Fi... |
package xmlgen
import (
"bytes"
"context"
"embed"
"fmt"
"go/format"
"log"
"os"
"path/filepath"
"strings"
"text/template"
"github.com/Masterminds/goutils"
"github.com/Masterminds/sprig"
"github.com/pkg/errors"
"golang.org/x/tools/imports"
)
//go:embed template/*.tmpl template/**/*.tmpl
var templateFS em... |
package event_handler
import (
"errors"
"fmt"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/keptn/go-utils/pkg/lib/keptn"
keptnv2 "github.com/keptn/go-utils/pkg/lib/v0_2_0"
"net/http"
"net/url"
"os"
"strconv"
)
const ActionToggleFeature = "toggle-feature"
type ActionTriggeredHandler struct {
L... |
package api
import (
"time"
"github.com/fgrehm/sls-web/src/core/models"
"github.com/fgrehm/sls-web/src/core/solver"
"github.com/labstack/echo"
)
type SanModelResource struct {
Url string `json:"url"`
ID string `json:"id"`
Title string `json:"title"`
Descript... |
package ioutils
import (
"encoding/binary"
"errors"
"fmt"
"io"
"reflect"
)
/**
* Reads struct dest{} from reader
* Data types supported:
* - int8/16/32/64,
* - uint8/16,32/64
* - slices/arrays
* - nested structs
*/
func ReadStruct(reader io.Reader, dest interface{}, order binary.ByteOrder) er... |
package mouse
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 (
broccoloBirthday = nook.Birthday{
Day: 30,
Mo... |
package main
import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"strings"
"github.com/samuel/go-zookeeper/zk"
"github.com/wvanbergen/kazoo-go"
)
var (
configFile string
callback string
testMode bool
)
func getGroupName(url string) string {
m := md5.New()
m.W... |
// Copyright 2017 Yunify Inc. All rights reserved.
// Use of this source code is governed by a Apache license
// that can be found in the LICENSE file.
package qingcloud
// See https://docs.qingcloud.com/api/instance/index.html
import (
"errors"
"github.com/golang/glog"
qcservice "github.com/yunify/qingcloud-sdk... |
package symmecrypt
import (
"errors"
"fmt"
"sync"
)
// Default key singleton
var key Key
// Key is an abstraction of a symmetrical encryption key
// - Encrypt / Decrypt provide low-level data encryption, with extra data for MAC
// - EncryptMarshal / DecryptMarshal build on top of that, working with a JSON represe... |
package GTFS
const getAllStopNamesQuery = `
MATCH (s:Stop)
RETURN DISTINCT s.name, s.stopID, s.latitude, s.longitude
ORDER BY s.name;
`
const getAllRouteIDsQuery = `
MATCH (t:Trip)
WITH t
MATCH (:Route{routeID: t.routeID})-[:is_type]->(routeType:RouteType)
RETURN DISTINCT
t.routeID,
routeType.name
O... |
package controllers
import (
appmanagerabmiov1 "appmanager-operator/api/v1"
"appmanager-operator/helper"
"context"
"fmt"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
)
//... |
package embedding
import (
"bufio"
"bytes"
"encoding/binary"
"io"
"github.com/kitsuyui/invisible/invisibles"
"github.com/kitsuyui/invisible/simplenoise"
)
var INVISIBLE_RUNES_TO_UINT32 = []uint32{
binary.BigEndian.Uint32([]byte{0x00, 0xe0, 0x00, 0x00}), // 0b111000000000000000000000
binary.BigEndian.Uint32([... |
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a license that can be found in the LICENSE.txt file.
// Package qscql is a Cassandra/Scylla back-end for qsess.
package qscql
// Expiration is handled very easily, by setting a time-to-live per session.
//
// DeleteByUserId can b... |
// Copyright 2022 The go-exactonline AUTHORS. All rights reserved.
//
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Code generated by gen-services.go; DO NOT EDIT.
package financial
import (
"context"
"github.com/stack11/go-exactonline/api"
"github.com/stack11... |
package args
import (
"testing"
"time"
"github.com/go-openapi/strfmt"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)
type TestEnum string
const (
TestEnumFOO TestEnum = "FOO"
)
func (e TestEnum) IsValid() bool {
return e == TestEnumFOO
}
type testObj struct {
AccountID s... |
/*
Copyright 2018 ZTE Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
package main
import (
"bufio"
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type testServer struct {
t testing.TB
want [][]interface{}
server *httptest.Server
}
func newTestServer(t ... |
package main
import (
"fmt"
"log"
"math/rand"
"os"
"path/filepath"
"runtime"
"github.com/gwenn/gosqlite"
)
var (
fileName = "72mb.sqlite"
numRows = 100000 // 100000 makes a 72MB file (taking ~4.5 seconds) on my Linux desktop. Adjust to suit your desired target file size
)
type oneRow struct {
key_data ... |
// Copyright 2009 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 bufio implements buffered I/O. It wraps an io.Reader or io.Writer
// object, creating another object (Reader or Writer) that also implements
// the i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.