text stringlengths 3.08k 10.4k |
|---|
package get
import (
"github.com/TrashPony/Veliri/src/dbConnect"
"github.com/TrashPony/Veliri/src/mechanics/gameObjects/detail"
"log"
)
func BodiesType() map[int]detail.Body {
rows, err := dbConnect.GetDBConnect().Query("SELECT " +
"id, " +
"name, " +
"mother_ship, " +
"speed, " +
"initiative, " +
"ma... |
/* Rackspace API wrapper */
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"strconv"
"strings"
)
const (
identityUrl = "https://identity.api.rackspacecloud.com/v2.0/tokens"
authRequest = `{ "auth": {
"RAX-KSKEY:apiKeyCredentials": {
"apiKey": "%s",
"username":... |
package core
import (
"io"
"time"
)
// User represents a chatkit user.
type User struct {
ID string `json:"id"` // ID of the user
Name string `json:"name"` // Name associated with the user
AvatarURL string `json:"a... |
package naivewatcher
import (
"errors"
"os"
"path/filepath"
"sync"
"time"
"github.com/argoproj/argo-events/gateways/common/fsevent"
)
const (
eventsQueueSize = 100
errorsQueueSize = 100
)
// Watchable is an interface of FS which can be watched by this watcher
type Watchable interface {
Walk(root string, wa... |
package ibc
import "time"
type MsgUpdateClientParams struct {
MaybeTendermintLightClientUpdate *TendermintLightClientUpdate `json:"maybeTendermintLightClientUpdate"`
MaybeSoloMachineLightClientUpdate *SoloMachineLightClientUpdate `json:"maybeSoloMachineLightClientUpdate"`
// TODO: Localhost LightClient
ClientI... |
// Copyright 2021 iLogtail Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
package fshash
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"io"
"log"
"os"
"path"
"runtime"
"sort"
"strings"
"sync"
"gopkg.in/cheggaaa/pb.v1"
)
const defaultChunkSize = 256 * 1024
const sampleRatio int64 = 16
const cpuMultiplicator = 8
// ReadPathArgs contains arguments for the ReadPath function
type... |
package pttbbs
import (
"context"
"time"
"google.golang.org/grpc"
apipb "github.com/ptt/pttweb/proto/api"
)
var grpcCallOpts = []grpc.CallOption{grpc.FailFast(true)}
type GrpcRemotePtt struct {
service apipb.BoardServiceClient
}
func NewGrpcRemotePtt(boarddAddr string) (*GrpcRemotePtt, error) {
conn, err :=... |
// Package eval provides evaluation of Ko circuits.
package eval
import (
"fmt"
"github.com/kocircuit/kocircuit/lang/circuit/eval"
"github.com/kocircuit/kocircuit/lang/circuit/model"
"github.com/kocircuit/kocircuit/lang/go/eval/symbol"
"github.com/kocircuit/kocircuit/lang/go/kit/tree"
)
type Evaluate struct {
... |
package handler
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
"github.com/gorilla/mux"
"github.com/netobserv/network-observability-console-plugin/pkg/httpclient"
"github.com/netobserv/network-observability-console-plugin/pkg/loki"
"github.com/netobserv/network-observability-console-plugin/pkg... |
package otelsql
import (
"context"
"database/sql"
"database/sql/driver"
"errors"
"io"
"strconv"
"sync"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/metric/global"
"go.opentelemetry.io/otel/metric/instrument"
"go.opentelemetry.io/otel/metric/unit"
semconv "go.opentelemetry.io/otel/semconv/v1.10.0"
... |
/*
Copyright (c) 2019 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute... |
package bgc
import (
"fmt"
"net/http"
"github.com/viant/dsc"
"github.com/viant/toolbox/secret"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"
"google.golang.org/api/bigquery/v2"
"google.golang.org/api/option"
htransport "google.golang.org/api/transpo... |
/* MIT License
*
* Copyright (c) 2018 <NAME> <mitghi[at]gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, cop... |
// Copyright (c) 2015, Segiusz 'q3k' Bazanski <<EMAIL>>
// 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,
// ... |
package pack
import (
"math/rand"
"reflect"
"strings"
"github.com/renproject/surge"
)
// A Kind is an optionally abstract type identifier. It can be thought of as the
// "type of a type", or the "constructor for a type". For example, a struct is
// an abstract type identifier, because it does not bind the respec... |
/*
* GoScans, a collection of network scan modules for infrastructure discovery and information gathering.
*
* Copyright (c) Siemens AG, 2016-2021.
*
* This work is licensed under the terms of the MIT license. For a copy, see the LICENSE file in the top-level
* directory or visit <https://opensource.org/licenses/MIT>.
... |
package main
import (
"fmt"
"github.com/tidwall/gjson"
"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm"
"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm/types"
)
func main() {
// SetVMContext is the entrypoint for setting up this entire Wasm VM.
// Please make sure that this entrypoint be called during... |
package autotest
import (
"reflect"
"testing"
"time"
"github.com/EndFirstCorp/execfactory"
)
func TestRunTests(t *testing.T) {
exec = execfactory.NewMockCreator([]execfactory.MockInstance{})
RunTests("folder")
exec = execfactory.NewMockCreator([]execfactory.MockInstance{
{SimpleOutputOut: []byte("test"), Si... |
// Copyright (C) 2019, <NAME>.
// All right reserved.
// @author xiongfa.li
// @version V1.0
// Description:
package message
import (
"bytes"
"fmt"
"io"
"mqtt/packet"
"mqtt/util"
"strings"
)
type SubAckVarHeader struct {
//报文标识符(Packet Identifier)。
PacketIdentifier uint16
//PUBL... |
package golem
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/Webstrates/golem-herder/container"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
docker "github.com/fsouza/go-dockerclient"
)
func getName(id string) string {
return fmt.Sprintf("golem-%s", id)
}
// Spawn will... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package connect
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type StartContactRecordingInput struct {
_ struct{} `type:"structure"`
/... |
// Code generated by protoc-gen-go.
// source: rpclog/protorpclog.proto
// DO NOT EDIT!
package protorpclog
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "go.pedge.io/pb/go/google/protobuf"
// Reference imports to suppress errors if they are not otherwise ... |
/*
* Copyright (c) 2019. Aberic - 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 xstrings
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestIsEmpty(t *testing.T) {
assert.True(t, IsEmpty(""))
assert.False(t, IsEmpty("text"))
assert.False(t, IsEmpty(" "))
}
func TestIsNotEmpty(t *testing.T) {
assert.False(t, IsNotEmpty(""))
assert.True(t, IsNotEmpty("text"))
asser... |
package qs
import (
"reflect"
"strings"
"testing"
)
type defaultPresenceTestCase struct {
tagStr reflect.StructTag
defaultMP MarshalPresence
mp MarshalPresence
defaultUP UnmarshalPresence
up UnmarshalPresence
}
func TestParseTag_DefaultPresence(t *testing.T) {
testCases := []defaultPresence... |
// +build swift
package swift
import (
"fmt"
"sync"
"time"
"github.com/janelia-flyem/dvid/dvid"
"github.com/janelia-flyem/dvid/storage"
"github.com/ncw/swift"
)
// Batch implements the storage.Batch interface for the Swift storage engine.
type Batch struct {
sync.Mutex
// A reference to the parent store wh... |
// Add a remote TLS certificate to a local Java keystore
// Requires a Java environment
// Return codes:
// 1: wrong usage (commandline arguments)
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"path"
"path/filepath"
)
const (... |
/*
Copyright 2018 The Chronologist 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 2016 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package topdown_test
import (
"bytes"
"context"
"encoding/json"
"fmt"
"strings"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/... |
// Copyright © 2020 AMIS Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
package log
import (
"fmt"
"io"
"io/ioutil"
stdlog "log"
"os"
"github.com/fatih/color"
)
const (
ERROR = 1 << iota
WARN
INFO
DEBUG
)
// InfoLogger logs to Stdout by default, can be override.
var InfoLogger = stdlog.New(ioutil.Discard, "[Info ] ", stdlog.Ldate|stdlog.Ltime)
// WarnLogger logs to Stdout by... |
// Copyright 2021 VMware, Inc.
// SPDX-License-Identifier: MIT
package v1
import (
"errors"
"fmt"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
"github.com/vmware-tanzu-labs/operator-builder/internal/utils"
)
const (
defaultComponentDescription = `Manage %s workload`
)
var ErrNoComponentsOnComponent = erro... |
// Copyright 2020 spaGO Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// CharLM implements a character-level language model that uses a recurrent neural network as its backbone.
// A fully connected softmax layer (a.k.a decoder) is... |
// 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 heap provides heap operations for any type that implements
// heap.Interface. A heap is a tree with the property that each node is the
// minimum-val... |
package sshtunnel
import (
"fmt"
"io"
"io/ioutil"
"net"
"strings"
"time"
"github.com/cloudfoundry/bosh-init/internal/golang.org/x/crypto/ssh"
bosherr "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfou... |
package main
import (
"encoding/binary"
"github.com/go-ble/ble"
"github.com/pkg/errors"
)
type DevData struct {
T float64 `json:"T"`
H float64 `json:"H"`
P float64 `json:"P"`
BattL uint16 `json:"battLvl"`
BattV float64 `json:"battVolt"`
Count uint32 `json:"count"`
}
type parser func([]byte, [... |
package command
import (
"bytes"
"encoding/xml"
"fmt"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"time"
)
type CurrencyQuery struct {
XMLName xml.Name `xml:"query"`
Rates []struct {
ID string `xml:"id,attr"`
Rate float64 `xml:"Rate"`
} `xml:"results>rate"`
}
type rateCache struct {
rate ... |
package logger
import (
"DaruBot/pkg/errors"
"fmt"
"github.com/sirupsen/logrus"
"io"
"path/filepath"
"runtime"
"strings"
"time"
)
type Level uint32
const (
PanicLevel Level = iota
FatalLevel
ErrorLevel
WarnLevel
InfoLevel
DebugLevel
TraceLevel
)
func (l Level) String() string {
switch l {
case Pani... |
/*
* 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 ... |
package servermanager
import (
"fmt"
"net/http"
"runtime/debug"
"github.com/getsentry/raven-go"
"github.com/go-chi/chi/middleware"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
)
const (
sentryDSN = "https://d8325490... |
package server
import (
"bufio"
"errors"
"expvar"
"fmt"
"net"
"net/http"
"strings"
"time"
"github.com/go-kit/kit/metrics"
"github.com/go-kit/kit/metrics/provider"
"github.com/prometheus/client_golang/prometheus"
)
func expvarHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type",... |
package main
import (
"context"
"flag"
"fmt"
"github.com/baxiang/soldiers-sortie/zipkin-go/middleware"
"github.com/baxiang/soldiers-sortie/zipkin-go/pb"
"github.com/baxiang/soldiers-sortie/zipkin-go/service"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/sd"
"github.com/go-kit/kit/sd/consul"
"github.com/... |
//
// Package xlsx2json wraps the github.com/tealag/xlsx package (used under a BSD License) and a fork of Robert Krimen's Otto
// Javascript engine (under an MIT License) providing an scriptable xlsx2json exporter, explorer and importer utility.
//
// @author <NAME>, <<EMAIL>>
//
// Copyright (c) 2016, <NAME>
// All r... |
package capture
// TODO(johnny): While they started a bit different, over time this file and
// materialize/adapter.go now look essentially identical in terms of
// structure. They do differ on interfaces, however, making re-use a challenge.
// If contemplating a change here, make it there as well.
// And when general... |
package goutprofile
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path/filepath"
"strings"
lm "github.com/ahrtr/gocontainer/map/linkedmap"
)
// ValidateDir validates all the ut profiles in the specified directory dir.
// If the second parameter recursive is true, then it recursively valid... |
package variable
import (
"fmt"
"math"
"reflect"
"strconv"
)
// FiberVariable define the fiber's key / values
var FiberVariable []*InstructionVariable
// InstructionVariable Define a key / value of the fiber
type InstructionVariable struct {
Key string
Value interface{}
}
// SearchVariable Search a key in f... |
package metrics2
import (
"strconv"
"testing"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/require"
metrics_util "go.skia.org/infra/go/metrics2/testutils"
"go.skia.org/infra/go/testutils/unittest"
)
func TestClean(t *testing.T) {
unittest.SmallTest(t)
require.Equal(t, "a_b_c"... |
package date
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
)
// These are predefined formats to use in PersianDate.Format.
const (
GenericFormat = "yyyy/mm/dd"
GenericShortFormat = "yyyy/m/d"
MonthDayFormat = "MMMM dd"
MonthYearFormat = "MMMM, yyyy"
WrittenFormat = "W"
Serializ... |
package setup
import (
"fmt"
"io/ioutil"
"log"
"os"
"sort"
"strings"
"github.com/FINTLabs/fint-consumer/common/config"
"github.com/FINTLabs/fint-consumer/common/github"
"github.com/FINTLabs/fint-consumer/common/types"
"github.com/FINTLabs/fint-consumer/common/utils"
"github.com/FINTLabs/fint-... |
// Package resolve is a CoreDNS plugin that establishes a grpc endpoint listening for DnsResolver requests
// and reformats them into ordinary dns requests which in turn is sent to the ordinary CoreDNS endpoint.
package resolve
import (
"context"
"errors"
"fmt"
"github.com/coredns/coredns/core/dnsserver"
"github.... |
// Copyright 2018 Istio 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 agree... |
package core
import (
"encoding/json"
"log"
"sort"
"time"
)
// GameBattleLeg is
type GameBattleLeg struct {
Battle *GameBattle `json:"-"`
Index int
Teams [TeamNum]*Team
TeamPlayers [TeamNum][]*Player
IDPlayers map[int]*Player
Table *Table `json:"-"`
}
// JSON is
func (l *GameBattle... |
package main
import (
"encoding/json"
"flag"
"fmt"
"html/template"
"io"
"net/http"
"os"
"os/signal"
"path"
"runtime/pprof"
"github.com/gorilla/handlers"
"github.com/scritch007/go-tools"
"github.com/scritch007/shareit"
"github.com/scritch007/shareit/types"
echo "github.com/labstack/echo/v4"
)
type Th... |
package main
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/x509"
"database/sql"
"encoding/base64"
"encoding/json"
"encoding/pem"
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"time"
"github.com/SherClockHolmes/webpush-go"
"github.com/golang/protobuf/proto"
"github.com/jmoiron/sqlx"
"google.gol... |
package playtak
import (
"context"
"flag"
"log"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"time"
"github.com/google/subcommands"
"github.com/nelhage/taktician/playtak"
"github.com/nelhage/taktician/playtak/bot"
)
type Command struct {
server string
user string
pass string
accept ... |
package scripts
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"sync"
"sync/atomic"
)
type scriptResult struct {
Path string
Success bool
Skipped bool
Err error
}
type Runner struct {
locker uint32
Script string `json:"script"`
Errors ... |
package responses
import (
"github.com/mackerelio/go-osstat/cpu"
"github.com/mackerelio/go-osstat/memory"
"github.com/mackerelio/go-osstat/network"
common_entity "github.com/oasisprotocol/oasis-core/go/common/entity"
common_node "github.com/oasisprotocol/oasis-core/go/common/node"
common_quantity "github.com/oas... |
package picoweb
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"strconv"
"github.com/julienschmidt/httprouter"
mgo "gopkg.in/mgo.v2"
"strings"
)
//var upgrader = websocket.Upgrader{EnableCompression: true, HandshakeTimeout: time.Second * 5... |
package test
import (
"context"
"encoding/json"
"fmt"
"github.com/go-redis/redis/v8"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"identification-service/pkg/app"
"identification-service/pkg/config"
"identification-service/pkg/database"
"identification-service/pkg/http/contract"... |
// Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license... |
package main
import (
"errors"
"fmt"
"log"
"net/http"
"strconv"
"sync"
"time"
"github.com/evan-buss/watch-together/metadata/scraper/data"
"github.com/evan-buss/watch-together/metadata/scraper/storage"
)
// Scraper defines the rules for a specific scraper
type Scraper struct {
Seed []string
Client http.C... |
package main
import (
"fmt"
"log"
"strings"
ui18n "github.com/Unknwon/i18n"
"github.com/anonutopia/gowaves"
"gopkg.in/macaron.v1"
"gopkg.in/telegram-bot-api.v4"
)
func homeView(ctx *macaron.Context) {
ctx.Data["Title"] = ""
ctx.HTML(200, "home")
}
func crowdfundingView(ctx *macaron.Context) {
ctx.Data["T... |
package main
import (
"archive/tar"
"compress/gzip"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"time"
)
var (
ip = flag.String("i", "", "The IP Address the server should run on")
port = flag.Int("p", 8086, "The port on which the server li... |
package controllers
import (
"bejigo/models"
"bejigo/syserrors"
"encoding/json"
"errors"
"github.com/astaxie/beego/cache"
"github.com/astaxie/beego/utils/captcha"
"github.com/astaxie/beego/validation"
"unicode/utf8"
)
type UserController struct {
BaseController
}
var cpt *captcha.Captcha
func init() {
sto... |
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"log"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"unicode"
"github.com/hermanschaaf/kana"
"github.com/mattn/go-skkdic"
)
const name = "skk-cli"
const version = "0.0.1"
var revision = "HEAD"
var (
reTrim = regexp.MustCompile("[aiueo]... |
// 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 xmlutil
import (
"bufio"
"bytes"
"encoding/xml"
"errors"
"strings"
)
// FindObjectConfig provides configuration for finding XML objects in a
// given document.
type FindObjectConfig interface {
// Start returns the xml.StartElement for the XML object that
// is being searched for.
Start() *xml.StartEl... |
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"time"
)
var v4 = &mtgv4{
db: mtgv4db{},
saveTo: ".json.db",
downloadFrom: "https://mtgjson.com/v4/json/AllSets.json",
}
type mtgv4 struct {
db mtgv4db
byName mtgv4NameLookup
byID mtgv4IdLookup... |
package thelm
import (
"bytes"
"io"
"sync"
"github.com/nsf/termbox-go"
)
// UIView is the graphical representation of the data. It is used to draw the
// data to the screen.
type UIView struct {
buffer []byte
readpos int
lines int
sizeX, sizeY int
offsetX, offsetY int
high... |
/*
The MIT License (MIT)
Copyright (c) 2015 myhug.cn and zhouwench (<EMAIL>)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limita... |
// Copyright 2020 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Package core implements core components of gogitsu lib.
//
// router.go implements Router interface and concrete implementations.
// Actually only Gorilla based concrete R... |
/*
Copyright 2022 Erigon 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... |
package crd
import (
"log"
"sync"
"github.com/rotisserie/eris"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/crd/client/clientset/versioned/scheme"
v1 "github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/crd/solo.io/v1"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg... |
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Knowledgetraining
type Knowledgetraining struct {
// Id - The globally unique identifier for the object.
Id *string `json:"id,omitempty"`
// DateTriggered - Trigger date-time. Date time is repres... |
// Created by NGnius 2020-01-05
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"github.com/faiface/beep"
"github.com/faiface/beep/flac"
"github.com/faiface/beep/mp3"
"github.com/faiface/beep/speaker"
"github.com/faiface/beep/vorbis"
"github.com/faiface/beep/wav"
//"os"
"time"
)
type Player struct... |
package model
import (
"blog/pkg/errcode"
"blog/pkg/status"
"github.com/jinzhu/gorm"
)
type BlogComment struct {
Model
ArticleId int `json:"article_id";gorm:"type:int;unsigned;not null;default:0"`
Name string `json:"name";gorm:"type:varchar(64);not null;default:''"`
Email string `json:"email";gorm:"type:varcha... |
package main
import (
ct "TBack/api/controller"
mw "TBack/api/middleware"
"TBack/conf"
repo "TBack/repository"
"TBack/util"
"bufio"
"context"
"fmt"
"log"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/jasonlvhit/gocron"
"github.com/jinzhu/gorm"
"github.com/juj... |
/*
Copyright 2021 <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 writing, software
distributed ... |
package dataset
import (
"context"
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/ONSdigital/dp-api-clients-go/dataset"
datasetclient "github.com/ONSdigital/dp-api-clients-go/dataset"
"github.com/ONSdigital/dp-api-clients-go/zebedee"
zebedeeclient "github.com/ONSd... |
package main
import (
"context"
"flag"
"fmt"
"os"
"strings"
"time"
"miflorad/common"
impl "miflorad/common/ble"
"github.com/go-ble/ble"
"github.com/go-ble/ble/examples/lib/dev"
)
const discoveryTimeout = 10 * time.Second
func readData(client ble.Client) {
prefix := flag.Args()[0]
id := common.MifloraGe... |
// SPDX-License-Identifier: Unlicense OR MIT
package wid
import (
"gioui.org/f32"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/op/clip"
"gioui.org/op/paint"
"gioui.org/text"
"gioui.org/unit"
)
// EditDef is the parameters for the text editor
type EditDef struct {
Widget
Editor
shaper text.Shaper
alignm... |
package gopush_test
import (
"io/ioutil"
"math"
"os"
"path/filepath"
"reflect"
"testing"
"github.com/DataWraith/gopush"
)
// Test that literals are correctly pushed onto their respective stacks
func TestPushingLiterals(t *testing.T) {
interpreter := gopush.NewInterpreter(gopush.DefaultOptions)
err := interp... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/google/cloudprober/surfacers/postgres/proto/config.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
github.com/google/cloudprober/surfacers/postgres/proto/config.proto
It has these top-level messag... |
package main
import (
"sync"
"time"
)
type queueStatus int
const (
tsDefault queueStatus = 0
tsQueued queueStatus = 1
tsRemoved queueStatus = 2
)
type mapItem struct {
torrent *Torrent
status queueStatus
time time.Time
}
// TorrentQueue handles the queuing of torrent jobs
type TorrentQueue struct {
d... |
// Copyright (C) 2021 <NAME>, Inc.
// See LICENSE for copying information.
package picobuf
import (
"fmt"
"google.golang.org/protobuf/encoding/protowire"
)
const (
fieldDecodingErrored = FieldNumber(-1)
fieldDecodingDone = FieldNumber(-2)
)
// Decoder implements decoding of protobuf messages.
type Decoder s... |
package yenc
import (
"bufio"
"bytes"
"fmt"
"hash"
"hash/crc32"
"io"
"strconv"
)
const (
keywordLine = "=y"
headerLine = "=ybegin"
partLine = "=ypart"
trailerLine = "=yend"
byteOffset byte = 42
specialOffset byte = 64
)
var (
keywordBytes = []byte(keywordLine)
headerBytes = []byte(headerLine)... |
package main
import (
"fmt"
goast "go/ast"
"io"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
"unicode"
"unicode/utf8"
"github.com/alecthomas/kingpin"
jitast "github.com/marcel/jitjson/ast"
"github.com/marcel/jitjson/codegen"
)
func rootDirArg(cmdClause *kingpin.CmdClause) *string {
return cmdClause.... |
//
// TeeSplit_test.go
// PureMVC Go Multicore Utility - Pipes
//
// Copyright(c) 2019 <NAME> <<EMAIL>>
// Your reuse is governed by the Creative Commons Attribution 3.0 License
//
package plumbing
import (
"github.com/puremvc/puremvc-go-util-pipes/src/interfaces"
"github.com/puremvc/puremvc-go-util-pipes/src/m... |
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors
// This file is consisted of the MATRIX library and part of the go-ethereum library.
//
// The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
//
// Permissi... |
package blobstore
import (
"context"
"sync"
"sync/atomic"
"github.com/buildbarn/bb-storage/pkg/blobstore/buffer"
"github.com/buildbarn/bb-storage/pkg/util"
"github.com/prometheus/client_golang/prometheus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
var (
mirroredBlobAccessPrometheusMet... |
package handshake
import (
"bytes"
"encoding/binary"
"errors"
"time"
"github.com/gohornet/hornet/pkg/protocol/message"
"github.com/gohornet/hornet/pkg/protocol/tlv"
)
func init() {
if err := message.RegisterType(MessageTypeHandshake, HandshakeMessageDefinition); err != nil {
panic(err)
}
}
const (
Messag... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"math"
"net/http"
"net/url"
"os"
"strings"
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
)
// Querier is a server which will repeatedly perform a number of queries against a prometheus endpoint, collecting
// st... |
/**
* Ant Worker Project
*
* Copyright (c) 2015 Epinion Online Research Team
*
* --------------------------------------------------------------------
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free... |
package main
//
// Read-in keywords and scan each document to calculate TF(term frequency)
//
//
import (
"encoding/csv"
"flag"
"fmt"
"github.com/bluele/mecab-golang"
"io"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"runtime"
"runtime/pprof"
"strconv"
"strings"
"sync"
)
func parseToNode(contents str... |
// Copyright (c) 2019 <NAME>
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package packetcrypt
import (
"bytes"
"encoding/binary"
"encoding/hex"
"io"
"github.com/pkt-cash/pktd/btcutil/er"
"github.com/dchest/blake2b"
ed25519 "github.com/hdevalence/ed25519co... |
package toc
import (
"errors"
"fmt"
"io"
"os"
"sort"
"strconv"
"strings"
"github.com/FreeFlyingSheep/golang-asciidoc-tools/pkg/id"
)
const (
// MAXLEVEL means the maximum number of levels of the book
MAXLEVEL = 5
// MAXSECTION means the maximum number of sections in the book
MAXSECTION = 100000
// MAXNA... |
package rollout
import (
"encoding/json"
"fmt"
"os"
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"github.com/bra... |
package postgres
import (
"context"
"errors"
"fmt"
"strings"
"github.com/google/uuid"
"github.com/jackc/pgconn"
"github.com/jackc/pgx/v4"
"github.com/xabi93/messenger"
)
// errors.
var (
ErrMissingSchemaName = errors.New("missing schema name")
)
// MessagesTable is the table name that will be used if no o... |
package config
import (
"errors"
"fmt"
"io/ioutil"
"os"
"time"
yaml "gopkg.in/yaml.v2"
)
// S3CloudStorageConfig stores the configuration of an S3 API proxy backend.
type S3CloudStorageConfig struct {
Endpoint string `yaml:"endpoint"`
Bucket string `yaml:"bucket"`
Prefix string `yam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.