text stringlengths 3.08k 10.4k |
|---|
package finder
import (
"bytes"
"crypto/sha512"
"fmt"
"io"
"io/fs"
"math"
"os"
"path/filepath"
"runtime"
"time"
"github.com/gabriel-vasile/mimetype"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
"github.com/schollz/progressbar/v3"
"golang.org/x/net/context"
)
// IndexJob represents a job t... |
// DBDeployer - The MySQL Sandbox
// Copyright © 2006-2018 <NAME>
//
// 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 require... |
package go2048
import (
"image"
"math/rand"
"github.com/gitchander/go2048/utils"
)
type gameState struct {
Score int
Over bool
Won bool
KeepPlaying bool
Size image.Point
Tiles []*Tile
}
type GameManager struct {
score int
over bool
won bool... |
package message
import (
"bufio"
"encoding/binary"
"errors"
"fmt"
"io"
"sync"
)
// FixedFraming is a Framing implementation which encodes messages in a binary
// format with a fixed-length header. Messages must support Size and MarshalTo
// functions for marshal support (eg, generated Protobuf messages satisfy ... |
package dev
import (
"fmt"
"math/rand"
"strconv"
"github.com/200sc/geva/env"
"github.com/200sc/geva/pop"
"github.com/200sc/go-dist/floatrange"
"github.com/200sc/go-dist/intrange"
"github.com/oakmound/oak/alg"
)
type Dev interface {
Mechanic() *Mechanic
SetFitness(int)
pop.Individual
}
type Base struct {
... |
// Copyright 2019 Preferred Networks, 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 ... |
package volumes
import (
"context"
"errors"
"fmt"
"github.com/docker/docker/api/types/volume"
"gitlab.com/gitlab-org/gitlab-runner/executors/docker/internal/volumes/parser"
"gitlab.com/gitlab-org/gitlab-runner/executors/docker/internal/volumes/permission"
"gitlab.com/gitlab-org/gitlab-runner/helpers/docker"
)... |
/*
Copyright 2022 The KubeEdge 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, so... |
package delete
import (
"encoding/json"
"encoding/xml"
"fmt"
"github.com/neo4j/neo4j-go-driver/v4/neo4j"
"github.com/tlarsendataguy/goalteryx/sdk"
"github.com/tlarsendataguy/graphyx/bolt_url"
"github.com/tlarsendataguy/graphyx/util"
)
type xmlConfig struct {
JSON string `xml:",text"`
}
type Configuration str... |
// Copyright 2019 Northern.tech AS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... |
// Copyright 2018 SHIFT72
//
// 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 pgmigrate
import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"regexp"
"sort"
"strconv"
"strings"
"time"
)
type migration struct {
Version uint64 `db:"version"`
Name string `db:"name"`
Up string `db:"up"`
Down string `db:"down"`
}
var reMigrationName = regexp.MustCompilePOSIX... |
package client
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/docker/distribution/reference"
voucher "github.com/grafeas/voucher/v2"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/idtoken"
"google.golang.org/ap... |
package spaten
import (
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
"strconv"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/thomersch/grandine/lib/spatial"
)
// TestReadFileHeader is here in order to prevent regressions in header parsing.
func TestReadFileHeader(t *testing.T) {
buf, ... |
// Package watcher contains all configuration options for the command line interface
package watcher
import (
"fmt"
"os"
"time"
formatter "github.com/DaRealFreak/colored-nested-formatter"
"github.com/DaRealFreak/watcher-go/internal/raven"
"github.com/DaRealFreak/watcher-go/internal/version"
watcherApp "github.... |
package main
import (
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/cloudentity/acp/pkg/openbanking/client/accounts"
"github.com/cloudentity/acp/pkg/openbanking/models"
)
const (
chall... |
package main
import (
"errors"
"flag"
"fmt"
"os"
"os/signal"
"path/filepath"
"runtime"
"strings"
"syscall"
"github.com/aricart/wsgnatsd/server"
"github.com/nats-io/nats-server/v2/logger"
)
var bridge *Bridge
var assetServer *server.AssetsServer
type Bridge struct {
*server.Opts
WsServer *server.WsSer... |
package client
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"strings"
"github.com/mislav/go-travis/config"
"github.com/mislav/go-utils/api"
"github.com/mislav/go-utils/cli"
"github.com/mislav/go-utils/pathname"
"github.com/mislav/go-utils/utils"
)
var ignoredHeaders = []string{
"access-... |
package main
import (
"encoding/json"
"flag"
"github.com/nats-io/nats"
"io/ioutil"
"log"
"net/http"
"os"
"runtime"
"strings"
)
type HTTPRequest struct {
ID string `json:"id"`
Method string `json:"method"`
URL string `json:"url"`
Headers map[string][]string... |
// Copyright 2016 VMware, 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 main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"path/filepath"
"strings"
"gopkg.in/yaml.v2"
"github.com/digitalocean/godo"
"github.com/packetassailant/D2Deploy/libs"
"github.com/packetassailant/D2Deploy/models"
)
var (
fConfig = flag.String("config", "", "Provide an optional YAML configuration ... |
package libdag
import (
"context"
"fmt"
"github.com/deyami/libdag/utils/logs"
"sync"
)
type CONTROL_CODE int
const (
EXECUTION_CONTINUE CONTROL_CODE = iota
EXECUTION_SKIP_FOLLOWER_TASK
EXECUTION_STOP_JOB
)
type Task struct {
Key string
Name string
params map[string]interface{}
input ... |
package kvetchctl
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/duration"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/syncromatics/go-kit/cmd"
apiv1 "github... |
package op
// Control bit flags.
const (
Noop = 0x0 // 0
PC_re = 0x1 // 1
PC_we = 0x2 // 2
PC_ce = 0x4 // 3
MAR_re = 0x8 // 4
MDR_re = 0x10 // 5
MDR_we = 0x20 // 6
MAB_lsbre ... |
package storage
import (
"encoding/json"
"go-drive/common/drive_util"
"go-drive/common/registry"
"go-drive/common/types"
"go-drive/common/utils"
"gorm.io/gorm"
"log"
"time"
)
type DriveCacheDAO struct {
db *DB
timerStop func()
}
func NewDriveCacheDAO(db *DB, ch *registry.ComponentsHolder) *DriveCach... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: api/protobuf-spec/function.proto
package pb
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.... |
package main
import (
"fmt"
auth "github.com/abbot/go-http-auth"
"github.com/go-fsnotify/fsnotify"
"io/ioutil"
"log"
"net/http"
"os"
"sort"
"strings"
"time"
)
const Config = "/tmp/Redirector.txt"
const Log = "/tmp/Redirector.log"
const Form = "./Redirector.form"
var Redirects = make(map[string]string)
fun... |
package orttest
/*
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
... |
// Special Trie implementation for the URLRouter.
//
// This Trie implementation is designed to support strings that includes
// :param and *splat parameters. Strings that are commonly used for URL
// routing. You probably don't need to use this package directly.
//
// Example:
// TBD
package trie
import (
"errors"
... |
package transaction
import (
// Stdlib
"bytes"
"encoding/binary"
"io"
"regexp"
"strconv"
"strings"
// Vendor
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcutil/base58"
"github.com/pkg/errors"
"golang.org/x/crypto/ripemd160"
)
//Encoder structure for the converter
type Encoder struct {
w io.Wr... |
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package zapavm
import (
"errors"
"fmt"
"time"
nativejson "encoding/json"
log "github.com/inconshreveable/log15"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/choices"
"github.com... |
// Copyright 2022 VMware Tanzu Community Edition contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package plugin provides commonly used functionality for implementing Tanzu plugins.
//nolint:revive
package plugin
import (
"encoding/json"
"fmt"
"github.com/spf13/cobra"
)
var (
// Date... |
// Copyright 2014, 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 vtgate
import (
"errors"
"github.com/gitql/vitess/go/sqltypes"
"github.com/gitql/vitess/go/vt/topo"
"golang.org/x/net/context"
querypb "github.com/... |
package cmd
import (
"crypto/tls"
"fmt"
"math/big"
"net/http"
"os"
"os/user"
"path/filepath"
"github.com/BurntSushi/toml"
"github.com/spf13/cobra"
)
// Global command line flags.
var (
flCfgFile string
flInsecure bool
flDebug bool
flServerURL string
flToken string
)
func percentOf(current i... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rekognition
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type StartCelebrityRecognitionInput struct {
_ struct{} `type:"structure"`
// Idempotent token used to identify the s... |
// Copyright (c) 2020 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
// Package agentlog_test checks the logging
package agentlog_test
import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/lf-edge/eve/pkg/pillar/agentlog"
"github.com/lf-edge/eve/pkg/pillar/base"
"github.com/lf-edge/eve/pkg/pillar/p... |
package v1
/*
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... |
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Copied from github.com/broady/cdbuild.
// TODO(adg): clean this up.
package main
import (
"archive/tar"
"compress/gzip"
"crypto/rand"
"encoding/json"
"... |
package runtime
import (
"context"
"fmt"
"time"
"github.com/oasisprotocol/oasis-core/go/oasis-test-runner/env"
"github.com/oasisprotocol/oasis-core/go/oasis-test-runner/oasis"
"github.com/oasisprotocol/oasis-core/go/oasis-test-runner/oasis/cli"
"github.com/oasisprotocol/oasis-core/go/oasis-test-runner/scenario... |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package libgobuster
import (
"bufio"
"context"
"fmt"
"log"
"os"
"strings"
"sync"
"time"
)
// SetupFunc is the "setup" function prototype for implementations
type SetupFunc func(*Gobuster) error
// ProcessFunc is the "process" function prototype for implementations
type ProcessFunc func(*Gobuster, string) ([]... |
// Package json implements the sq driver for JSON. There are three
// supported types:
// - JSON: plain old JSON
// - JSONA: JSON Array, where each record is an array of JSON values on its own line.
// - JSONL: JSON Lines, where each record a JSON object on its own line.
package json
import (
"context"
"database/sql... |
package objectpool
import (
"fmt"
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/objectpool"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func Tes... |
package egoscale
// SecurityGroup represent a firewalling set of rules
type SecurityGroup struct {
ID string `json:"id"`
Account string `json:"account,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"dom... |
package mpdisk
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
mp "github.com/mackerelio/go-mackerel-plugin"
"gopkg.in/alecthomas/kingpin.v2"
)
var deviceNamePattern = regexp.MustCompile(`[^[[:alnum:]]_-]`)
// DiskPlugin is for mackerel-agent-plugins
type DiskPlugin struct {
Inc... |
package main
import (
"os"
"os/signal"
"syscall"
"flag"
"fmt"
"github.com/streadway/amqp"
"math/rand"
"runtime"
"time"
)
type Conf struct {
host string
port uint
login string
password string
vhost string
heartbeat uint
withRoutingKey bool
exchangeName ... |
package main
import (
"fmt"
"net/http"
"os"
t "time"
"strconv"
"github.com/rancher/go-rancher-metadata/metadata"
"github.com/rancher/go-rancher/v2"
"github.com/rancher/log"
logserver "github.com/rancher/log/server"
"github.com/rancher/scheduler/events"
"github.com/rancher/scheduler/resourcewatchers"
"git... |
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// 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 Soft... |
// Copyright 2017-2020 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
package main
import (
"log"
"os"
"time"
"randomkeyword"
"amazon"
"products"
"downloader"
"ranker"
)
type Ranker func (*products.Product) *products.RankedProduct
var boughtProducts []string = nil
func main() {
start := time.Now()
for {
log.Println("==================== SEARCHING FOR PURPLES ==============... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package gnb
import (
"fmt"
"free5gc-cli/logger"
"net"
"os"
"os/exec"
"sync"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/songgao/water"
)
// BUFFERSIZE of the packet
const BUFFERSIZE = 1500
// MTU is 1500 - IPV4 - UDP - GTP
const MTU = "1400"
func runIP(args ...string) {
c... |
// Copyright (c) 2016 <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 l... |
// Copyright (c) 2021, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
package webhooks
import (
"context"
oamv1 "github.com/crossplane/oam-kubernetes-runtime/apis/core/v1alpha2"
"github.com/verrazzano/verrazzano/application-o... |
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... |
// Copyright 2011 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 fnv
import (
"bytes"
"encoding/binary"
"hash"
"testing"
)
const testDataSize = 40
type golden struct {
sum []byte
text string
}
var golden32 ... |
package lua
import (
"flag"
"fmt"
"os"
"testing"
)
var s *State
func TestMain(m *testing.M) {
flag.Parse()
fmt.Println("test begin")
s = NewState()
s.OpenLibs()
c := m.Run()
fmt.Println("top=", s.GetTop())
fmt.Println("regnum=", len(s.g.reg), "freeidx=", len(s.g.freeidx), "tplen=", len(s.g.tp))
s.GC()
f... |
package fileutils
import (
"errors"
"fmt"
"io"
"os"
FP "path/filepath"
S "strings"
L "github.com/fbaube/mlog"
)
// MAX_FILE_SIZE is set (arbitrarily) to 2 megabytes
const MAX_FILE_SIZE = 2000000
// PathProps describes a filepath we have redd, will read, or will create.
// It might also be a directory or syml... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package didorbgenerator
import (
"fmt"
"net/url"
"strings"
"github.com/trustbloc/edge-core/pkg/log"
"github.com/trustbloc/orb/pkg/activitypub/vocab"
"github.com/trustbloc/orb/pkg/anchor/subject"
"github.com/... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package image
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"github.com/h2non/bimg"
"github.com/rs/zerolog/log"
)
// FitType type
type FitType int
// Fit
const (
Fi... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
// Copyright 2018 ETH Zurich, Anapaya Systems
//
// 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 pgs
import (
"fmt"
"sort"
"strconv"
"strings"
"time"
)
const outputPathKey = "output_path"
// Parameters provides a convenience for accessing and modifying the parameters
// passed into the protoc-gen-star plugin.
type Parameters map[string]string
// ParseParameters converts the raw params string provi... |
package s3
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"strings"
"gopkg.in/amz.v3/aws"
"gopkg.in/amz.v3/s3"
"github.com/restic/restic/backend"
)
const maxKeysInList = 1000
const connLimit = 10
const backendPrefix = "restic"
func s3path(t backend.Type, name string) string {
if t == backend.Config {
... |
package kkcflate
import (
"math"
)
type hcode struct {
code, len uint16
}
type huffmanEncoder struct {
codes []hcode
freqcache []literalNode
bitCount [17]int32
}
type literalNode struct {
literal uint16
freq int32
}
type levelInfo struct {
level int32
lastFreq int32
nextCharFreq int32
nextPai... |
package resourcerequestoperator
import (
"context"
"crypto/rand"
"fmt"
"math/big"
"sync"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/util/workqueue"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"... |
// SPDX-FileCopyrightText: 2022-present Open Networking Foundation <<EMAIL>>
//
// SPDX-License-Identifier: Apache-2.0
package logging
import (
"bytes"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"net/url"
"strings"
"sync"
)
func newZapOutput(logger LoggerConfig, output OutputConfig, sink SinkConfig) (*zapOutp... |
package lksdk
import (
"os"
"path/filepath"
"time"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v3/pkg/media"
"github.com/pion/webrtc/v3/pkg/media/h264reader"
"github.com/pion/webrtc/v3/pkg/media/ivfreader"
"github.com/pion/webrtc/v3/pkg/media/oggreader"
)
const (
// defaults to 30 fps
defaultH264Fr... |
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package usbc
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"strconv"
"time"
"chromiumos/tast/common/servo"
"chromiumos/tast/testing"
)... |
package socket
import (
"encoding/binary"
"fmt"
"net"
"sync"
"time"
"github.com/mh-cbon/dht/kmsg"
)
//TxOpt is a option setter
type TxOpt func(*TxServer)
// TxOpts are TxServer options.
var TxOpts = struct {
WithTimeout func(duraton time.Duration) TxOpt
}{
WithTimeout: func(duration time.Duration) TxOpt {
... |
/*
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 ... |
/*
Sniperkit-Bot
- Status: analyzed
*/
// Copyright 2015-2016, Cyrill @ Sch<EMAIL>.fm and the CoreStore contributors
//
// 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.... |
// Copyright (c) 2009-2020 <NAME> <<EMAIL>> and others
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, thi... |
package hpp
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestResponseUnmarshalJSON(t *testing.T) {
hpp := New("mysecret")
timestamp := JSONTime(time.Date(2013, 8, 14, 12, 22, 39, 0, time.UTC))
var tests = []struct {
//given
description s... |
package main
import (
"github.com/gopherjs/gopherjs/js"
"github.com/oskca/gopherjs-vue"
"strconv"
"vueutil"
)
type DraggableHeaderData struct {
*js.Object
Dragging bool `js:"dragging"`
C *Point `js:"c"`
Start *Point `js:"start"`
}
func NewDraggableHeaderData() interface{} {
dh := &DraggableHeade... |
package driver
import (
"context"
"fmt"
"io"
"os"
dbv1alpha1 "github.com/isotoma/db-operator/pkg/apis/db/v1alpha1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"github.com/isotoma/db-operator/pkg/apis"
"sigs.k8s.io/contr... |
// Package credstash implements backend for Credstash (that uses AWS KMS and DynamoDB)
// Heavily inspired in github.com/ouzi-dev/credstash-operator using https://github.com/versent/unicreds
package credstash
import (
"fmt"
"strconv"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github... |
// Package ca : Symbios Certificate Authority
// Author: <NAME>
package ca
import (
"fmt"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/dnascimento/symbios/src/logger"
"github.com/dnascimento/symbios/src/pkix"
"github.com/dnascimento/symbios/src/util"
)
var userCertificate *pkix.Certificate
var caKey *pkix.... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: meta.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time a... |
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"strings"
"time"
readline "github.com/chzyer/readline"
rcon "github.com/forewing/csgo-rcon"
)
// Flags of the command line
type Flags struct {
Address *string `json:",omitempty"`
Password *string `json:",omi... |
package vsdclient
import (
"crypto/tls"
"fmt"
"math/rand"
"strings"
"sync"
"time"
"github.com/golang/glog"
"github.com/OpenPlatformSDN/nuage-oci-agent/config"
"github.com/nuagenetworks/go-bambou/bambou"
"github.com/nuagenetworks/vspk-go/vspk"
)
const (
MAX_SUBNETS = 2048 // Practical, safety max limit o... |
package controllers
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"github.com/chanxuehong/wechat/oauth2"
mpoauth2 "github.com/chanxuehong/wechat/open/oauth2"
"github.com/gin-gonic/gin"
"github.com/gomodule/redigo/redis"
_ "app/config" // 加载 .env 配置文件
"app/database"
"app/modules/oauth/models"
"app... |
package tpm2tools
import (
"crypto"
"crypto/rsa"
"encoding/asn1"
"fmt"
"io"
"math/big"
"sync"
"github.com/google/go-tpm/tpm2"
)
// Global mutex to protect against concurrent TPM access.
var signerMutex sync.Mutex
type tpmSigner struct {
Key *Key
Hash crypto.Hash
}
// Public returns the tpmSigners public... |
package linode
import (
"context"
"fmt"
"log"
"strconv"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/linode/linodego"
)
func resourceLinodeToken() *schema.Resource {
return &schema.Resource{
Create: resourceLinodeTokenCreate,
Read: resourceLinodeTokenRead,
Update: reso... |
package routefix
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"context"
securityv1 "github.com/openshift/api/security/v1"
configclient "github.com/openshift/client-go/config/clientset/versioned"
securityclient "github.com/openshift/client-go/security/clientset/versio... |
// Copyright (c) of parts are held by the various contributors (see the CLA)
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
package main
import (
"encoding/hex"
"errors"
"flag"
"fmt"
"os/user"
"strings"
"time"
"github.com/FactomProject/factom"
"github.c... |
package bitexporter
import (
"bytes"
"encoding/json"
prqueue "github.com/bgadrian/data-structures/priorityqueue"
"github.com/edendoron/bit-framework/internal/models"
"log"
m "math"
"net/http"
"time"
)
// init global package variables and constants
// ReportsQueue saves the incoming reports by priority
var Re... |
package pixel
import (
"image"
"image/color"
)
type Option struct {
Threshold float32
IncludeAA bool
}
func Match(img1, img2 image.Image, rect image.Rectangle, output *image.RGBA, opt *Option) int {
var threshold float32
threshold = 0.1
if opt != nil {
threshold = opt.Threshold
}
maxDelta := 35215 * thres... |
package domain
import (
"context"
"sort"
"flamingo.me/flamingo-commerce/v3/product/domain"
"flamingo.me/flamingo/v3/framework/flamingo"
)
type (
// OrderDecoratorInterface defines the interface of the order decorator
OrderDecoratorInterface interface {
Create(context.Context, *Order) *DecoratedOrder
}
// ... |
// Code generated by go-swagger; DO NOT EDIT.
package workflow_services
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "g... |
package terraform
import (
"encoding/json"
"fmt"
"io"
"strings"
"github.com/cycloidio/terracost/query"
)
// Plan is a representation of a Terraform plan file.
type Plan struct {
providerInitializers map[string]ProviderInitializer
Configuration Configuration `json:"configuration"`
PriorState *State ... |
package kubernetes
import (
"fmt"
"time"
"github.com/docker/cli/cli/command/formatter"
"github.com/docker/cli/kubernetes/labels"
"github.com/docker/docker/api/types/swarm"
appsv1beta2 "k8s.io/api/apps/v1beta2"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1 "k8s.io/client-go/k... |
package polynomial
import (
"encoding/binary"
"errors"
"io"
"github.com/cronokirby/safenum"
"github.com/fxamacker/cbor/v2"
"github.com/sa8/multi-party-sig/pkg/math/curve"
)
type rawExponentData struct {
IsConstant bool
Coefficients []curve.Point
}
// Exponent represent a polynomial F(X) whose coefficients... |
// Copyright © 2019 <NAME>
//
// 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 ld
import (
"context"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"strings"
rice "github.com/GeertJohan/go.rice"
"github.com/piprate/json-gold/ld"
"github.com/pkg/errors"
)
const (
// Recommended Accept from the AS2 spec; json-gold defaults to the more inclusive:
// "application/ld+json, applicati... |
/*
Package repository implements repository for handling fast and efficient access to data required
by the resolvers of the API server.
Internally it utilizes RPC to access Opera/Lachesis full node for blockchain interaction. Mongo database
for fast, robust and scalable off-chain data storage, especially for aggregate... |
package main
import (
"errors"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"
"sigs.k8s.io/sig-storage-lib-external-provisioner/controller"
)
func (p *nasProvisioner) Provision(options controller.ProvisionOptions) (*core.Pe... |
package cpu
import (
"fmt"
"6502VM/mem"
)
const (
pageZeroBegin = 0x0000
pageZeroEnd = 0x00FF
pageOneBegin = 0x0100
pageOneEnd = 0x01FF
pageTwoBegin = 0x0200
negativeFlagMask = 0x80
zeroFlagMask = 0x02
)
/*
CPU Data structure to hold CPU registers and flags
*/
type CPU struct {
x byte //... |
package main
import (
"image"
"image/color"
"math"
)
// Channel stores a histogram of all values present in
// and image for a specific colour channel
type Channel struct {
Shades [65536]uint32
Min, Max, Total uint32
}
// Add adds a colour value to the channel
func (c *Channel) Add(val uint32) {
c.Sha... |
// Copyright (c) 2019, The eTable 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 agg
import (
"github.com/emer/etable/etable"
"github.com/emer/etable/etensor"
)
// DescAggs are all the standard aggregates
var DescAggs = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.