text stringlengths 3.08k 10.4k |
|---|
package dispatch
import (
"errors"
"fmt"
"net/http"
"strings"
)
type Handler func(http.ResponseWriter, *http.Request, map[string]string)
type Dispatcher struct {
root *dispatchNode
}
type dispatchNode struct {
LiteralNexts map[string]*dispatchNode
ArgumentNexts map[string]*dispatchNode
StarNext *dispa... |
package cmd
import (
"context"
"encoding/json"
"github.com/betterde/ects/config"
"github.com/betterde/ects/internal/discover"
"github.com/betterde/ects/internal/service"
"github.com/betterde/ects/internal/utils"
"github.com/betterde/ects/models"
"github.com/betterde/ects/routes"
"github.com/betterde/ects/web"... |
// Copyright 2018-2020 CERN
//
// 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... |
// +build ignore
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
"sort"
"strings"
"text/template"
"github.com/itsabgr/nats-server/v2/server"
)
var tagRe = regexp.MustCompile("\\{(.+?)}")
var templ = `
// Generated code, do not edit. See errors.json and run go genera... |
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
package sportmonks
import (
"context"
"testing"
)
var teamSquadsResponse = `{
"data": [
{
"player_id": 219591,
"position_id": 2,
"number": 4,
"captain": 0,
"injured": false,
"minutes": 90,
"appearences": 2,
"lineups": 1,
"substitute_in": 1,
"substitute_out": 0,
... |
// Copyright 2018 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 cli
import (
"crypto/sha256"
"fmt"
"io"
"os"
"path/filepath"
"github.com/hashicorp/go-hclog"
"github.com/jimeh/build-emacs-for-macos/pkg/dmg"
"github.com/jimeh/build-emacs-for-macos/pkg/notarize"
"github.com/jimeh/build-emacs-for-macos/pkg/plan"
"github.com/jimeh/build-emacs-for-macos/pkg/sign"
cli... |
// 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 gotrace is a pure Go implementation of potrace vectorization library.
// More info at http://potrace.sourceforge.net/potracelib.pdf
package gotrace
import (
"bytes"
"fmt"
"image"
"image/color"
"io"
)
const (
// TypeBezier represents Bezier curve segment.
TypeBezier = SegmType(1)
// TypeCorner repre... |
/*
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 (c) 2016-2017 Tigera, 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 ... |
package main
import (
"code.google.com/p/go-html-transform/css/selector"
"code.google.com/p/go-html-transform/h5"
"code.google.com/p/go.net/html"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
"runtime"
"strconv"
"strings"
"sync"
)
func main() {
if len(os.Args) != 3 {
lo... |
package model
import (
"bytes"
"strings"
"time"
"github.com/d3ce1t/areyouin-server/api"
"github.com/d3ce1t/areyouin-server/utils"
)
type EventModifier interface {
SetModifiedDate(date time.Time) EventModifier
SetStartDate(date time.Time) EventModifier
SetEndDate(date time.Time) EventModifier
SetDescription(... |
/*
* 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 ... |
package routesync
import (
"context"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log"
routev1 "github.com/ope... |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
package dkgtasks
import (
"context"
"math/big"
"github.com/MadBase/MadNet/blockchain/dkg"
"github.com/MadBase/MadNet/blockchain/interfaces"
"github.com/MadBase/MadNet/blockchain/objects"
"github.com/ethereum/go-ethereum/common"
"github.com/sirupsen/logrus"
)
// DisputeMissingGPKjTask stores the data required ... |
// the tick_graph scene is used for printing tick_graph information about all
// running scenes known to director
package tick_graph
import (
"image/color"
"math"
"math/rand"
"time"
"github.com/faiface/mainthread"
rl "github.com/gen2brain/raylib-go/raylib"
"github.com/gravestench/akara"
"github.com/gravesten... |
package cmk
import (
"crypto/rsa"
"fmt"
"github.com/nsmithuk/local-kms/src/config"
"time"
)
//------------------------------------------
type KeyType int
const (
TypeAes KeyType = iota
TypeRsa
TypeEcc
)
//---
type CustomerMasterKeySpec string
const (
SpecSymmetricDefault CustomerMasterKeySpec = "SYMMETRI... |
// Package ioutil implements some I/O utility functions.
package ioutil
import (
"bufio"
"context"
"errors"
"io"
ctxio "github.com/jbenet/go-context/io"
)
type readPeeker interface {
io.Reader
Peek(int) ([]byte, error)
}
var (
ErrEmptyReader = errors.New("reader is empty")
)
// NonEmptyReader takes a reade... |
// Copyright (c) 2020 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 Lice... |
package hls
import (
"context"
"time"
"github.com/aler9/gortsplib"
"github.com/asticode/go-astits"
"github.com/aler9/rtsp-simple-server/internal/aac"
"github.com/aler9/rtsp-simple-server/internal/h264"
)
type muxerTSGenerator struct {
hlsSegmentCount int
hlsSegmentDuration time.Duration
videoTrack ... |
// Copyright 2012 Google, Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
// Package bytediff provides a simple diff utility for looking at differences in byte
// slices. It's slow, clunky, and not p... |
// Package pango is a port of the C library, which provides
// international text layout.
package pango
import (
"fmt"
"math"
"github.com/benoitkugler/textlayout/fribidi"
"golang.org/x/text/width"
)
// enables additional checks, to use only during developpement or testing
const debugMode = false
// reference co... |
// Copyright (c) 2019 IoTeX Foundation
// 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... |
package vault
import (
"errors"
"fmt"
"time"
"github.com/hashicorp/vault/api"
"github.com/sirupsen/logrus"
"github.com/jetstack/vault-unsealer/pkg/kv"
)
// That configures the vault API
type Config struct {
// key prefix
KeyPrefix string
// how many key parts exist
SecretShares int
// how many of these... |
// Copyright 2020-2021 InfluxData, Inc. All rights reserved.
// Use of this source code is governed by MIT
// license that can be found in the LICENSE file.
// Package query defined types for representing flux query result
package query
import (
"fmt"
"strings"
"time"
)
// FluxTableMetadata holds flux query resul... |
package main
import (
"context"
"fmt"
"net/url"
"os"
"os/signal"
"regexp"
"syscall"
"testing"
"time"
"github.com/ChimeraCoder/anaconda"
)
const MAX_TEST_TIME = 600 * time.Second
const TEST_LOOP_TIMER = 10 * time.Second
type check struct {
tweet anaconda.Tweet
expectedFullText_regex stri... |
package Uint
import (
"crypto/sha256"
"math/big"
)
const (
// Bitwidth256 is the number of bits in a U256
Bitwidth256 = 256
// Bytewidth256 is the number of bytes in a U256
Bytewidth256 = 32
)
// U256 stores a 256 bit value in a big.Int
type U256 struct {
big.Int
}
type u256 interface {
Zero256() *U256
Assign(... |
// Package runconsumer extends consumer.Application with support for
// configuration and application initialization. It provides a Main() function
// which executes the full consumer life-cycle, including config parsing,
// service bootstrap, and Shard serving.
package runconsumer
import (
"context"
"os"
"os/signa... |
package generic_solver
import (
"github.com/igrek51/connect4solver/solver/common"
)
type Referee struct {
w int
h int
winStreak int
verticalMovesMap []common.Player
binaryRowMap []bool
diagonalEvaluatorMap [][]winnerEvaluator
counterDiagonalEvaluatorMap [][]wi... |
// Copyright 2013, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package wrangler
import (
"fmt"
"sync"
log "github.com/golang/glog"
"github.com/youtube/vitess/go/vt/tabletmanager/actionnode"
"github.com/youtube/vitess/go... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20160515
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type GlobalSchedule struct {
pulumi.Cus... |
/*
* Minio Cloud Storage, (C) 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
// Package azure implements various azure tools
package azure
import (
"context"
"fmt"
"math"
"sync"
"time"
"github.com/Azure/Avere/src/go/pkg/log"
"git... |
package client
import (
"encoding/binary"
"fmt"
"io"
"log"
"net"
"github.com/gowsp/wsp/pkg/channel"
"github.com/gowsp/wsp/pkg/msg"
"github.com/segmentio/ksuid"
)
var errVersion = fmt.Errorf("unsupported socks version")
// Socks5Proxy implement DynamicProxy
type Socks5Proxy struct {
conf *msg.WspConfig
wsp... |
// +build e2e
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
package pubsubapp_e2e
import (
"bytes"
"encoding/json"
"fmt"
"log"
"math/rand"
"net/http"
"os... |
/*
Copyright 2019 The Skaffold 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, sof... |
package client
import (
"time"
metrics "github.com/armon/go-metrics"
lru "github.com/hashicorp/golang-lru"
"github.com/hashicorp/nomad/acl"
"github.com/hashicorp/nomad/nomad/structs"
)
const (
// policyCacheSize is the number of ACL policies to keep cached. Policies have a fetching cost
// so we keep the hot ... |
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 (
wadeBirthday = nook.Birthday{
Day: 30,
Mont... |
/*
Copyright 2020 IBM All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package client
import (
"github.com/hyperledger/fabric-gateway/pkg/internal/util"
"github.com/hyperledger/fabric-protos-go/common"
"github.com/hyperledger/fabric-protos-go/gateway"
"github.com/hyperledger/fabric-protos-go/peer"
"g... |
package main
import (
"fmt"
"image"
"image/color"
"math/rand"
"syscall/js"
"time"
"github.com/fogleman/gg"
"github.com/llgcode/draw2d/draw2dimg"
"github.com/llgcode/draw2d/draw2dkit"
"golang.org/x/image/draw"
)
type Screen struct {
Width int
Height int
Balls []*Ball
Paddles []*Paddle
Score Scor... |
package management
import (
"context"
"errors"
"net/http"
"net/http/httptest"
"os"
"testing"
"time"
_ "github.com/joho/godotenv/autoload"
"github.com/auth0/go-auth0/internal/testing/expect"
)
var m *Management
var (
domain = os.Getenv("AUTH0_DOMAIN")
clientID = os.Getenv("AUTH0_CLIENT_ID")
cl... |
package phpfpm
import (
"fmt"
"io/ioutil"
"net"
"os"
"os/exec"
"path"
"regexp"
"strconv"
"syscall"
"time"
"gopkg.in/ini.v1"
)
// Process describes a minimalistic php-fpm config
// that runs only 1 pool
type Process struct {
// basename for pid / sock / log filename
Name string
// path to php-fpm exec... |
package incoming
import (
"fmt"
"log"
"strconv"
"collectd.org/cdtime"
"github.com/json-iterator/go"
)
// CollectdMetric struct represents metric data formated and sent by collectd
type CollectdMetric struct {
Values []float64 `json:"values"`
Dstypes []string `json:"dstypes"`
Dsnames ... |
package jsonpointer
import (
"reflect"
"strconv"
"strings"
)
// Reflect gets the value at the specified path from a struct.
func Reflect(o interface{}, path string) interface{} {
if path == "" {
return o
}
parts := parsePointer(path)
var rv interface{} = o
OUTER:
for _, p := range parts {
val := reflect... |
package main
import (
"context"
"github.com/skynet0590/atomicSwapTool/server/admin"
_ "decred.org/dcrdex/server/asset/btc" // register btc asset
_ "decred.org/dcrdex/server/asset/dcr" // register dcr asset
_ "decred.org/dcrdex/server/asset/ltc" // register ltc asset
"fmt"
"github.com/decred/dcrd/dcrec/secp256k1... |
// 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... |
/*
Copyright 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 law or agreed to in writing, software
distributed un... |
// Copyright (c) 2017-2019 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package shared
import (
"bytes"
"encoding/base64"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"os"
"github.com/agl/ed25519"
"github.com/decred/politeia/polite... |
package check
import (
"encoding/json"
"fmt"
"regexp"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/helpers"
"github.com/hashicorp/terraform-provider-azurerm/internal/a... |
// 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 server
import (
"errors"
"io"
"net"
"sync"
"github.com/rpj5582/gochat/modules/common"
)
// TCPServer is a server that can communicate with clients via TCP
type TCPServer struct {
registeredPackets map[uint8]struct {
packet common.Packet
callback func(clientID ClientID, conn net.Conn, p common.Pac... |
package db
import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/pborman/uuid"
"github.com/starkandwayne/shield/plugin"
)
type Agent struct {
UUID uuid.UUID `json:"uuid"`
Name string `json:"name"`
Address string `json:"address"`
Version string `json:"version"`
Hidden ... |
package secrets
import (
"encoding/json"
"io"
"io/ioutil"
"time"
"gitlab.com/nxcp/tools/gophercloud"
"gitlab.com/nxcp/tools/gophercloud/pagination"
)
// Secret represents a secret stored in the key manager service.
type Secret struct {
// BitLength is the bit length of the secret.
BitLength int `json:"bit_le... |
// Copyright 2017 Cisco Systems, 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 opapolicy
import (
"time"
armotypes "github.com/armosec/kubescape/cautils/armotypes"
)
type AlertScore float32
type RuleLanguages string
const (
RegoLanguage RuleLanguages = "Rego"
RegoLanguage2 RuleLanguages = "rego"
)
// RegoResponse the expected response of single run of rego policy
type RuleRespon... |
package provider
import (
"context"
"fmt"
"strconv"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/tsuru/go-tsuruclient/pkg/tsuru"
"k8s.io/apimachinery/pkg/api/resource"
)
func resourceTsuruPlan() *schema.Resource {
retu... |
package reactor
import (
"bytes"
"fmt"
"strings"
"sync"
"github.com/Sirupsen/logrus"
)
var (
log = logrus.WithField("component", "backend")
)
func (e ErrCycleDetected) Error() string {
return fmt.Sprintf("Cycle detected %s", strings.Join(e.Path, ","))
}
func (e ErrMissingDependency) Error() string {
return... |
package aws
import (
"finala/collector"
"finala/collector/config"
"finala/expression"
"fmt"
"time"
awsClient "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/elasticache"
"github.com/aws/aws-sdk-go/service/pricing"
log "github.com/sirupsen/log... |
package cmd
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
"runtime"
"strings"
"github.com/pborman/uuid"
)
/*
Command from the Template Engine
<cmd[n]>.<linux>.<name>.<version>
<linux>=`cmd1 ls
cmm2 mkdir ps`
*/
var Scripts = getBaseScripts()
var linuxScript = `cwd=readlink /proc/... |
package main
import (
"context"
"errors"
"fmt"
"github.com/gieseladev/glyrics/v3"
"github.com/gieseladev/glyrics/v3/pkg/search"
"github.com/urfave/cli"
"os"
"path/filepath"
"regexp"
"strings"
)
func getConfigLocation(c *cli.Context) (string, error) {
if c.GlobalBool("no-config") {
return "", errors.New("... |
/*
* 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 ... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package datalake
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information abou... |
package pfilter
import (
"errors"
"net"
"sort"
"sync"
"sync/atomic"
)
// Filter object receives all data sent out on the Outgoing callback,
// and is expected to decide if it wants to receive the packet or not via
// the Receive callback
type Filter interface {
Outgoing([]byte, net.Addr)
ClaimIncoming([]byte, ... |
package diff
import (
"bytes"
"fmt"
"strings"
_ "unsafe" // for go:linkname
"arhat.dev/pkg/yamlhelper"
"arhat.dev/rs"
"gopkg.in/yaml.v3"
"arhat.dev/dukkha/pkg/diff"
)
type Reason struct {
// Renderer name of the decisive step to generate difference
Renderer string
// Input to the Renderer that, once its ... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wr... |
package v1alpha1
import (
operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be seri... |
package jwtservice
import (
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/jake-hansen/agora/domain"
)
const (
USAGE_AUTH = "auth"
USAGE_REFRESH = "refresh"
)
// JWTService is a service for generating and validating JWTs.
type JWTService int... |
package counting
import (
"testing"
"github.com/jrh3k5/nanogengo/genio"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestCounting(t *testing.T) {
lines := []string{"one fish two fish", "red fish blue fish"}
linesProvider := genio.ArrayLinesProvider{Lines: lines}
wordCounter := LinesProvide... |
// Copyright 2018 <NAME>.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
//
// 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.a... |
/**
* Copyright (c) 2019, The Artemis Authors.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... |
package sprites
import (
"embed"
"time"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/audio"
"github.com/jespino/spaceshooter/media"
"github.com/jespino/spaceshooter/rect"
"github.com/jespino/spaceshooter/sprite"
)
//go:embed player
var playerFiles embed.FS
const (
powerup_time = 3000... |
package chord
import (
"bytes"
"errors"
"sort"
"github.com/nknorg/nkn/util/log"
)
func (r *Ring) DumpInfo(finger bool) {
for idx, vnode := range r.Vnodes {
log.Infof("ring.Vnodes[%d]: {", idx)
log.Infof("\tId: %x", string(vnode.Id))
log.Infof("\tHost: %s", vnode.Host)
for sidx, succ := range vnode.succ... |
package k8sinput
import (
"context"
"fmt"
"strings"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/discovery"... |
package eks
import (
"bufio"
"bytes"
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"io/ioutil"
"net"
"net/http"
"os"
"runtime"
"time"
"github.com/shogo82148/aws-xray-yasdk-go/xray"
"github.com/shogo82148/aws-xray-yasdk-go/xray/schema"
"github.com/shogo82148/aws-xray-yasdk-go/xray/xraylog"
)
con... |
package lexer
import (
"strconv"
)
type Token int
const (
ILLEGAL Token = iota
EOF
COMMENT
literal_beg
IDENT // main
INT // 12345
FLOAT // 123.45
CHAR // 'a'
STRING // "abc"
literal_end
operator_beg
LPAREN // (
RPAREN // )
LBRACK // [
RBRACK // ]
LBRACE // {
RBRACE // }
... |
// ------------------------------------------
// Generate gallery data
// ------------------------------------------
package main
import (
"fmt"
"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"io/ioutil"
"log"
"os"
"strconv"
"time"
)
var galleryFolderName = "golang-generated-gallery"
var sourcesDataPa... |
package tag
import (
"fmt"
"strings"
"testing"
)
var testStructureHtml = `<html>
<body>
<h1> A </h1>
<p> B
<span> C </span>
D
</p>
<h2> E </h2>
<div>
<p> F </p>
<p> G </p>
</div>
</body>
</html>
`
var testXhtml = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/x... |
// Copyright 2018 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, ... |
/*
* Copyright 2017 XLAB d.o.o.
*
* 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 (c) 2021 Intel 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 agr... |
package client
import (
"database/sql"
"fmt"
"github.com/imdario/mergo"
"github.com/jmoiron/sqlx"
"github.com/ory-am/fosite"
"github.com/ory-am/hydra/pkg"
"github.com/pborman/uuid"
"github.com/pkg/errors"
"strings"
)
var sqlSchema = []string{
`CREATE TABLE IF NOT EXISTS hydra_client (
id varchar(255)... |
// 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 vet
import (
"bytes"
"encoding/json"
"errors"
"flag"
"fmt"
exec "internal/execabs"
"log"
"os"
"path/filepath"
"strings"
"cmd/go/internal/ba... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package akamai
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The provider type for the akamai package. By defa... |
package generation
import (
"math"
"github.com/flowmatters/openwater-core/conv/units"
"github.com/flowmatters/openwater-core/data"
)
/*OW-SPEC
DynamicSednetGully:
inputs:
quickflow: m^3.s^-1
year: year
AnnualRunoff: 'mm.yr^-1'
annualLoad: ''
states:
parameters:
YearDisturbance: ''
GullyEndYear: ''
... |
//Program in Go to implement Djikstra's Algorithm
package main
import "fmt"
type Edge struct {
first_node_id int;
second_node_id int;
edge_length int;
}
type Graph struct {
edges []Edge;
nodes []Node;
}
type Node struct {
id int;
temp_val int;
temp_path []int;
}
//Takes an input graph, starting node.id, en... |
package event
import (
"regexp"
)
const (
EventCodeFormat = `fc6b([a-f0-9]{4})`
EventStructureFormat = `(06000100.*?fc6b[a-f0-9]{4})`
)
var (
EventCodeRegExp = regexp.MustCompile(EventCodeFormat)
)
const (
Leave = 1 + iota
JoinFinished
Move
Teleport
ChangeEquipment
HealthUpdate
EnergyUpdate
DamageS... |
package quota
import (
"bufio"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"syscall"
"github.com/alibaba/pouch/pkg/kernel"
"github.com/sirupsen/logrus"
)
const (
// QuotaMinID represents the minimize quota id.
QuotaMinID = uint32(16777216)
)
var (
// UseQuota represents use quota or not.
UseQuota = true... |
package main
import (
"bytes"
"errors"
"fmt"
"go/parser"
"go/printer"
"go/token"
"path/filepath"
"sync"
"sync/atomic"
"time"
"github.com/charlievieth/imports"
"github.com/charlievieth/imports/gocommand"
"github.com/golang/groupcache/lru"
"golang.org/x/sync/singleflight"
)
type FormatRequest struct {
F... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
// Copyright 2020 BlockCypher
//
// 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 fusegit
import (
"context"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"sync"
"syscall"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
)
type gitFile struct {
fs.Inode
mu sync.Mut... |
package cmdx
import (
"bytes"
"fmt"
"regexp"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func SetHelp(cmd *cobra.Command) {
cmd.PersistentFlags().Bool("help", false, "Show help for command")
cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
rootHelpFunc(cmd, args)
})
cmd.SetUsa... |
// Package scram provides Kerberos v5 sasl authentication.
package kerberos
import (
"context"
"encoding/binary"
"fmt"
"net"
"runtime"
"strings"
"github.com/jcmturner/gokrb5/v8/client"
"github.com/jcmturner/gokrb5/v8/gssapi"
"github.com/jcmturner/gokrb5/v8/messages"
"github.com/jcmturner/gokrb5/v8/types"
... |
package main
import (
"container/heap"
"math/rand"
"testing"
"github.com/HcashOrg/hcashd/blockchain/stake"
)
// fakePrioritizedTxes prepares some fake prioritized txes for test
func fakePrioritizedTxes() []*txPrioItem {
const numRandTx = 1000
// some items under the edge condition
prioritizedTxes := []*txPrio... |
/*
Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package e2e
import (
"io/ioutil"
"os"
"path/filepath"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/hyperledger/fabric/integration/helpers"
"github.com/hyperledger/f... |
// Copyright (c) 2016 ECS Team, Inc. - All Rights Reserved
// https://github.com/ECSTeam/cloudfoundry-top-plugin
//
// 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... |
package main
import (
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"strings"
)
//todo: 如果插入到文件中,并且判断有无
var (
fileName = ""
funcName = ""
commentShow = false
)
var (
// funcKeyWord 函数或者方法关键字
funcKeyWord = `func`
)
func main() {
flag.StringVar(&fileName, "fileName", "", "fileName")
fla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.