text stringlengths 3.08k 10.4k |
|---|
// Copyright © 2019 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... |
package player
import (
"database/sql"
"fmt"
"gonet/actor"
"gonet/base"
"gonet/db"
"gonet/message"
"gonet/server/common"
"gonet/server/world"
"strings"
)
//********************************************************
// 玩家管理
//********************************************************
var(
PLAYERMGR PlayerMgr
)
ty... |
package lib
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"testing"
"github.com/Files-com/files-sdk-go/v2/lib"
files_sdk "github.com/Files-com/files-sdk-go/v2"
"github.com/dnaeon/go-vcr/cassette"
recorder "github.com/dnaeon/go-vcr/recorder"
"github.com/stretchr/testify/assert"... |
/*
Copyright © 2019 NAME HERE <EMAIL ADDRESS>
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... |
package logger
import (
"encoding/json"
"errors"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
"path/filepath"
"runtime"
"strings"
)
var (
zapLogger *zap.Logger
zapInfoLogger *zap.Logger
)
type Options struct {
ErrLog string
InfoLog string
MaxSize int
MaxBackups ... |
package protocol
import (
"bytes"
"encoding/binary"
"errors"
"io"
"math"
)
const (
defaultPackHead = 2
)
var (
defaultByteOrder = binary.BigEndian
)
var ErrIOReadWriterNil = errors.New("io.ReadWriter is nil")
type fixlenProtocol struct {
maxSend int //最大发送的长度
maxRecv int //最小发送的长度
n ... |
package ledgerbackend
import (
"bufio"
"io"
"time"
"github.com/pkg/errors"
"github.com/stellar/go/support/log"
"github.com/stellar/go/xdr"
)
const (
// The constants below define sizes of metaPipeBufferSize (binary) and
// ledgerReadAheadBufferSize (in ledgers). In general:
//
// metaPipeBufferSize >=
/... |
// Copyright © 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... |
// Copyright 2016 the Go-Circuits 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... |
/*
* JuiceFS, Copyright 2021 Juicedata, 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 ... |
/*
* Copyright 2019-2020 by <NAME>
* https://www.fibratus.io
* 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
*... |
package server
import (
"os"
"runtime"
"time"
"github.com/ernestrc/dispatchd/amqp"
)
func (channel *Channel) connectionRoute(conn *AMQPConnection, methodFrame amqp.MethodFrame) *amqp.AMQPError {
switch method := methodFrame.(type) {
case *amqp.ConnectionStartOk:
return channel.connectionStartOk(conn, method)... |
// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
package lib
import (
"errors"
"fmt"
"net/url"
"regexp"
"strings"
"time"
"websiteclone/helper"
"github.com/PuerkitoBio/goquery"
)
/**
* 下载主结构体
*/
type DOWN struct {
PL int64 //下载目录深度
TO int64 //超时重试时间
PR string //文件保存路径
URL string //准备下载的网站地址
DM string //准备下载的网站的域名
}
/**
* 获取html内容并保存到index.html中... |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/quintilesims/layer0/api/logic (interfaces: ServiceLogic)
// Package mock_logic is a generated GoMock package.
package mock_logic
import (
gomock "github.com/golang/mock/gomock"
models "github.com/quintilesims/layer0/common/models"
reflect "reflect"
)... |
package main
import (
"net/url"
"testing"
v2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/stretchr/testify/assert"
)
func TestCheckArgs(t *testing.T) {
assert := assert.New(t)
event := v2.FixtureEvent("entity1", "check1")
err := checkArgs(event)
assert.Error(err)
event2 := v2.FixtureEvent("entity2", ... |
/*
Copyright 2019 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 http_reply
import (
"net/http"
"io/ioutil"
"fmt"
"encoding/json"
"model/pkg/metapb"
"strconv"
"util/log"
"crypto/md5"
)
type Reply struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
type RangeLocateRequest struct {
DbName string `... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package hellosvc
import (
context "context"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this ge... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package helpers
import (
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"math/rand"
"regexp"
"strings"
"time"
"unicode"
"github.com/sethvargo/go-password/password"
)
const (
passwordLength = 16
lowerAlphaChars = "abcdef... |
package rucaptcha
import (
"net/http"
"io/ioutil"
"encoding/base64"
"net/url"
"strings"
"time"
"errors"
"crypto/tls"
)
const (
in string = "http://rucaptcha.com/in.php"
res string = "http://rucaptcha.com/res.php"
)
type RuCaptcha struct {
Id string
ApiKey string
Sleep time.Dur... |
// Copyright (c) 2019 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
//
// Unless required by applicable law o... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package keystore
import (
"crypto/x509"
"fmt"
"github.com/hyperledger/aries-framework-go/component/storageutil/mem"
"github.com/hyperledger/aries-framework-go/pkg/kms"
"github.com/hyperledger/aries-framework-go... |
package server
import (
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"errors"
"fmt"
"io"
"log"
"net/http"
"strings"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/ds-vologdin/otus-software-architect/task05/auth-sidecar/config"
)
const (
TokenTypeAccess = "access"
TokenTypeAccessTTL = time.Duratio... |
// This package implements of NNLS model, which solves the non-negative least
// squares problem.
//
// See http://cmp.felk.cvut.cz/ftp/articles/franc/Franc-Hlavac-Navara-CAIP05.pdf
// for more details.
package optimus
import (
"errors"
"fmt"
"math"
"strings"
"time"
"go.uber.org/zap"
)
type SCAKKTModel struct... |
package web
import (
"errors"
"fmt"
"strconv"
"strings"
"github.com/gascore/dom"
"github.com/gascore/gas"
)
// CreateElement render element
func CreateElement(el interface{}) (dom.Node, error) {
switch el := el.(type) {
case string:
return createTextNode(el)
case fmt.Stringer:
return createTextNode(el.S... |
package plugins
import (
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/alibaba/pouch/pkg/utils"
"github.com/sirupsen/logrus"
)
// pluginManager is a plugin manager, which manages all plugin events.
type pluginManager struct {
sync.Mutex
plugins map[string]*P... |
/*
Copyright 2015 The Kubernetes Authors.
Copyright 2021 The Tilt 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 app... |
package mod
import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"github.com/cloudfoundry/libcfbuildpack/build"
"github.com/cloudfoundry/libcfbuildpack/helper"
"github.com/cloudfoundry/libcfbuildpack/layers"
)
const (
Dependency = "go-mod"
Cache = "go-cache"
Launch = "app-binary"
)
type Runner i... |
package testrail
import "fmt"
// Case represents a Test Case
type Case struct {
CreatedBy int `json:"created_by"`
CreatedOn int `json:"created_on"`
CustomExpected string `json:"custom_expected"`
CustomPreconds string `json:"custom_preconds"`
CustomS... |
package grpsink
import (
"context"
"strconv"
"sync/atomic"
ocontext "golang.org/x/net/context"
"github.com/DataDog/datadog-go/statsd"
"github.com/sirupsen/logrus"
"github.com/stripe/veneur/protocol"
"github.com/stripe/veneur/sinks"
"github.com/stripe/veneur/ssf"
"github.com/stripe/veneur/trace"
"github.co... |
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"fmt"
"strings"
"github.com/gotd/td/bin"
)
// No-op definition for keeping imports.
var _ = bin.Buffer{}
var _ = context.Background()
var _ = fmt.Stringer(nil)
var _ = strings.Builder{}
// HelpCountry represents TL type `help.country#c387... |
package postman
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"regexp"
"strings"
"github.com/fatih/color"
"github.com/robertkrimen/otto"
)
var (
ErrRequestNotFound = errors.New("request not found")
ErrAllParsersFailed = errors.New("failed to parse collection file, all parsers failed")
)
type CollectionBuil... |
package ptcpayclient
//***********************************************
//* Copyright (c) 2021 Ulbora Labs LLC
//* Copyright (c) 2021 <NAME>
//***********************************************
import (
"encoding/hex"
"encoding/json"
"fmt"
"net/http"
)
//CreateInvoice CreateInvoice
func (a *BTCPayClient) CreateInvo... |
/*
* 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 ... |
package simutil
import (
//"log"
"math"
"sync"
"github.com/synerex/synerex_alpha/api"
)
var (
mu sync.Mutex
)
////////////////////////////////////////////////////////////
////////////// Provider Manager Class //////////
///////////////////////////////////////////////////////////
type IDType int
co... |
package model
import (
CommonModel "ServerCommon/model"
//"ServerIMS/model"
"bytes"
"os"
log "github.com/golang/glog"
)
//主从同步消息
const MSG_STORAGE_SYNC_BEGIN = 220
const MSG_STORAGE_SYNC_MESSAGE = 221
const MSG_STORAGE_SYNC_MESSAGE_BATCH = 222
//内部文件存储使用
//个人消息队列 代替MSG_OFFLINE_V3
const MSG_OFFLINE_V4 = 248
//... |
/*
Copyright 2020 IBM All Rights Reserved.
Copyright 2020 Intel Corporation
SPDX-License-Identifier: Apache-2.0
*/
package fpc
import (
"encoding/base64"
"encoding/json"
"log"
"github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/fpc/crypto"
"github.com/hyperledger-labs/fabric-private-chaincode/i... |
package kube
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
"github.com/docker/compose-on-kubernetes/api/client/clientset"
composev1beta2 "github.com/docker/compose-on-kubernetes/api/client/clientset/typed/compose/v1beta2"
"github.com/docker/compose-on-kubernetes/api/compose/v1beta2"
"github.com... |
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/
package conditions
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type Conditions []Condition
// FindIndexByType returns the index of the condition with the given ConditionType if it exists.
// If the Condition with... |
package main
import (
"fmt"
"log"
"time"
"database/sql"
_ "github.com/go-sql-driver/mysql"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
type User struct {
login string // The user's login name.
city string // The user's reported city.
state s... |
// Copyright © 2018 <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... |
package main
import (
"fmt"
"log"
"os"
"github.com/kiteco/kiteco/kite-go/lang/python/pythoncode"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonimports"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonresource"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonresource/cmd/build/helpers"
"github.co... |
/* This package implements an image DB cache using memcached.
Items are given an expiry based on their refresh deadline, with a
minimum duration to try and ensure things will expire well after they
would have been refreshed (i.e., only if they truly need garbage
collection).
memcached will still evict things when und... |
// Copyright 2014 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.
// +build linux
package runtime
import "unsafe"
func dumpregs(c *sigctxt) {
print("x0 ", hex(c.x0()), "\n")
print("x1 ", hex(c.x1()), "\n")
prin... |
package cmd
import (
"github.com/spf13/cobra"
"github.com/wandera/git2kube/pkg/cmd"
"github.com/wandera/git2kube/pkg/fetch"
"github.com/wandera/git2kube/pkg/upload"
"os"
)
var lp = struct {
kubeconfig bool
git string
branch string
folder string
target string
namespace string
merg... |
package router
import (
"fmt"
apiv1 "litrocket/api/v1"
)
const (
// user
GetUser = "get/userinfo"
SearchUserByName = "sea/user"
EditUserImage = "edit/userimage"
EditUserAge = "edit/userage"
EditUserSex = "edit/usersex"
EditUserTips = "edit/usertips"
// friend
AddFriend = "add/... |
package config
import (
"os/user"
"path"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/go-playground/validator.v9"
)
type (
// Telegram bot details struct
Telegram struct {
// BotToken is the token of your telegram bot
BotToken string `mapstructure:"tg_bot_token"`
// ChatID is the ... |
package hostedtsdb
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"sync"
"time"
"github.com/intelsdi-x/snap-plugin-utilities/logger"
"github.com/intelsdi-x/snap/control/plugin"
"gopkg.in/raintank/schema.v1"
"gopkg.in/raintank/schema.v1/msg"
)
type TsdbPool struct {
sync.Mutex
Pool map[str... |
/*
* Copyright (C) 2021 The ontology Authors
* This file is part of The ontology library.
*
* The ontology is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (a... |
/*
Copyright (C) NoRouter 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 i... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
tc := readNum(reader)
var buf bytes.Buffer
for tc > 0 {
tc--
n := readNum(reader)
E := make([][]int, n*(n-1)/2)
for i := 0; i < len(E); i++ {
E[i] = readNNums(reader, 2)
}
res := solve(n, E)
... |
// This package contains validators for all elements of the workflow spec (node, task, branch, interface, bindings... etc.)
package validators
import (
"fmt"
flyte "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
c "github.com/flyteorg/flytepropeller/pkg/compiler/common"
"github.com/flyteorg/flytepropeller/... |
package aac
import (
"fmt"
)
// ADTSPacket is an ADTS packet
type ADTSPacket struct {
SampleRate int
ChannelCount int
Frame []byte
}
// DecodeADTS decodes an ADTS stream into ADTS packets.
func DecodeADTS(byts []byte) ([]*ADTSPacket, error) {
// refs: https://wiki.multimedia.cx/index.php/ADTS
var ret... |
// *** 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 signer
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides information about a Signer Signing Profi... |
package messages
import (
"database/sql"
"encoding/json"
"fmt"
"sort"
"strconv"
"github.com/metacoin/flojson"
"github.com/oipwg/media-protocol/utility"
)
const PROMOTER_ROOT_KEY = "alexandria-promoter"
type Promoter_SocialMedias []Promoter_SocialMedia
type Promoter_SocialMedia struct {
Sequence int `jso... |
// Copyright (c) 2016 <NAME>, Inc.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the COPYING file.
package producer
import (
"encoding/json"
"strings"
"sync"
"testing"
"github.com/aristanetworks/goarista/kafka/gnmi"
"github.com/aristanetworks/goarista/test"
"github.... |
package sam3
import (
"bytes"
"errors"
"net"
"strconv"
"time"
)
// The DatagramSession implements net.PacketConn. It works almost like ordinary
// UDP, except that datagrams may be at most 31kB large. These datagrams are
// also end-to-end encrypted, signed and includes replay-protection. And they
// are also bu... |
package telegraf
import (
"encoding/json"
"fmt"
"strconv"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/amonapp/amonagent/internal/util"
"github.com/amonapp/amonagent/plugins"
"github.com/mitchellh/mapstructure"
)
// Telegraf - XXX
type Telegraf struct {
Config Config
}
// Description - XXX
func (... |
package infra
import (
"bytes"
"encoding/json"
"errors"
"strings"
)
func parseHost(s string) string {
parts := strings.Split(s, ",")
for i := range parts {
parts[i] = "\"" + parts[i] + "\""
}
s = strings.Join(parts, ",")
return s
}
func prettyPrint(b []byte) ([]byte, error) {
var out bytes.Buffer
err :=... |
package inputeventsubsystem
import (
"bytes"
"encoding/binary"
"fmt"
"os"
"syscall"
"time"
)
type AbsInfo struct {
Value int32
Minimum int32
Maximum int32
Fuzz int32
Flat int32
Resolution int32
}
func (a *AbsInfo) Unpack(data []byte) {
//very important , we used basic read . Read... |
package workspace
import (
"encoding/csv"
"fmt"
"log"
"strconv"
"sync"
"github.com/afeeblechild/aws-go-tool/lib/utils"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/workspaces"
)
type WorkspaceOptions struct {
Tags []string
}
type RegionWorkspac... |
package mock
import (
"errors"
"consts"
"util"
"protocol/engine"
"protocol/biz"
"git.xfyun.cn/AIaaS/xsf-external/client"
"github.com/golang/protobuf/proto"
"git.xfyun.cn/AIaaS/xsf-external/utils"
"encoding/json"
)
var Engine = &engine{}
type engine struct {
}
//初始化参数
func initParams(s... |
/*
Copyright 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, softw... |
package endpoint
import (
"encoding/json"
"errors"
"fmt"
"log"
"regexp"
"sync"
"time"
"github.com/BurntSushi/toml"
"github.com/influxdata/influxdb/client/v2"
)
// Internal is the struct dedicated
// for collecting statistics
type Internal struct {
Frequency string
Database string
Enable bool
}
// HT... |
package permission
import (
"fmt"
"strconv"
"github.com/gotomicro/ego/core/elog"
"go.uber.org/zap"
"github.com/shimohq/mogo/api/internal/invoker"
"github.com/shimohq/mogo/api/internal/service/permission/pmsplugin"
"github.com/shimohq/mogo/api/pkg/model/view"
)
// UserPmsChecker ...
type UserPmsChecker interf... |
// Copyright 2011-2018 <NAME>.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in t... |
package imgutil
import (
"bufio"
"bytes"
"crypto/sha1"
"fmt"
"gin-vue-admin/global"
"github.com/nfnt/resize"
"image/jpeg"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
p "path"
"path/filepath"
"strconv"
"strings"
)
/* 参考博客 https://github.com/Aszzo/tinker */
// ResizeJpg 压缩jpg quality 设置为1时,图片最小
func ResizeJ... |
package storage
import (
"database/sql"
"time"
"github.com/imyousuf/webhook-broker/storage/data"
)
const (
consumerSelectRowCommonQuery = "SELECT id, consumerId, channelId, name, token, callbackUrl, createdAt, updatedAt FROM consumer WHERE"
)
// ConsumerDBRepository is the RDBMS implementation for ConsumerRepos... |
package timediff_test
import (
"fmt"
"testing"
"github.com/mergestat/timediff"
)
var fixtures_pt_BR = map[string]string{
"-10s": "há poucos segundos",
"-44s": "há poucos segundos",
"-45s": "há um minuto",
"-89s": ... |
package extractors
import (
"encoding/json"
"errors"
"fmt"
"log"
"strconv"
"strings"
"github.com/iawia002/annie/config"
"github.com/iawia002/annie/downloader"
"github.com/iawia002/annie/parser"
"github.com/iawia002/annie/request"
"github.com/iawia002/annie/utils"
)
const (
// BiliBili blocks keys from ti... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iot
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 ListJobExecutionsForThingInput struct {
_ struct{} `type:"structure"`
/... |
// Copyright (c) 2018-2021 Splunk 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 appl... |
/* YaNFD - Yet another NDN Forwarding Daemon
*
* Copyright (C) 2020-2021 <NAME>.
*
* This file is licensed under the terms of the MIT License, as found in LICENSE.md.
*/
package tlv
import (
"encoding/binary"
"errors"
"math"
"github.com/named-data/YaNFD/ndn/util"
)
// EncodeVarNum encodes a non-negative in... |
package main
import (
"encoding/json"
"io"
"net"
"os"
"runtime"
"strconv"
"strings"
"embed"
"errors"
"flag"
"io/fs"
"net/http"
"path/filepath"
"time"
"github.com/gorilla/mux"
"github.com/natefinch/lumberjack"
"github.com/rs/cors"
log "github.com/sirupsen/logrus"
)
// Command-line flags
var (
fla... |
// Copyright 2021 Cloud Privacy Labs, 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 a... |
package main
import (
"os"
"log"
"fmt"
"net/http"
"io/ioutil"
"path/filepath"
"github.com/made2591/go-cpt/model/sequence"
"github.com/made2591/go-cpt/model/predictionTree"
"github.com/made2591/go-cpt/model/invertedIndexTable"
"github.com/made2591/go-cpt/model/compactPredictionTree"
"strings"
"encoding/j... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: osmosis/superfluid/tx.proto
package types
import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-sdk/types"
_ "github.com/gogo/protobuf/gogoproto"
grpc1 "github.com/gogo/protobuf/grpc"
proto "github.com/gogo/protobuf/proto"
grpc "google.go... |
/*
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR... |
package main
import "database/sql"
import _ "github.com/go-sql-driver/mysql"
import "fmt"
import "regexp"
type mysqlTeamData struct {
level int8
difficulty float64
level1Won bool
level1UnlockedChunks int8
level2Won bool
level2UnlockedChunks int8
level3Won bool
level3Un... |
// Copyright (c) 2019, <NAME> <<EMAIL>>
// See LICENSE for licensing information
package main
import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"
"time"
)
const (
regUser = "ieuser"
adminUser = "administrator"
password = "<PASSWORD>!"
tempDir = `C:\Users\administrator`
powerShell = `C:\Windows\System... |
package event
import (
"github.com/TIBCOSoftware/flogo-lib/logger"
"sync"
"runtime/debug"
"errors"
"strings"
"github.com/TIBCOSoftware/flogo-lib/config"
)
type EventListener interface {
// Returns name of the listener
Name() string
// Called when matching event occurs
HandleEvent(*EventContext) error
}
va... |
// Copyright 2021 The casbin 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 a... |
package dubbo
import (
"bytes"
"context"
constant2 "github.com/dapr/components-contrib/bindings/alicloud/dubbo/constants"
"strconv"
"strings"
"github.com/apache/dubbo-go/common/constant"
"github.com/dapr/components-contrib/bindings/alicloud/dubbo/logger"
"github.com/dapr/components-contrib/bindings"
perror... |
package model
import (
"context"
"crypto/tls"
"fmt"
"io"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"strings"
"golang.org/x/net/publicsuffix"
)
const sessionCookie = "JSESSIONID"
const dwrSessionCookie = "DWRSESSIONID"
// ErrPageTooSmall when paginated commands are givel a page size too small (<=0)
c... |
package models
import (
"os"
"path"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/xorcare/pointer"
)
func tableFromJSONFile(name string) (tr *TableResponse, err error) {
... |
package server
import (
"github.com/google/uuid"
"github.com/mattwalo32/RealTimeAPI/internal/conn"
"github.com/mattwalo32/RealTimeAPI/internal/messages"
"github.com/mattwalo32/RealTimeAPI/internal/timer"
log "github.com/sirupsen/logrus"
"net"
"sync"
)
const (
UDP_RECEIVING_CHAN_SIZE = 15
MIN_RECEIVING_CHAN_C... |
package pickcheck
import (
"fmt"
"strings"
"time"
"github.com/ProtossGenius/SureMoonNet/basis/smn_exec"
)
// GitLogInfo git log info detail.
type GitLogInfo struct {
Author string
Date string
Title string
Tasks string
RevCdoe string
date int64
}
func (info *GitLogInfo) Show() {
fmt.Printf("%s ... |
// Copyright 2020 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 appl... |
package app
import (
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/rlp"
lru "github.com/hashicorp/go... |
package job
import (
"context"
"fmt"
"github.com/gardener/gardener/pkg/apis/core/v1beta1"
gardener_apis "github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1"
"github.com/kyma-project/control-plane/components/subscription-cleanup-job/internal/cloudprovider"
"github.com/kyma-projec... |
// Copyright (C) 2019 Orange
//
// This software is distributed under the terms and conditions of the 'Apache License 2.0'
// license which can be found in the file 'License.txt' in this package distribution
// or at 'http://www.apache.org/licenses/LICENSE-2.0'.
package v1
import (
"context"
"optisam-backend/com... |
package route
import (
"errors"
"fmt"
"sort"
"github.com/jinzhu/gorm"
"github.com/yuki-toida/refodpt/backend/domain/model/master"
"github.com/yuki-toida/refodpt/backend/infrastructure/repository"
"github.com/yuki-toida/refodpt/backend/usecase/cache"
)
type UseCase struct {
db *gorm.DB
cuc *cache.UseCase
}
... |
// +build fafb
package integrationtest
import (
"encoding/json"
"fmt"
"sync"
"testing"
"k8s.io/apimachinery/pkg/api/errors"
coreops "github.com/portworx/sched-ops/k8s/core"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
)
const (
// SourceConfigSecretName is the name of the secret that... |
package jia
import (
"errors"
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/token"
"go/types"
"io"
"log"
"os"
"path"
"strings"
"unicode"
"gopkg.in/yaml.v3"
)
type FieldType types.Type
type Field struct {
Name string
Type FieldType
}
type Struct struct {
Name string
Fields []Field
}
type Func st... |
package bluzelle
// Layer 2: Cryptographic Layer
// https://github.com/bluzelle/client-development-guide/blob/v0.4.x/layers/layer-1-persistent-connection.md
import (
"bytes"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"encoding/base64"
"encoding/pem"
"errors"
"log"
"math/big"
"strconv"
"time"
"github.... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"os/signal"
"syscall"
"time"
"github.com/andrewchambers/go-cdmetrics"
_ "github.com/andrewchambers/go-cdmetrics/flag"
)
// flags
var (
printSchedule = flag.Bool("print-schedule", false, "Print the schedule for the next 24 hours then e... |
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"os"
"runtime/pprof"
"sort"
"strconv"
"strings"
"time"
"github.com/x3art/x3t/xt"
"github.com/x3art/x3t/xt/bob"
)
func usage() {
fmt.Fprintf(os.Stderr, "Usage: xtool <X3 directory> <ls|cat> [args]\n")
fmt.Println(flag.NArg(), flag.NFlag())
os.Exit(... |
package prioritylimiter
import (
"container/heap"
"context"
"errors"
"sync/atomic"
"time"
"github.com/prometheus/client_golang/prometheus"
)
const (
indexStateActive = -1
indexStateNew = -2
indexStateCancelled = -3
)
type request struct {
priority int // less is more
canEnter chan struct{}
inde... |
// Copyright © 2019 The Homeport Team
//
// 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, publis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.