text stringlengths 3.08k 10.4k |
|---|
// *** 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 ovh
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func GetVps(ctx *pulumi.Context, args *GetVpsArgs, opts... |
// Package utc is a lightweit time struct stripped of its timezone awareness
//
// Known limitations : dates before the year ~1678 cannot be represented with this time struct,
// but most of the time we can live with it.
package utc
import (
"math"
"strconv"
"time"
)
const day = time.Hour * 24
// UTC is the numbe... |
package main
import (
"fmt"
"log"
"net"
"net/http"
"strings"
"time"
"github.com/julienschmidt/httprouter"
"github.com/sabhiram/go-wol/wol"
)
const (
indexPage = `
<html>
<head>
<title>gowold</title>
<!-- <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css"> -->
<!-- Download the CS... |
//Copyright 2017 Huawei Technologies Co., Ltd
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agr... |
package attestedtls
import (
"context"
"crypto/x509"
"crypto/tls"
"crypto/rsa"
"crypto"
"encoding/pem"
"errors"
"io"
log "github.com/sirupsen/logrus"
// local modules
ci "github.com/Fraunhofer-AISEC/cmc/cmcinterface"
// debug
"encoding/hex"
)
func convertHash(opts crypto.SignerOpts) (ci.HashFunction, err... |
package commands
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
"os"
"github.com/spf13/cobra"
apiReq "github.com/chef/automate/api/external/cfgmgmt/request"
"github.com/chef/automate/lib/httputils"
)
var reportNewRolloutFlags = struct {
verbose bool
lockfilePath strin... |
package main
import (
"fmt"
"log"
"os"
"sort"
"strings"
"github.com/olekukonko/tablewriter"
"github.com/pkg/errors"
"gopkg.in/DATA-DOG/go-sqlmock.v2"
"gorm.io/driver/mysql"
"gorm.io/driver/postgres"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/schema"
"gogs.io/gogs/intern... |
package main
import (
"fmt"
"net"
"sync/atomic"
"time"
"github.com/eclipse/paho.mqtt.golang/packets"
"github.com/vizee/echo"
)
const (
SateNew = iota
StateAlive
StateDown
)
var liveConn int32
type Conn struct {
conn net.Conn
ClientIdentifier string
state int32
cheof c... |
package expvar
import (
"encoding/json"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-plugin-jira/server/utils"
)
func TestStatsBasic(t *testing.T) {
stats := NewUnpublishedStats(nil)
i, ok := stats.endpoints.Load("xxx")
require.False(t, ok)
require.Nil(t, i)
e... |
package dreamcast
import (
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"strings"
"time"
)
const (
ipBinLength = 0x8000
lastSector = 0x861b4
space = " "
)
const (
offsetHardwareID = 0x000
offsetMakerID = 0x010
offsetDeviceInformation = 0x020
offsetAreaSymbols = 0x030
of... |
package pagehome
import (
"encoding/json"
"fmt"
"html/template"
"net/http"
"strconv"
"time"
"github.com/dekoch/gouniversal/module/gpsnav/core"
"github.com/dekoch/gouniversal/module/gpsnav/global"
"github.com/dekoch/gouniversal/module/gpsnav/lang"
"github.com/dekoch/gouniversal/module/gpsnav/typenav"
"githu... |
package main
import (
"os"
"io/ioutil"
"bufio"
"strconv"
"fmt"
"strings"
)
func partition(arr []int) int {
if len(arr) <= 1 {
return 0
}
p := arr[0]
i := 1
for j, n := range arr {
if n < p {
arr[i], arr[j] = arr[j], arr[i]
i++
}
}
arr[0], arr[i-1] = arr[i-1], arr[0]
return i-1
}
func qsort(... |
package flowmonitor
import (
"errors"
"time"
"os"
"strconv"
"encoding/json"
"net"
"go-common/library/log"
"go-common/app/service/ops/log-agent/pkg/flowmonitor/counter"
"go-common/app/service/ops/log-agent/event"
)
type FlowMonitor struct {
conf *Config
monitorLogChanSize int
currentVer ... |
// Copyright 2020 <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 writi... |
/*
Copyright 2017 The Nuclio Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licensd.
You may obtain a copy of the License at
http://www.apachd.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package methods
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"reflect"
"strings"
"sync"
"github.com/voximplant/apiclient-go/config"
"github.com/voximplant/apiclient-go/jwt"
"github.com/voximplant/apiclient-go/structure"
)
type Client struct {
// HTTP client used to communicate with the... |
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
... |
package gxetcd
import (
"context"
"fmt"
"log"
"sync"
"testing"
"time"
)
import (
jerrors "github.com/juju/errors"
"github.com/stretchr/testify/suite"
ecv3 "go.etcd.io/etcd/clientv3"
)
type ClientTestSuite struct {
suite.Suite
config ecv3.Config
client *Client
wg sync.WaitGroup
}
func (suite *Clien... |
// Copyright (C) 2016 <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 agreed to ... |
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
"time"
"github.com/nymo-net/nymo"
)
type baseClient = [2]interface{}
type baseServer = [2]json.RawMessage
type newMessage struct {
Target interface{} `json:"target"`
Message string `json:"message,omitempty"`
Content string `... |
/* */
package sp500
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
"time"
u "betazone/_utils"
)
type sp500 struct {
Conf struct {
Dev bool `json:"dev"`
RefreshTime string `json:"refreshTime"`
SymbolListFile string `json:"symbolListFile"`
SymbolDataFile string ... |
package refresh
import (
"context"
"fmt"
"reflect"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"sigs.k8s.io/controller-runtime/pkg/client"
util "sigs.k8s.io/controll... |
//
// tcp.go
//
// Copyright (c) 2018-2021 <NAME>
//
// All rights reserved.
//
package network
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"net"
"sync"
"syscall/js"
"time"
"github.com/markkurossi/blackbox-os/lib/encoding"
"github.com/markkurossi/blackbox-os/lib/wsproxy"
)
var (
wsNew = js.Global().Get... |
package main
import (
. "github.com/aerospike/gommander"
"golang.org/x/crypto/ssh"
"bytes"
"flag"
"fmt"
"strconv"
"strings"
"time"
)
// Dump function for printing fixed width columns
func column(s string, w int) string {
o := bytes.Buffer{}
i := 0
for ; i < len(s); i++ {
o.WriteRune(rune(s[i]))
if i >... |
package console
import (
"github.com/gin-gonic/gin"
"kapokmq/config"
"kapokmq/memory"
"kapokmq/model"
"kapokmq/server"
"kapokmq/utils"
"sort"
"strconv"
)
/**
* 控制台服务接口
*/
// Ping 检查MQ是否在运行
func Ping(c *gin.Context) {
c.JSON(0, gin.H{
"code": 0,
})
}
// GetClients 获取全部客户端集合
func GetClients(c *gin.Cont... |
// Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complian... |
package lql
import (
"bytes"
"io"
"strconv"
"strings"
bsq "github.com/blugelabs/bluge"
)
type lex struct {
// Input string from the user
input *bytes.Reader
errs []string
// search is the end result of the lexer parser and what is given to the user
query bsq.Query
fields []string
// Hold current valu... |
package cmd
import (
"fmt"
"runtime"
"github.com/qlik-oss/corectl/internal"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
var localFlags pflag.FlagSet
var initialized bool
// DefaultUnbuildFolder is the placeholder for unbuild folder location
var DefaultUnbuildFolder = "./<app n... |
package gcs
import (
"context"
"io"
"net/http"
"strconv"
"strings"
"time"
"cloud.google.com/go/storage"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"github.com/ripta/ssp/proxy"
"github.com/rs/zerolog"
"github.com/rs/zerolog/hlog"
)
type handler struct {
Client *storage.Client
Buck... |
package github
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/google/go-github/v41/github"
"github.com/guiln/boilerplate-cli/domain/models"
"github.com/guiln/boilerplate-cli/helpers"
"golang.org/x/oauth2"
)
const (
folderContentType string = "dir"
fileContentType ... |
// Copyright 2020 <NAME>
// Please check out LICENSE file for more information about what you CAN and what you CANNOT do!
// Basically in short this is a free software for you to do whatever you want to do BUT copyright must be included!
// I didn't write all of this code so you could say it's yours.
// MIT License
pa... |
package gocheck2
import (
stdlibErrors "errors"
"fmt"
"testing"
. "gopkg.in/check.v1"
"github.com/dropbox/godropbox/errors"
)
// Hook up gocheck into go test runner
func Test(t *testing.T) {
TestingT(t)
}
type CheckersSuite struct{}
var _ = Suite(&CheckersSuite{})
func (s *CheckersSuite) SetUpTest(c *C) {
... |
package graphs
import (
"fmt"
"sort"
)
// A Vertex can be just anything.
type Vertex interface {
comparable
}
// An Edge connects two vertices with a cost.
type Edge[T Vertex] struct {
Start T
End T
Cost float64
}
// A Halfedge is an edge where just the end vertex is
// stored. The start vertex is inferred... |
package main
import (
"fmt"
"os"
"path/filepath"
"runtime"
"sync/atomic"
"time"
"github.com/alecthomas/kingpin"
"github.com/fatih/color"
"github.com/kbrgl/fu/matchers"
"github.com/kbrgl/fu/shallowradix"
isatty "github.com/mattn/go-isatty"
"github.com/stretchr/powerwalk"
)
const (
// Version is the progr... |
// Copyright (c) 2020-2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package tstore
import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"net/http"
dcrtime "github.com/decred/dcrtime/api/v2"
"github.com/decred/dcrtime/me... |
package main
import (
"bufio"
"context"
"encoding/hex"
"errors"
"fmt"
"io"
"net"
"os"
"os/signal"
"strings"
"time"
"github.com/mbilal92/noise"
"github.com/mbilal92/noise/network"
"github.com/spf13/pflag"
"go.uber.org/zap"
)
var (
hostFlag = pflag.IPP("host", "h", nil, "binding host")
portFlag ... |
package sdktests
import (
"errors"
"net/http"
"github.com/launchdarkly/sdk-test-harness/framework/harness"
"github.com/launchdarkly/sdk-test-harness/framework/helpers"
"github.com/launchdarkly/sdk-test-harness/framework/ldtest"
o "github.com/launchdarkly/sdk-test-harness/framework/opt"
"github.com/launchdarkly... |
package exchange
import (
"bytes"
"encoding/hex"
"strconv"
"testing"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cos... |
// 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... |
package http2
import (
//"bytes"
"github.com/docker/libswarm/beam"
//"github.com/docker/spdystream"
"io"
"net"
"testing"
)
func TestBeamSession(t *testing.T) {
end := make(chan bool)
listen := "localhost:7543"
server, serverErr := runServer(listen, t, end)
if serverErr != nil {
t.Fatalf("Error initializin... |
// Copyright © 2014-2021 <NAME> <<EMAIL>>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package guard
import (
"encoding/json"
"net/http"
"regexp"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/gorilla/schema"
log "github.com/sirupsen/logrus"
"... |
/**
* Copyright 2018 Atos
*
* 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 impl
import (
"context"
"time"
"github.com/lyft/datacatalog/pkg/manager/impl/validators"
"github.com/lyft/datacatalog/pkg/manager/interfaces"
"github.com/lyft/datacatalog/pkg/repositories"
"github.com/lyft/datacatalog/pkg/repositories/transformers"
datacatalog "github.com/lyft/datacatalog/protos/gen"
... |
///bin/sh -c true; exec /usr/bin/env go run "$0" "$@"
// vim:ts=4:sts=4:sw=4:noet
//
// Author: <NAME>
// Date: 2020-04-24 14:14:44 +0100 (Fri, 24 Apr 2020)
//
// https://github.com/harisekhon/devops-golang-tools
//
// License: see accompanying Hari Sekhon LICENSE file
//
// If you're using my code you're welcome... |
package hhdatabase
import (
"errors"
"fmt"
"sync"
"time"
"github.com/mediocregopher/radix.v2/pool"
"github.com/mediocregopher/radix.v2/redis"
)
type dbRecord struct {
ip string
port string
}
type dbServers struct {
dbs []dbRecord
lock sync.Mutex
primary *pool.Pool
electing bool
elec... |
// Copyright (C) 2020, MinIO, Inc.
//
// This code is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License, version 3,
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY ... |
// Copyright 2022 PingCAP, 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 i... |
// Copyright 2014 The Cayley Authors. 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 ap... |
/*
Copyright 2018 The Knative Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
// Copyright(c) 2018 DSiSc Group 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 applica... |
/*
Copyright 2017 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 jpholiday
import (
"math"
"time"
)
var JST = time.FixedZone("JST", 3600*9)
func Name(t time.Time) string {
t = t.In(JST)
y, m, d, w := toYMDW(t)
name := getName(y, m, d, w)
//振替休日
if len(name) <= 0 {
if 1973 <= y && w == 0 {
yname := getYesterdayNameFromTime(t)
if len(yname) >= 1 {
name =... |
// Code generated by go-swagger; DO NOT EDIT.
package server
// 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.com/g... |
package gen
import (
"fmt"
)
type (
Table struct {
name string
desc string
fields []*Field
uniques [][]*Field
}
Field struct {
name string
desc string
unit string
type_ FieldType
isNotNull bool
index IndexType
tbl *Table
relateWith *Table
}
Re... |
package charger
// LICENSE
// Copyright (c) 2019-2022 andig
// This module is NOT covered by the MIT license. All rights reserved.
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRAN... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"strings"
"sync"
"sync/atomic"
"time"
)
var (
limitFlag = flag.Int("limit", 2, "tracks number for download")
allFlag = flag.Bool("all", false, "get all possible tracks (ignoring --limit flag)")
... |
// Package kmsg provides a minimal interface for dealing with
// kmsg messages extracted from `/dev/kmesg`.
package kmsg
import (
"strconv"
"strings"
"time"
"github.com/pkg/errors"
)
type Priority uint8
const (
PriorityEmerg Priority = iota
PriorityAlert
PriorityCrit
PriorityErr
PriorityWarning
PriorityNo... |
// SPDX-License-Identifier: Unlicense OR MIT
//
// hello_gio.go is my hello world program for the
// Gio graphics package for Golang by <NAME>.
// https://gioui.org
//
// Eschewing the elegant constraint layout system for
// more direct control, hello_gio.go demonstrates how to
// plot rectangular boxes at specific scr... |
package stats
import (
"bytes"
"regexp"
"strings"
)
// Tag represents a tag for stats.
type Tag struct {
Name string
Value string
}
// TagExtractor is used to extract tags from stats name.
type TagExtractor struct {
name string
re *regexp.Regexp
regexPrefix string
subStr string
}
// N... |
package main
import (
"flag"
"fmt"
"github.com/anaskhan96/soup"
"github.com/gosuri/uiprogress"
"io"
"net/http"
"os"
"strconv"
"strings"
"sync"
"sync/atomic"
)
const helpString = `stanford-dl
Author : https://github.com/coderick14
A dead simple script to download videos or pdfs from Stanford Engineering Ev... |
package toutloop
import (
"container/heap"
"fmt"
"sync"
"time"
)
type operation int
const (
addOp operation = iota
getOp operation = iota
rescheduleOp operation = iota
removeOp operation = iota
)
type request struct {
operation operation
id string
object interface{}
runTime ... |
// 4 march 2014
package main
import (
"fmt"
"os"
"os/exec"
"time"
"github.com/andlabs/ui"
)
const (
defCmdLine = "mpv -loop inf ~/ring.wav"
defTime = "10:30 AM"
timeFmt = "3:04 PM"
)
// If later hasn't happened yet, make it happen on the day of now; if not, the day after.
func bestTime(now time.Time, ... |
package model2d
import (
"math"
"math/rand"
"testing"
)
func TestMeshRepairNormals(t *testing.T) {
mesh := MarchingSquaresSearch(&Circle{Radius: 0.3}, 0.01, 8)
mesh1, numRepairs := mesh.RepairNormals(1e-8)
if numRepairs > 0 {
t.Errorf("expected 0 repairs but got: %d", numRepairs)
}
if !meshesEqual(mesh, me... |
package main
import (
"encoding/json"
"encoding/xml"
"fmt"
"os"
"time"
"github.com/Comcast/plax/cmd/plaxrun/plugins/report"
"github.com/Comcast/plax/junit"
resty "github.com/go-resty/resty/v2"
hclog "github.com/hashicorp/go-hclog"
plugin "github.com/hashicorp/go-plugin"
)
// TestResult Octane data structu... |
package selection
import (
"sync"
"time"
"github.com/dusk-network/dusk-blockchain/pkg/core/consensus"
"github.com/dusk-network/dusk-blockchain/pkg/core/consensus/header"
"github.com/dusk-network/dusk-blockchain/pkg/p2p/wire/message"
"github.com/dusk-network/dusk-blockchain/pkg/p2p/wire/topics"
"github.com/dusk... |
package cl
import (
"bytes"
"go/format"
"go/token"
"log"
"os"
"strconv"
"sync/atomic"
"testing"
goast "go/ast"
"github.com/goplus/c2go/clang/ast"
"github.com/goplus/c2go/clang/parser"
"github.com/goplus/c2go/clang/preprocessor"
"github.com/goplus/gox"
)
// ----------------------------------------------... |
package utils
import (
"encoding/csv"
"fmt"
"log"
"net"
"os"
"strconv"
"time"
)
const (
defaultOutput = "result.csv"
maxDelay = 9999 * time.Millisecond
minDelay = 0 * time.Millisecond
)
var (
InputMaxDelay = maxDelay
InputMinDelay = minDelay
Output = defaultOutput
PrintNum = 10
)
... |
// +build wasm
package ipc
import (
"encoding/binary"
"syscall/js"
)
type msgChunk struct {
Channel string
MsgId int32
ThisChunk int32
ChunkCount int32
Content []byte
}
func (m msgChunk) serialize() []byte {
chanBytes := []byte(m.Channel)
result := make([]byte, 2+len(chanBytes)+len(m.Content)+3... |
package data
// Statistics represents an object containing a list of statistical data for course (or subject)
type Statistics struct {
Continuation []*Continuation `bson:"continuation,omitempty"`
Employment []*Employment `bson:"employment,omitempty"`
JobList *JobList `bson:"job_list,omitempty"`
Job... |
package model
import (
"database/sql"
"fmt"
"github.com/TomiHiltunen/geohash-golang"
_ "github.com/mattn/go-sqlite3"
"github.com/tcotav/gobase/logr"
)
const ltagsrc = "glmod"
// dbUrl := fmt.Sprintf("%s:%s@%s", uuser, passwd, dbname)
var dbUrl = ""
type LKey struct {
Lat float64
Long float64
Id st... |
package gophantomjs
import (
"bytes"
"fmt"
. "github.com/gophper/gomini"
"net/url"
"os"
"sync"
"text/template"
"time"
)
var (
settingMutex sync.Mutex
tempDir = "gophantomjs/temp/"
defaultPhantomJsPageSettings = &PhantomJsPageSettings{
JavascriptEnabled: false,
Load... |
package cache
import (
"database/sql"
"fmt"
"github.com/golang/protobuf/ptypes"
_ "github.com/mattn/go-sqlite3"
"google.golang.org/protobuf/types/known/anypb"
"log"
common "nephomancy/common/resources"
"nephomancy/dcs/resources"
"strings"
)
// Returns nil if spec location is compatible with Switzerland,
// a... |
package main
import (
"bufio"
"bytes"
"fmt"
"github.com/reiver/go-oi"
"github.com/reiver/go-telnet"
"io"
"math"
"os"
"regexp"
"strconv"
"strings"
"time"
)
var (
BotCaller telnet.Caller = internalBotCaller{}
writer telnet.Writer
reader telnet.Reader
ctx telnet.Context
)
type internalBotCal... |
package service
import (
"context"
"math/rand"
"strconv"
"sync"
"time"
filterrpc "go-common/app/service/main/filter/rpc/client"
"go-common/app/service/main/push/conf"
"go-common/app/service/main/push/dao"
"go-common/app/service/main/push/model"
"go-common/library/cache"
"go-common/library/log"
bm "go-comm... |
package http
import (
"errors"
"fmt"
"net/http"
"strconv"
"time"
"github.com/18F/e-QIP-prototype/api"
"github.com/18F/e-QIP-prototype/api/eqip"
)
// SubmitHandler is the handler for submitting the application.
type SubmitHandler struct {
Env api.Settings
Log api.LogService
Token api.TokenServi... |
package aws
import (
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
// GetNodeHostnames returns the hostnames of the autosca... |
// Copyright (c) KwanJunWen
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
package estemplate
import "fmt"
// TokenFilterSynonym token filter that allows to easily handle synonyms during
// the analysis process.
//
// See https://www.elas... |
func minimumDeviation(nums []int) int {
root := NewTree()
for _, num := range nums {
if num & 1 == 1{
root = root.Insert(num << 1)
} else {
root = root.Insert(num)
}
}
max, _ := root.Max()
min, _ := root.Min()
res := max - min
for {
if... |
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2021 The OpenYurt 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 app... |
package ste
import (
"context"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/Azure/azure-pipeline-go/pipeline"
"github.com/Azure/azure-storage-azcopy/v10/common"
"github.com/Azure/azure-storage-file-go/azfile"
)
func DeleteFile(jptm IJobPartTransferMgr, p pipeline.Pipeline, pacer pacer) {
// If the tran... |
// Copyright (c) 2016-2017,2020 Tigera, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required ... |
package toolset
import (
"crypto/ed25519"
"encoding/hex"
"fmt"
"os"
flag "github.com/spf13/pflag"
"github.com/wollac/iota-crypto-demo/pkg/bip32path"
"github.com/wollac/iota-crypto-demo/pkg/bip39"
"github.com/wollac/iota-crypto-demo/pkg/slip10"
"github.com/iotaledger/hive.go/configuration"
"github.com/iota... |
/*
Copyright 2015 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, ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package route53
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"
)
// A complex type that contains information about the request to create a h... |
/*
Copyright 2014 The Kubernetes Authors 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 ag... |
package huobi
import (
"bytes"
"compress/gzip"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"strings"
"github.com/blockcdn-go/exchange-sdk-go/global"
)
// GetAllSymbol 获取所有的可交易对
func (c *Client) GetAllSymbol() ([]global.TradeSymbol, error) {
r := struct {
Status string `json:"status"`
Data []TradeP... |
// Copyright 2016 The G3N 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 material
import (
"unsafe"
"github.com/g3n/engine/gls"
"github.com/g3n/engine/math32"
"github.com/g3n/engine/texture"
)
// Physical is a physica... |
// Copyright (c) 2017 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
)
const (
unknown = "<<unknown>>"
k8sEmptyDir = "kubernetes.io~empty-dir"
)
// variables to allow tests to modify the values
var ... |
package plugin
import (
"fmt"
"strings"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-plugin-circleci/server/circle"
v1 "github.com/mattermost/mattermost-plugin-circleci/server/circle/v1"
"github.com/mattermost/mattermost-plugin-circleci/server/store"
)
const (
accountT... |
// Copyright 2018 The Fuchsia 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 symbolize
import (
"bufio"
"context"
"fmt"
"io"
"os/exec"
"strconv"
"strings"
"go.fuchsia.dev/fuchsia/tools/debug/elflib"
"go.fuchsia.de... |
/*-
* Copyright 2014 Square Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
package run
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/relex/gotils/channels"
"github.com/relex/gotils/logger"
"github.com/relex/gotils/promexporter/promreg"
"github.com/relex/slog-agent/base"
"github.com/relex/slog-agent/base/bconfig"
"github.com/relex/slog-agent/defs"
)
// loaderIf... |
package sybil
type Record struct {
Strs []StrField
Ints []IntField
SetMap map[int16]SetField
Populated []int8
Timestamp int64
block *TableBlock
}
const (
_NO_VAL = iota
INT_VAL = iota
STR_VAL = iota
SET_VAL = iota
)
func (r *Record) GetStrVal(name string) (string, bool) {
id := r.block.get_... |
/*
Copyright © 2019 Doppler <<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 to in writing, soft... |
package main
import (
"fmt"
"net/http"
"log"
"os"
"os/exec"
"encoding/xml"
"strings"
"strconv"
)
// 解析XML,定义结构体
type Processes struct {
XMLName xml.Name `xml:"processes"`
ProcessInfo []ProcessInfo `xml:"process_info"`
}
type ProcessInfo struct {
XML... |
// Copyright (c) 2019 The Jaeger Authors.
// Copyright (c) 2018 Uber Technologies, 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
//... |
/*
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 i... |
// Copyright © 2020 The Things Network Foundation, The Things Industries B.V.
//
// 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
//
// Un... |
// 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 2016 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.