text stringlengths 3.08k 10.4k |
|---|
package subcmd
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"time"
"github.com/briandowns/spinner"
"github.com/segmentio/kubeapply/pkg/cluster"
"github.com/segmentio/kubeapply/pkg/cluster/diff"
"github.com/segmentio/kubeapply/pkg/cluster/kube"
"github.com/segmentio/kubeapply/pkg/config"
"github.... |
/*
* Copyright (c) 2015-2018 Nexenta Systems, Inc.
*
* This file is part of EdgeFS Project
* (see https://github.com/Nexenta/edgefs).
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional informat... |
// Copyright 2019 eBay Inc.
// Primary authors: <NAME>, <NAME>,
// <NAME>, and <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
// https://www.apache.org/licenses/... |
// Copyright © 2021 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-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
//
// Unle... |
// ZooBC zed25519
//
// Copyright © 2020 Quasisoft Limited - Hong Kong
//
// ZooBC is architected by <NAME> & <NAME>
// contact us at roberto.capodieci[at]blockchainzoo.com
// and barton.johnston[at]blockchainzoo.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
/... |
// Copyright 2020 Layer5, 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... |
// Copyright 2018 Twitch Interactive, 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. A copy of the License is
// located at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// or in the "license"... |
// Copyright © 2019 VMware, 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... |
package xlog
import (
"fmt"
"io"
"sync"
"time"
"github.com/rs/xid"
)
var _ LogRecorder = &ioDirectRecorder{}
type rqRecorderSignal string
type ioDirectRecorder struct {
chCtl chan controlSignal
chMsg chan LogMsg
chErr chan<- error // optional
chDbg chan<- debugMessage // optional
id xid.... |
// Copyright 2013 Beego Samples 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 agr... |
package httpserver
import (
"encoding/json"
"github.com/function61/eventkit/command"
"github.com/function61/eventkit/event"
"github.com/function61/gokit/assert"
"github.com/function61/gokit/httpauth"
"github.com/function61/gokit/logex"
"github.com/function61/passitron/pkg/commands"
"github.com/function61/passi... |
package sqlb
import (
"encoding/json"
r "reflect"
"unsafe"
)
/*
Options related to parsing text into `Ords`. Used by `ParserOrds` and
`OrdsParser`.
*/
type ParseOpt struct {
/**
Must be a struct type. Ords parsing uses this to detect which fields are
allowed, and to convert JSON field names to DB column names.
... |
package main
import (
"context"
"fmt"
"github.com/lesovsky/noisia/log"
"gopkg.in/alecthomas/kingpin.v2"
"os"
"os/signal"
"sync"
"syscall"
)
var (
appName, gitTag, gitCommit, gitBranch string
)
func main() {
var (
showVersion = kingpin.Flag("version", "show version and exit").Default().Bool()
... |
/*
Copyright 2020 The Alibaba 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... |
package s3
import (
"context"
"fmt"
"io"
"path"
"strings"
"time"
"github.com/ViBiOh/absto/pkg/model"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
)
// Name of the storage implementation
const Name = "s3"
var _ model.Storage = App{}
// App of package
type App struct {
clie... |
package main
import (
"encoding/json"
"strings"
"sync"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
)
var mutex sync.RWMutex
type mqttExporter struct {
client mqtt.Client
versionDesc *prometheus.Desc
connectDesc ... |
package cora
var Load = MakeNative(func(__e *ControlFlow) {
tmp176 := MakeNative(func(__e *ControlFlow) {
tmp177 := MakeNative(func(__e *ControlFlow) {
tmp178 := Call(__e, PrimNS1Value(symsimple_1error), MakeString("xxx"))
__e.TailApply(PrimNS1Value(sym_7), MakeNumber(2), tmp178)
return
}, 0)
tmp179... |
package endpoint
import (
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"os"
"sync"
"time"
lg "log"
"github.com/Shopify/sarama"
"github.com/tidwall/gjson"
"github.com/tidwall/tile38/internal/log"
)
const kafkaExpiresAfter = time.Second * 30
// KafkaConn is an endpoint connection
type KafkaConn ... |
package devconsole
import (
"encoding/json"
"fmt"
"net/http"
"github.com/ambientkit/ambient"
"github.com/ambientkit/ambient/internal/secureconfig"
"github.com/ambientkit/ambient/pkg/envdetect"
"github.com/ambientkit/away/router"
)
// DevConsole represents a web interface to receive commands from the amb tool.... |
package horse
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
julianBirthday = nook.Birthday{
Day: 15,
Mont... |
// Copyright 2018 Tetrate, 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 applicab... |
package dao
import (
"context"
"fmt"
"strconv"
"time"
eostest "github.com/digital-scarcity/eos-go-test"
"github.com/eoscanada/eos-go"
"github.com/hypha-dao/document-graph/docgraph"
"github.com/schollz/progressbar/v3"
"github.com/spf13/viper"
)
func defaultPause() time.Duration {
if viper.IsSet("pause") {
... |
/*
Copyright 2020 Gravitational, 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, soft... |
// Package imagesnap implements an image recorder with the imagesnap command
// for macOS.
package imagesnap
import (
"context"
"fmt"
"image/jpeg"
"log"
"os"
"os/exec"
"strings"
"time"
edgeimpulse "github.com/edgeimpulse/linux-sdk-go"
"github.com/edgeimpulse/linux-sdk-go/image"
"github.com/fsnotify/fsnoti... |
// Copyright 2013 errnoh. All rights reserved.
// Use of this source code is governed by
// MIT License that can be found in the LICENSE file.
// Helper library for termbox-go to split screen into panels
package panel
import (
termbox "github.com/nsf/termbox-go"
"image"
)
type Panel interface {
Bounds() image.Rec... |
package postgres
import (
"context"
"database/sql"
"encoding/json"
"fmt"
"math/rand"
"time"
"github.com/Masterminds/squirrel"
cdb "github.com/contiamo/go-base/v4/pkg/db"
"github.com/contiamo/go-base/v4/pkg/queue"
"github.com/contiamo/go-base/v4/pkg/queue/handlers"
cvalidation "github.com/contiamo/go-base/v... |
package main
import (
"log"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"github.com/slack-go/slack"
"github.com/spf13/cobra"
)
type Status struct {
Message string
Emoji string
Duration int
Away bool
// Do not disturb duration
DoNotDisturb bool
// Limit to a Group
Group string
// ... |
// Copyright The OpenTelemetry 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 ag... |
package main
import (
"flag"
"fmt"
"image"
"image/draw"
"image/jpeg"
_ "image/png" // import for side-effect registering png format
"log"
"os"
"github.com/nfnt/resize"
"gocv.io/x/gocv"
)
func main() {
var (
classifierFilePath string
photoImagePath string
photoDetectScale floa... |
package cwalk
import (
"errors"
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
)
// NumWorkers defines how many workers to run
// on each Walk() function invocation
var NumWorkers = runtime.GOMAXPROCS(0)
// BufferSize defines the size of the job buffer
var BufferSize = NumWorkers
// ErrNotDir indicate... |
package win
import (
"fmt"
"github.com/go-gl/glfw/v3.1/glfw"
"runtime"
"time"
)
type Window struct {
glfwWindow *glfw.Window
}
type WindowConfig struct {
Title string
Width int
Height int
Resizable bool
TickSpeed time.Duration
MinFps int
}
func DefaultConfig() WindowConfig {
return WindowCo... |
package ortfodb
// Functions to analyze media files.
// Used to go from a ParsedDescription struct to a Work struct.
import (
"image"
_ "image/jpeg"
_ "image/png"
"os"
"path"
"path/filepath"
"strings"
"github.com/gabriel-vasile/mimetype"
"github.com/metal3d/go-slugify"
"github.com/tcolgate/mp3"
"gitlab.co... |
package fifth
import (
"context"
"fmt"
"github.com/antihax/goesi/esi"
"github.com/bwmarrin/discordgo"
"github.com/eddbc/fifth-bot/esistatus"
"github.com/eddbc/fifth-bot/mux"
"log"
"strings"
"time"
)
//Eve ESI Client
var Eve *esi.APIClient
//Session Discord client session
var Session *discordgo.Session
//De... |
package main
import (
"errors"
"fmt"
"io"
"sort"
"strings"
"github.com/anz-bank/sysl/pkg/loader"
"github.com/anz-bank/sysl/pkg/cmdutils"
"github.com/anz-bank/sysl/pkg/parse"
"github.com/anz-bank/sysl/pkg/sysl"
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
"gopkg.in/alecthomas/kingpin.v2"
)
type... |
package n
import (
"context"
"fmt"
"strings"
"time"
"github.com/capatazlib/go-capataz/internal/s"
)
// rootName is the name of the ReliableNotifier supervisor root tree node
var rootName = "reliable-notifier"
// notifierSettings contains settings and callbacks for a ReliableNotifier
// instance
type notifierSe... |
// Copyright (c) 2021 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package vela
import (
"fmt"
"net/http"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
)
type AuthenticationType int
const (
// Authenticatio... |
package ecs
import (
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/cloudquery/cloudquery/providers/common"
"github.com/mitchellh/mapstructure"
"go.uber.org/zap"
"gorm.io/gorm"
)
type Cluster struct {
ID uint `gorm:"primarykey"`
AccountID string
Regi... |
package auth
import (
"encoding/json"
"errors"
"fmt"
"github.com/casbin/casbin/v2"
"github.com/casbin/xorm-adapter/v2"
"github.com/dgrijalva/jwt-go"
"github.com/dgrijalva/jwt-go/request"
_ "github.com/go-sql-driver/mysql"
"math/rand"
"net/http"
"time"
"github.com/micro/cli/v2"
"github.com/micro/micro/v2/... |
package e2e
import (
"context"
"fmt"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"
"si... |
package uller
import (
"encoding/json"
"fmt"
"github.com/gohouse/gorose/v2"
"net"
"os"
"sync"
"time"
)
// 日志队列
type Log struct {
Consumer string // 调用者程序所在机器路径+名称
StorageType string // 日志保存类型 file:本地文件存储,db:数据库存储,remotServer:远程服务器存储
StorageEngine *StorageEngine // 日志存储引擎
Cache bool ... |
package mixnet
import (
"bytes"
"context"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
"net"
"strconv"
"strings"
"testing"
"time"
"github.com/kwonalbert/xrd/config"
"github.com/kwonalbert/xrd/mixnet/verifiable_mixnet"
grpc "google.golang.org/grpc"
"goog... |
// 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 ... |
// Copyright 2021 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package mailgunmail
import (
"fmt"
"net/http"
"net/mail"
"strconv"
"time"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/haydenwoodhead/burner.kiwi/burner"
"github.com/haydenwoodhead/burner.kiwi/email"
log "github.com/sirupsen/logrus"
mailgun "gopkg.in/mailgun/mailgun-go.v1"
)
var _ burner.... |
// Copyright (c) 2020, pole-group. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package utils
import (
"context"
"errors"
"fmt"
"math"
"sync"
"time"
"github.com/pole-group/pole-rpc/common"
)
var (
ErrorEventNotRegister = err... |
// Package cmd /*
package cmd
import (
"encoding/json"
"io"
"io/ioutil"
"log"
"net/http"
"strconv"
ui "github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
"github.com/spf13/cobra"
)
// getCmd represents the get command
var getCmd = &cobra.Command{
Use: "get",
Short: "Get the Air Quality Ind... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: pigeon/protocol.proto
package pigeon
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a... |
package uniws
import (
"encoding/json"
"net/http"
"sync"
"time"
"github.com/centrifugal/centrifuge"
"github.com/centrifugal/protocol"
"github.com/gorilla/websocket"
)
// Handler handles WebSocket client connections. Usually WebSocket protocol
// is a bidirectional connection between a client and a server for ... |
package main
import (
"flag"
"fmt"
"os"
"regexp"
"sync"
"sync/atomic"
"time"
)
var (
// Compile the expressions here (it needs to be done only once).
mmapRe = regexp.MustCompile(mmapPat)
swapRe = regexp.MustCompile(swapPat)
// For no-op, disabled split-reads, and debug logging.
dryRun = false
rSplit = t... |
package main
import (
"flag"
"fmt"
"io"
"os"
"os/exec"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/pkg/errors"
)
func main() {... |
// Copyright (C) 2015 <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 service
import (
"encoding/json"
"fmt"
"gateway/model"
"html"
"log"
"net/http"
"os"
"strconv"
"strings"
"sync"
"time"
"io/ioutil"
"crypto/x509"
"crypto/tls"
)
func FilterIndexConfigs(sites []model.Site) []model.Response {
vsf := make([]model.Response, 0)
for _, v := range sites {
res := mode... |
package rabbitmq
import (
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"github.com/streadway/amqp"
"time"
)
// Producer is RabbitMQ Producer wrapper
// TODO: 修复 done 的信道的使用
type Producer struct {
// Producer UUID
UUID string
// Base struct for Producer
RabbitMQ *RabbitMQ
// The communication chann... |
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package main
import (
"fmt"
"os"
"testing"
"time"
_"github.com/paypal/hera/client/gosqldriver/tcp"
"github.com/paypal/hera/tests/functionaltest/testutil"
"github.com/paypal/hera/utility/logger"
)
/*
The test will start Mysql docker and OCC connects to this Mysql DB docker
No setup needed
*/
var mx tes... |
//
// Copyright 2018 <NAME> -- All rights reserved.
// https://github.com/MalinYamato
//
// MIT License
// 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 abov... |
package apiserv
import (
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/bytedance/sonic"
"github.com/bytedance/sonic/encoder"
)
var nukeCookieDate = time.Date(1991, time.August, 6, 0, 0, 0, 0, time.UTC)
// FromHTTPHandler returns a Handler from an http.Handler.
func FromHTTPHandler(h http.Handl... |
package control
import "encoding/json"
type BMConditionType string
const (
BMConditionTrafficType BMConditionType = "BMConditionTrafficType"
BMConditionQuota BMConditionType = "BMConditionQuota"
BMConditionLargeData BMConditionType = "BMConditionLargeData"
BMConditionTrafficRule BMConditionType = "BMCond... |
/*
Copyright 2019 The HAProxy Ingress Controller 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... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.4
// source: spacex/api/device/device.proto
package device
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/st... |
// Copyright (c) 2020, eQualit.ie inc.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
package internal
import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"github.com/google/uuid"
"github.co... |
package wal
import (
"bytes"
"hash/crc32"
"encoding/binary"
"fmt"
)
const (
BlockSize = 32
RecordHeadSize = 4 + 2 + 1
RecordMaxDataSize = BlockSize - RecordHeadSize
Full = 1
First = 2
Middle = 3
Last = 4
)
//var manger = Manager{0}
//var currentBlock = Block{}
type OP struct {
manager *Manager
curren... |
package dilbert
import (
"bytes"
"crypto/tls"
"encoding/xml"
"io/ioutil"
"log"
"net"
"net/http"
"time"
)
// against "unused imports"
var _ time.Time
var _ xml.Name
type TodaysDilbert struct {
XMLName xml.Name `xml:"http://gcomputer.net/webservices/ TodaysDilbert"`
}
type TodaysDilbertResponse struct {
XML... |
package logging
import (
"encoding/json"
"errors"
"fmt"
"log"
"os"
"runtime"
"strings"
"sync"
"time"
)
// Level represents the level of logging.
type Level uint8
const (
DebugLevel Level = iota
InfoLevel
WarnLevel
ErrorLevel
)
const (
// RecordLogFileName represents the default file name of the record... |
// Copyright 2021 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 v2raymanager
import (
"context"
"fmt"
"github.com/v2fly/v2ray-core/v4/app/proxyman/command"
statscmd "github.com/v2fly/v2ray-core/v4/app/stats/command"
"github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v4/common/serial"
"github.com/v2fly/v2ray-core/v4/proxy/vmess"
"github.co... |
//
// Copyright 2021 The Sigstore 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 ... |
/*
Copyright <EMAIL> .2020. 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 wri... |
package model
const (
RANK_0 = 0
)
//会员体系
type Member struct {
ID int64 `json:"id,omitempty"`
Guid string `json:"Guid,omitempty" xorm:"varchar(100) index"` //是 会员唯一标识
CardId string `json:"CardId,omitempty" xorm:"varchar(100) index"` //是 会员卡号
MemberGroupName st... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
package email
import (
"crypto/rand"
"fmt"
"io"
"mime"
"strings"
"time"
)
// NewMessageID generates a cryptographically unique RFC 2822 3.6.4 Message ID
// (not including angle brackets).
func NewMessageID(host string) string {
var rnd = make([]byte, 16)
rand.Read(rnd)
var tnow = t... |
package ledger_test
import (
"context"
"sync"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/pkg/errors"
"github.com/segmentio/ctlstore/pkg/ledger"
"github.com/segmentio/ctlstore/pkg/ledger/fakes"
_ "github.com/segmentio/events/v2/log"
"github.com/stret... |
// Copyright (c) 2014 Square, Inc
package memstat
import (
"bufio"
"fmt"
"math"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"time"
"github.com/square/inspect/metrics"
"github.com/square/inspect/os/misc"
)
// CgroupStat represents memory usage statistics for all non-default
// cgroups associated wit... |
/*
Copyright 2020 Red Hat.
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
distri... |
// Copyright Project Harbor 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 t... |
// Package promunifi provides the bridge between unifi metrics and prometheus.
package promunifi
import (
"fmt"
"reflect"
"strings"
"sync"
"time"
"github.com/davidnewhall/unifi-poller/pkg/metrics"
"github.com/prometheus/client_golang/prometheus"
"golift.io/unifi"
)
// channel buffer, fits at least one batch.... |
package day18
import (
"adventofcode/utils"
"fmt"
"math"
"strconv"
)
type TNode struct {
parent *TNode
left *TNode
right *TNode
value int
}
func (tn TNode) String() string {
if tn.isLeaf() {
return fmt.Sprint(tn.value)
}
return fmt.Sprintf("[%s,%s]", tn.left, tn.right)
}
func (tn TNode) isLeaf() bo... |
package main
import (
"context"
"net/http"
"os"
"github.com/pkg/errors"
eirinix "github.com/SUSE/eirinix"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission/types"
)
type Extension struct{ Namesp... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: delete_timer.proto
package evaluatord
import (
fmt "fmt"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.... |
package main
import (
"bytes"
"encoding/json"
"github.com/boltdb/bolt"
"github.com/gin-gonic/gin"
"net/http"
"strconv"
"strings"
"time"
)
func locationParamFilter(ctx *gin.Context) {
// 11 默认天津南开心栈
locKey := ctx.Param("loc")
if locVal, ok := bucketMap[locKey]; ok {
ctx.Set("loc", locVal)
} else {
ctx.... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/golang/glog"
govalidator "gopkg.in/go-playground/validator.v9"
"k8s.io/api/admission/v1beta1"
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
corev1 "k8s.io/api/core/v1"
extensionsv1beta1 "k8s.i... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.14.0
// source: foo/fum.proto
package foo
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
c... |
package tgui // TeleGram User Interface or Toolkit for Graphical User Interface
import (
"fmt"
"strconv"
"strings"
"parrbot/message"
"parrbot/robot"
"github.com/NicoNex/echotron/v3"
)
// Menu is a collection of message that can be seen by pressing the related
// button. The menu can be triggered by both a mes... |
package goracler
import (
"context"
"errors"
"log"
"sync"
"github.com/manelmontilla/goracler/crypto"
)
var (
// ErrInvalidCiphertext is returned by the Decrypt function when
// the cyphertext passed in is malformed.
ErrInvalidCiphertext = errors.New("invalid ciphertext")
// CipherBlockLen defines the lengt... |
package store
import (
"context"
"github.com/keegancsmith/sqlf"
"github.com/lib/pq"
btypes "github.com/sourcegraph/sourcegraph/enterprise/internal/batches/types"
"github.com/sourcegraph/sourcegraph/internal/api"
"github.com/sourcegraph/sourcegraph/internal/database/dbutil"
"github.com/sourcegraph/sourcegraph/... |
// Package consts contains constants used throughout the entire library and errors.
package consts
import "strings"
const (
// DefaultMinWeightMagnitude is the default difficulty on mainnet.
DefaultMinWeightMagnitude = 14
)
// SecurityLevel defines the security level used for input transactions or respectively, ho... |
package server
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"net"
"net/http"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/julienschmidt/httprouter"
"github.com/crossedbot/common/golang/logger"
)
// Server is interface that represents an HTTP server.
type Server interface {
Start() error
... |
package hybridlog
import (
"fmt"
log "github.com/sirupsen/logrus"
"io"
"os"
"path/filepath"
"sync"
"time"
"unsafe"
)
const (
minCompactionInterval = 60
defaultCompactionInterval = 60 * 60 // 60 minutes
minFragmentationThreshold = 1_000
defaultFragmentationThreshold = 10_000
fragmentationC... |
package config
import (
"crypto/md5"
"encoding/base64"
"github.com/browsefile/backend/src/cnst"
"github.com/pkg/errors"
"log"
"os"
"path/filepath"
"strings"
)
//presents 1 share Path in filesystem, and access rules
type ShareItem struct {
Path string `json:"path"`
//allow all not registered
AllowExternal b... |
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd 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
*
* ... |
/*
Copyright 2018 Iguazio Systems Ltd.
Licensed under the Apache License, Version 2.0 (the "License") with
an addition restriction as set forth herein. 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 b... |
package util
import (
"context"
"fmt"
"net/http"
"net/url"
"os"
"strings"
"golang.org/x/oauth2"
"github.com/jenkins-x/go-scm/scm"
"github.com/jenkins-x/go-scm/scm/factory"
"github.com/jenkins-x/go-scm/scm/transport"
"github.com/jenkins-x/lighthouse/pkg/config"
"github.com/jenkins-x/lighthouse/pkg/scmprov... |
package gopool
import (
"fmt"
"sync"
)
const (
// JobPendding job status is pendding
JobPendding = iota
// JobRunning job status is running
JobRunning
// JobSuccess job status is success
JobSuccess
// JobFail job status is fail
JobFail
// JobCancled jobs status is cancled
JobCancled
)
// JobHandler job n... |
package ftl
import (
"bytes"
"errors"
"log"
"eaglesong.dev/gunk/h264util"
"eaglesong.dev/gunk/internal"
"github.com/nareix/joy4/av"
"github.com/nareix/joy4/codec/h264parser"
"github.com/pion/rtp"
)
type Deframer struct {
SSRC uint32
PayloadType uint8
ClockRate uint64
Parser Parser
baseTS ... |
/*
* Copyright (C) 2016 Red Hat, 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 ofthe License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
// 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 not... |
/*
Package connpass provides a search method for using the connpass API (See https://connpass.com/about/api/).
Construct a query, then search with that on connpass. For example:
query := connpass.Query{}
// Retrieve the latest 10 events.
res, err := query.Search()
Specify query parameters by setting fields of a Q... |
package pipelinerun
import (
"context"
"fmt"
"github.com/go-logr/logr"
"github.com/jenkins-zh/jenkins-client/pkg/core"
"github.com/jenkins-zh/jenkins-client/pkg/job"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/retry"
"kubesphere.io/devops/pkg/api/devops/v1alpha3"
"kubesphe... |
package wx200
import (
"fmt"
"time"
)
// Time display hour format
const (
DISPLAY_HOUR_FORMAT_12 = iota
DISPLAY_HOUR_FORMAT_24
)
// Time display date format
const (
DISPLAY_DATE_FORMAT_DM = iota
DISPLAY_DATE_FORMAT_MD
)
// Time holds time values, formats and alarm data
type Time struct {
// LastDataRecieved... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: spire-next/types/spiffeid.proto
package types
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.