text stringlengths 3.08k 10.4k |
|---|
package socket
import (
"fmt"
"net"
"os"
"strings"
"time"
"k8s.io/klog/v2"
"github.com/kubeedge/beehive/pkg/common"
"github.com/kubeedge/beehive/pkg/core"
beehiveContext "github.com/kubeedge/beehive/pkg/core/context"
"github.com/kubeedge/beehive/pkg/core/model"
"github.com/kubeedge/beehive/pkg/core/socket... |
package api
import (
"encoding/json"
"fmt"
"strconv"
"github.com/chanbakjsd/gotrix/api/httputil"
"github.com/chanbakjsd/gotrix/event"
"github.com/chanbakjsd/gotrix/matrix"
)
// RoomEvent fetches an event from the server with the provided room ID or event ID.
func (c *Client) RoomEvent(roomID matrix.RoomID, eve... |
package miner
import (
"bufio"
"fmt"
"log"
"net"
"sync"
"time"
)
const (
dialTimeout = 5 * time.Second
connectionTimeout = 20 * time.Second
reconnectSleep = 5 * time.Second
)
func NewTcpClient(opts *Opts, comms *Comms, showLogs, join bool) *TcpClient {
client := &TcpClient{
minerVer: MinerNam... |
package c_a_t_e_g_o_r_i_e_s
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/swag"
... |
package base
import (
"sync"
"github.com/couchbase/cbgt"
)
// cbgtCredentials are global map of dbname to basic auth creds. Updated on cbgt manager creation, required
// for couchbase-dcp-sg feed type to retrieve per-db credentials without requiring server context handle
// Cannot use the serverContext to retriev... |
package util
import (
"io/ioutil"
"regexp"
"os"
"time"
"strings"
"strconv"
"bytes"
"golang.org/x/text/encoding/simplifiedchinese"
"golang.org/x/text/transform"
)
// 比较两个[]byte是否相同
func Equal(a []byte, b []byte) bool {
// If one is nil, the other must also be nil.
if (a == nil) != (b == nil) {
... |
package main // import "github.com/as/a"
import (
"flag"
"fmt"
"image"
"io"
"log"
"os"
"github.com/as/edit"
"github.com/as/shiny/event/lifecycle"
"github.com/as/shiny/screen"
"github.com/as/ui/col"
"github.com/as/ui/tag"
)
var (
eprint = fmt.Println
timefmt = "15.04.05"
)
var (
g *Grid
D ... |
/**
* 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... |
// Code generated by go-swagger; DO NOT EDIT.
package output
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"os"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/ru... |
// 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 mgmapi
import (
"github.com/mysql/ndb-operator/config/debug"
"sort"
)
// NodeTypeEnum identifies the node type used in NodeStatus object
// there... |
/*
* Copyright 2021 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... |
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package devcon
import (
"errors"
"regexp"
"strings"
)
// ClassFilterType is used to indicate the filter option for setup classes.
//
// See https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/device-filter-driver-ordering for more information.
type ClassFilterType string
const (
// ClassFilterUpper... |
// Code generated by go-swagger; DO NOT EDIT.
package statements
// 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 "github.c... |
package main
import (
"log"
"time"
netatmo "github.com/exzz/netatmo-api-go"
"github.com/prometheus/client_golang/prometheus"
)
const (
staleDataThreshold = 30 * time.Minute
)
var (
netatmoUp = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "netatmo_up",
Help: "Zero if there was an error scraping the Neta... |
package text
import (
"log"
"strings"
bleve "github.com/blevesearch/bleve"
badger "github.com/dgraph-io/badger/v2"
iface "github.com/ipfs/interface-go-ipfs-core"
rdf "github.com/underlay/go-rdfjs"
indices "github.com/underlay/pkgs/indices"
types "github.com/underlay/pkgs/types"
styx "github.com/underlay/sty... |
package graceful
import (
"context"
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"os"
"sync"
"time"
"github.com/Scalingo/go-utils/logger"
"github.com/facebookgo/grace/gracenet"
"gopkg.in/errgo.v1"
)
type service struct {
httpServer *http.Server
graceful *gracenet.Net
wg *sync.WaitGroup
stopped... |
package service
import (
"errors"
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
)
// @title GetMenuTree
// @description 获取动态菜单树
// @auth (2020/04/05 20:22)
// @param authorityId string
// @return err error
// @return menus ... |
package main
/*
Alienvault USM Anywhere Alarm Relayer
(c) 2018, <NAME> (w1rtp)
My team is leveraging a third party device to triage alarms.
We also leverage Microsoft Teams for alerting and sharing
those alerts with our customers.
This application will pull Alarms from AT&T's Alienvault USM Anywhere
Product and se... |
package resolver
/*
* query.go
* perform a query
* By <NAME>
* Created 20180926
* Last Modified 20181013
*/
import (
"errors"
"strconv"
"strings"
"golang.org/x/net/dns/dnsmessage"
)
// The following errors correspond to non-success (i.e. not NOERROR) Response
// Codes returned from DNS servers.
var (
Err... |
/*
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package sec
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"testing"
"time"
"github.com/findy-network/findy-agent/agent/aries"
"github.com/findy-network/findy-agent/agent/pltype"
"github.com/findy-network/findy-agent/agent/service"
"github.com/findy-network/findy-agent/agent/ssi"
"github.com/findy-net... |
// Copyright 2016 fatedier, <EMAIL>
//
// 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 ... |
// Copyright © 2018 The Things Industries, distributed under the MIT license (see LICENSE file)
// Package session implements MQTT sessions.
package session
import (
"context"
"errors"
"io"
"sync/atomic"
"time"
"github.com/TheThingsIndustries/mystique/pkg/auth"
"github.com/TheThingsIndustries/mystique/pkg/log... |
package bot
import (
"encoding/json"
"strings"
)
type Response struct {
Ok bool `json:"ok"`
Result json.RawMessage `json:"result"`
ErrorCode int `json:"error_code"`
Description string `json:"description"`
}
// UpdatesChannel is the channel for getting updates.
ty... |
/*
Copyright 2021 The KubeVela 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... |
//Copyright 2019 Expedia, Inc.
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing,... |
package smp
import (
"math"
"sort"
"time"
)
type Candle struct {
InstrumentId string `json:"instrument_id"`
Ticker string `json:"ticker"`
// End date
Date time.Time `json:"date"`
Start time.Time `json:"start"`
Open float64 `json:"open"`
High float64 `json:"high"`
Low float64 `json:"low"`
... |
package k8s
import (
"context"
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/autoscaling"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/kubectl/pkg/drain"
)
const (
RollingUpdateStartedTimestampAnnotationKey... |
// Copyright (c) 2020-2021 Blockwatch Data Inc.
// Author: <EMAIL>
package cache
import (
"encoding/binary"
"fmt"
"sync"
"sync/atomic"
"blockwatch.cc/tzgo/tezos"
"blockwatch.cc/tzindex/etl/model"
"blockwatch.cc/packdb/cache/lru"
"github.com/cespare/xxhash"
)
var AccountCacheSizeLog2 = 17 // 128k
type Acco... |
package aws
import (
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/aws/aws-sdk-go/service/ecs/ecsiface"
"github.com/pkg/errors"
"github.com/stelligent/mu/common"
)
type ecsTaskManager struct {
ecsAPI ecsiface.ECSAPI... |
// *** 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 storage
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// The ObjectAccessControls resources represent the ... |
package main
import (
"github.com/go-ee/emailbridge"
"github.com/go-ee/utils/lg"
"github.com/sirupsen/logrus"
"io/ioutil"
"net/http"
"os"
)
import (
"fmt"
"github.com/urfave/cli/v2"
)
func main() {
app := NewCli()
if err := app.Run(os.Args); err != nil {
logrus.WithFields(logrus.Fields{"err": err}).Warn... |
/*
* 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 gogitlab
import (
"encoding/json"
"net/url"
"strconv"
)
const (
projects_url = "/projects" // Get a list of projects owned by the authenticated user
projects_search_url = "/projects/search/:query" // Search for projects by name
project_url ... |
package main
import (
"context"
"io/ioutil"
"math"
"os"
"syscall"
"time"
"github.com/getlantern/systray"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/widgets"
)
var (
moduser32 = syscall.NewLazyDLL("user32.dll")
procGetKeyState = moduser32.NewProc("GetKeySta... |
// Copyright 2011 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.
package datastore
import (
"fmt"
"reflect"
"strings"
"sync"
"unicode"
)
// Entities with more than this many indexed properties will not be saved.
const m... |
// Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package ttnctx
import (
"errors"
"strconv"
"golang.org/x/net/context"
"google.golang.org/grpc/metadata"
)
// MetadataFromIncomingContext gets the metadata from the given contex... |
/*
* 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 © 2017-2018 <NAME> <<EMAIL>>
*
* 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 o... |
package flags
import (
"flag"
"fmt"
"log"
"os"
"strings"
"github.com/agilestacks/git-service/cmd/gits/config"
)
func Parse() {
var blobsFrom string
var apiSecretEnvVar, hubApiSecretEnvVar, authApiSecretEnvVar, subsApiSecretEnvVar string
var hubApiEndpoint, hubApiEndpointEnvVar, hubApiHostEnvVar, hubApiPortE... |
package command
import (
"fmt"
"io"
"net/http"
"os"
"runtime"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
"github.com/maliceio/cli/cli"
cliconfig "github.com/maliceio/cli/cli/config"
"github.com/maliceio/cli/cli/config/configfile"
cliflags "github.com/maliceio/cl... |
package main
import (
"bufio"
"bytes"
"crypto/md5"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"time"
serial "github.com/goburrow/serial"
)
// Parameters from Mega Everdrive X7 design
const blockSize = 512 * 128
const maxGameSize = 0xf00000
// Syntax specific to the Mega Everdrive X7 cartridge
const x7_Init... |
// Copyright 2017 Google 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"testing"
"time"
"github.com/cortexproject/cortex/integration/e2e"
"github.com/go-kit/kit/log"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/thanos-community/obs... |
package ssh
import (
"errors"
"fmt"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/agent"
"golang.org/x/crypto/ssh/knownhosts"
"net"
"os"
"path/filepath"
)
type AuthType int
const (
Password AuthType = iota
PrivateKey
SshAgent
)
type Cfg struct {
Host string
Port int
Auth ... |
package server
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
"github.com/rrednos... |
package volume
import (
"errors"
"fmt"
"os"
"reflect"
"strconv"
"time"
log "github.com/Sirupsen/logrus"
"github.com/camptocamp/bivac/config"
"github.com/camptocamp/bivac/metrics"
"github.com/camptocamp/bivac/util"
"github.com/go-ini/ini"
)
// Volume provides backup methods for a single Docker volume
type ... |
package gads
import (
"encoding/xml"
"fmt"
)
// CampaignExtensionSettingService (v201809)
// Service used to manage extensions at the campaign level.
// The extensions are managed by AdWords using existing feed services,
// including creating and modifying feeds, feed items,
// and campaign feeds for the user.
//
/... |
// DO NOT EDIT THIS FILE. GENERATED BY svdxgen.
// +build stm32l4x6
// Package dbgmcu provides access to the registers of the DBGMCU peripheral.
//
// Instances:
// DBGMCU DBGMCU_BASE - - Debug support
// Registers:
// 0x000 32 IDCODE MCU Device ID Code Register
// 0x004 32 CR Debug MCU Configura... |
// Copyright 2014,2015,2016,2017,2018,2019,2020,2021 <NAME> (<EMAIL>)
// 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 a... |
// Package s3sigv2 implements AWS S3 request signing using Signature Version 2,
// documentation on the signature structure can be found at
// http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html.
package s3sigv2
import (
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"hash"
"net/http"
"sort"
"... |
package main
import (
"fmt"
"io/ioutil"
"gopkg.in/yaml.v2"
"strings"
"os/exec"
"os"
)
const version = "0.2.1"
func check(e error){
if e != nil {
panic(e)
}
}
type CodeCi struct {
Os string `yaml:"os"`
Language string `yaml:"language"`
Image string `yaml:"image"`
Script []string `yaml:"script"`
... |
// Demo code for the Flex primitive.
package cview
import (
"container/list"
"fmt"
"time"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
//打开好友聊天
func (c *CView) ChatToUser(userid int, title string) {
c.TextView.SetTitle(" " + title + "消息")
c.ChatToUserId = userid //重置当前聊天id
//将消息列表打印到屏幕
c.TextView... |
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
package main
import (
"context"
"encoding/json"
"log"
"os"
"time"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/acm"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/g... |
package asset
import (
"bytes"
"embed"
"image/color"
"image/png"
"math"
"github.com/ebiten/emoji"
"github.com/eihigh/zu/colorf"
"github.com/fogleman/gg"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/examples/resources/fonts"
"golang.org/x/image/font"
"golang.org/x/ima... |
package network
import (
"crypto/tls"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strconv"
"sync"
"github.com/fristonio/gvm/utils"
)
const (
ACCEPT_RANGE_HEADER = "Accept-Ranges"
CONTENT_LENGTH_HEADER = "Content-Length"
)
// PartFile Structure
type PartFile struct {
Url string
Path string
... |
// Copyright 2019 <NAME>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package intacct
import (
"bytes"
"encoding/xml"
"errors"
"fmt"
"io"
"reflect"
"time"
)
// Response contains function results from a Request
type Response str... |
package policy
import (
"context"
"sort"
"sync"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/rmrobinson/nerves/services/domotics/bridge"
"go.uber.org/zap"
)
// Engine contains a single instance of a policy engine.
// This engine contains one or more policies, subscribes t... |
// Code generated by ecs https://github.com/gabstv/ecs; DO NOT EDIT.
package graphics
import (
"sort"
"github.com/gabstv/ecs/v2"
"github.com/gabstv/primen/components"
)
const uuidDrawLayerDrawableSystem = "CBBC8DB4-4866-413E-A7A9-250A3C9ECDDC"
type viewDrawLayerDrawableSystem str... |
package ultradns
import (
"fmt"
"testing"
"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
func TestAccUltradnsDirpool(t *testing.T) {
var record udnssdk.RRSet
domain := "ultradns.phinze.com"
resource.Test(t, resource.TestCase{
Pr... |
package ann
import (
"math/rand"
"sort"
mat "github.com/gonum/matrix/mat64"
)
type mrpt struct {
xs [][]float64
trees []*tree
}
type tree struct {
root *node
r mat.Matrix
}
type node struct {
split float64
left *node
right *node
indices []int
}
// NewMRPTANNer creates a NN index using random pr... |
// Copyright © 2018 data.world, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package tree
import (
"fmt"
"log"
"sync"
"time"
"github.com/awalterschulze/gographviz"
)
// Node a single node that composes the tree
type Node struct {
Name string
Label string
Parent *Node
Children []*Node
TimeOfIngress *time.Time
TimeOfEgress *time.Time
lock sync.RWMute... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package deliver
import (
"testing"
"time"
"github.com/hyperledger/udo/protos/common"
"github.com/hyperledger/udo/protos/utils"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
... |
/*
* Copyright (C) 2015-2019 Virgil Security Inc.
*
* 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
* not... |
package keeper
import (
"container/list"
"fmt"
"time"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/netcloth/netcloth-chain/app/v0/params"
"github.com/netcloth/netcloth-chain/app/v0/staking/types"
"github.com/netcloth/netcloth-chain/codec"
sdk "gi... |
package cmd
import (
"os"
"strings"
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/javac_completer/cmd/action"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "javac",
Short: "Reads Java class and interface definitions and compiles them into bytecode and class files"... |
// DONTCOVER
// nolint
package v0_34
import (
"time"
"github.com/tendermint/tendermint/crypto"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
ModuleName = "staking"
)
type (
Pool struct {
NotBondedTokens sdk.Int `json:"not_bonded_tokens"`
BondedTokens sdk.Int `... |
package weakcoin
import (
"bytes"
"context"
"encoding/binary"
"fmt"
"math/big"
"strings"
"sync"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/log"
"github.com/spacemeshos/go-spacemesh/p2p/service"
)
const (
// Prefix defines weak coin proposal prefix.
proposalPre... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package forecast
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/ListForecastExportJobsRequest
type Li... |
package command
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/frankbraun/codechain/archive"
"github.com/frankbraun/codechain/hashchain"
"github.com/frankbraun/codechain/internal/def"
"github.com/frankbraun/codechain/internal/hex"
"github.com/frankbraun/codechain/secpkg"
"github.com/fra... |
package nameserver
import (
"fmt"
"github.com/miekg/dns"
. "github.com/zettio/weave/common"
"net"
"sync"
)
const (
LOCAL_DOMAIN = "weave.local."
UDPBufSize = 4096 // bigger than the default 512
)
func makeDNSFailResponse(r *dns.Msg) *dns.Msg {
m := new(dns.Msg)
m.SetReply(r)
m.RecursionAvailable = true
... |
package villa
import (
"math/cmplx"
"testing"
"github.com/golangplus/testing/assert"
)
var cmplexAbsCmpFunc = ComplexCmpFunc(func(a, b complex128) int {
absA, absB := cmplx.Abs(a), cmplx.Abs(b)
if absA < absB {
return -1
} else if absA > absB {
return 1
} // else if
// The following implementation defin... |
/*
Package controller contains all logic connecting models to views
*/
package controller
import (
"errors"
"github.com/labstack/echo"
"github.com/nlittlepoole/cookiecutter-monorepo/guessing/game/model"
"html/template"
"io"
"net/http"
"sync"
)
// Backend interface represents a storage backend for the Question ... |
package apitest
import (
"context"
"fmt"
"log"
"os"
"os/exec"
"path"
"runtime"
"testing"
"time"
httpapi "github.com/ipfs/go-ipfs-http-client"
logging "github.com/ipfs/go-log/v2"
ma "github.com/multiformats/go-multiaddr"
"github.com/phayes/freeport"
"github.com/stretchr/testify/require"
"github.com/text... |
package lb
import (
"bytes"
"encoding/json"
"github.com/xlvector/dlog"
"io/ioutil"
"math/rand"
"net/http"
"strconv"
"time"
)
type DownStream struct {
up *UpstreamConfig
used bool
sid string
startTime time.Time
}
type ServiceHandler struct {
srv *ServiceConfig
freeUpstreams c... |
// 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 ... |
/*
Copyright 2019 LitmusChaos 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, softw... |
package web
import (
"base"
"config"
"errors"
"io"
"net/http"
"worker"
"github.com/gorilla/sessions"
)
func handleOpen(rw http.ResponseWriter, r *http.Request) {
data := make(map[string]interface{})
workers := []map[string]interface{}{}
workerCache := worker.WorkerCache
for _, oneWorker := range workerC... |
package pkg
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/signal"
"time"
"github.com/DeanThompson/ginpprof"
"github.com/unrolled/secure"
"github.com/chenjiandongx/ginprom"
"github.com/gin-gonic/gin"
log "github.com/go-eden/slf4go"
"github.com/gorilla/websocket" //... |
package jsonhandler
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"reflect"
"testing"
)
func TestNewHandler(t *testing.T) {
type args struct {
handler interface{}
}
tests := []struct {
name string
args args
wantPanic bool
}{
{
name: "Not a han... |
package modemmanager
import (
"bytes"
"context"
"fmt"
"net"
"path"
"sort"
"strconv"
"time"
"github.com/godbus/dbus/v5"
)
// A Bearer handles the cellular connection state of a Modem.
type Bearer struct {
Index int
Connected bool
Interface string
IPTimeout ... |
package routes
import (
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
"github.com/gocardless/draupnir/pkg/server/api"
"github.com/gocardless/draupnir/pkg/server/api/chain"
"github.com/gocardless/draupnir/pkg/server/api/middleware"
"github.com/google/jsonapi"
"github.com/pkg/errors"
"golang.org/x/net/co... |
package log
import (
"fmt"
"io/ioutil"
"os"
"strings"
"testing"
"time"
"github.com/kodekoding/phastos/go/log/logger"
"github.com/kodekoding/phastos/go/log/logger/zerolog"
"github.com/rs/xid"
"github.com/stretchr/testify/require"
)
func TestZerolog(t *testing.T) {
// reset
err := SetConfig(nil)
require.N... |
package fiscobcos
import (
"bytes"
"github.com/BSNDA/bsn-sdk-crypto/crypto/eth"
"github.com/BSNDA/bsn-sdk-crypto/crypto/sm"
"github.com/tjfoc/gmsm/sm3"
"golang.org/x/crypto/sha3"
"crypto/ecdsa"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
"github.com/tjfoc/gmsm/sm2"
"io"
"... |
//
// k2hdkc_go
//
// Copyright 2018 Yahoo Japan Corporation.
//
// Go driver for k2hdkc that is a highly available and scalable distributed
// KVS clustering system. For k2hdkc, see
// https://github.com/yahoojapan/k2hdkc for the details.
//
// For the full copyright and license information, please view
// the license... |
package main
import (
"fmt"
gotime "time"
"github.com/prasadchandan/go_lbm/uiengine"
"golang.org/x/mobile/event/size"
"golang.org/x/mobile/event/touch"
"golang.org/x/mobile/gl"
)
// AppProperties holds the state of the application
type AppProperties struct {
Solver *Solver
UI *uiengine.UiEng... |
package npm_quick_audit
import (
v1 "github.com/thought-machine/dracon/api/proto/v1"
atypes "github.com/thought-machine/dracon/producers/npm_audit/types"
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
)
var invalidJSON = `Not a valid JSON object`
func TestNewReportInvalidJSON(t *testi... |
// Copyright 2020 dfuse Platform 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 agre... |
package parser
import (
"fmt"
"go/ast"
"strings"
"github.com/KlyuchnikovV/webapi-docs/types"
)
type Server struct {
URL string `json:"url"`
Description string `json:"description"`
}
type Components struct {
Schemas map[string]Schema `json:"schemas,omitempty"`
Parameters map[string]IPar... |
package paseto
import (
"encoding/base64"
"encoding/json"
"reflect"
"time"
"github.com/mitchellh/mapstructure"
errors "golang.org/x/xerrors"
)
var (
// ErrTypeCast type cast error
ErrTypeCast = errors.New("type cast error")
// ErrClaimNotFound claim not found error
ErrClaimNotFound = errors.New("claim not... |
//
// Copyright 2017 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
package cartpresenter
import (
"net/http"
"github.com/pandudpn/shopping-cart/src/domain/model"
"github.com/pandudpn/shopping-cart/src/utils"
)
type cartView struct {
Id int `json:"id"`
Key string `json:"key"`
IsActive bool ... |
/*
* Copyright (c) 2013, fromkeith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condition... |
/*
Copyright 2020 The arhat.dev 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, soft... |
package gui
import (
"fmt"
"image/color"
"strings"
"github.com/flga/nes/cmd/internal/errors"
"github.com/veandco/go-sdl2/sdl"
)
type Renderer struct {
*sdl.Renderer
title string
background *sdl.Texture
fontTextures map[string][]*sdl.Texture
}
func newRenderer(window *sdl.Window, w, h int32, options u... |
package factory_restclient
import (
"crypto/tls"
"fmt"
"github.com/goplume/core/rest_client"
"github.com/goplume/core/configuration"
"github.com/goplume/core/oaut_client"
utils2 "github.com/goplume/core/utils"
"github.com/goplume/core/utils/logger"
"github.com/go-resty/resty/v2"
"ti... |
package main
import (
"fmt"
"github.com/frudens/sheetskv/lib"
"github.com/urfave/cli"
"golang.org/x/oauth2/google"
"google.golang.org/api/sheets/v4"
"io/ioutil"
"log"
"os"
"sort"
"strconv"
"strings"
)
var sheetId string
var sheetName string
var carriageReturn bool
func getKeyList(srv *sheets.Service) {
r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.