text stringlengths 3.08k 10.4k |
|---|
package api
import (
"errors"
"fmt"
"reflect"
)
func resolve(dst, src interface{}) (
vdst reflect.Value,
vsrc reflect.Value,
tdst reflect.Type,
tsrc reflect.Type,
err error,
) {
tdst = reflect.TypeOf(dst)
tsrc = reflect.TypeOf(src)
vdst = reflect.ValueOf(dst)
vsrc = reflect.ValueOf(src)
vsrc = reflect.I... |
package weixin
import (
"fmt"
"github.com/bububa/pg"
log "github.com/kdar/factorlog"
"io"
"net/http"
"net/url"
"regexp"
"sync"
"time"
)
var logger *log.FactorLog
func SetLogger(aLogger *log.FactorLog) {
logger = aLogger
}
// Common message header
type MessageHeader struct {
ToUserName string
FromUserN... |
package moss
import (
"bufio"
"fmt"
"net"
"strings"
"github.com/ishitb/mossgo/utils"
)
type Moss struct {
Languages []string
server string
port int
unique_id string
// Flags
language string
directory int
base_files []string
max_limit ... |
/* Copyright (c) 2016 <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions an... |
package omnik
import (
"encoding/hex"
"strconv"
"time"
)
// InverterMsg provides an easy way to turn an omnik message into actual values.
type InverterMsg struct {
Data []byte
}
// Sample is an inverter sample DTO.
type Sample struct {
Timestamp string
Date string
Time string
Temperature float32
En... |
// Copyright (c) 2021 Red Hat, Inc.
// Copyright Contributors to the Open Cluster Management project
package certificates
import (
"context"
"crypto/x509"
"encoding/pem"
"fmt"
"os"
"reflect"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.... |
package nettools
import (
"errors"
"golang.org/x/net/icmp"
"golang.org/x/net/ipv4"
"math"
"math/rand"
"net"
"sync"
"time"
)
type Mtr struct {
Host string
Send int
Loss int
Last time.Duration
Avg time.Duration
Best time.Duration
Wrst time.Duration
StDev float64
}
func RunMtr(Addr string, maxrt... |
/*
* Copyright 2019 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/hyperledger-labs/fabric-private-chaincode/internal/attestation"
"github.com/hyperledger-labs/fabric-private-chaincode/internal/... |
// Copyright 2020 Douyu
//
// 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 writin... |
package file
import (
"bytes"
"encoding/binary"
"fmt"
"hash/crc32"
"io"
"math"
"os"
"sync"
"sync/atomic"
"github.com/hardcore-os/corekv/utils"
"github.com/pkg/errors"
)
type LogFile struct {
Lock sync.RWMutex
FID uint32
size uint32
f *MmapFile
}
func (lf *LogFile) Open(opt *Options) error {
var ... |
package mapper
import (
"github.com/QOSGroup/qbase/types"
"reflect"
"strconv"
"testing"
"github.com/QOSGroup/qbase/store"
"github.com/stretchr/testify/require"
go_amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
cryptoAmino "g... |
package orm
import (
"fmt"
"strings"
)
type MysqlModeToSql struct {
Params ParamsInterface
}
func (self MysqlModeToSql) Instance(param ParamsInterface) {
self.Params = param
}
// where
// where 条件:
// __exact 精确等于 like 'aaa'
// __iexact 精确等于 忽略大小写 ilike 'aaa'
// __contains 包含 like '%aaa%'
// __icon... |
package main
import (
"context"
"flag"
"github.com/pjoc-team/fsync/internal/config"
"github.com/pjoc-team/fsync/pkg/fsync"
"github.com/pjoc-team/fsync/pkg/storage/api"
oss2 "github.com/pjoc-team/fsync/pkg/storage/backend/oss"
"github.com/pjoc-team/tracing/logger"
"github.com/spf13/pflag"
"github.com/spf13/vip... |
package webhook
import (
"crypto/rand"
"crypto/tls"
"encoding/json"
"fmt"
"github.com/OpenHomeAuto/AiListener/pkg/dflow"
"github.com/OpenHomeAuto/AiListener/pkg/util"
"github.com/gorilla/mux"
df "github.com/leboncoin/dialogflow-go-webhook"
"golang.org/x/crypto/acme/autocert"
"golang.org/x/net/http2"
"log"
... |
package lib
import (
"github.com/browsefile/backend/src/cnst"
"github.com/browsefile/backend/src/config"
"github.com/browsefile/backend/src/lib/utils"
"net/http"
"net/url"
"strings"
)
//used to filter out specific files by name and path
type FitFilter func(name, p string) bool
// Context contains the needed in... |
package thorchain
import (
"errors"
"fmt"
"github.com/blang/semver"
sdk "github.com/cosmos/cosmos-sdk/types"
tmtypes "github.com/tendermint/tendermint/types"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornode/constants"
)
type NativeTxHandler struct {
keeper Keeper
vers... |
package alexa
import (
"regexp"
"strconv"
"time"
"github.com/apex/log"
nowutil "github.com/jinzhu/now"
)
// WeatherRequest is a formatted RequestBody
type WeatherRequest struct {
Condition string
TimeSpan
}
var (
weekRegex = regexp.MustCompile(`(\d{4})-W(\d{1,2})(-WE)?`)
)
const (
// Day is a time.Duratio... |
package cache
import (
"fmt"
"github.com/GrappigPanda/Olivia/bloomfilter"
"github.com/GrappigPanda/Olivia/bloomfilter/search"
"github.com/GrappigPanda/Olivia/config"
"github.com/GrappigPanda/Olivia/dht"
"github.com/GrappigPanda/Olivia/network/message_handler"
binheap "github.com/GrappigPanda/Olivia/shared"
"lo... |
package middleware
import (
"bytes"
"fmt"
v1 "gin-web/api/v1"
"gin-web/models"
"gin-web/pkg/cache_service"
"gin-web/pkg/global"
"gin-web/pkg/request"
"gin-web/pkg/response"
"gin-web/pkg/utils"
"github.com/casbin/casbin/v2/util"
"github.com/gin-gonic/gin"
"github.com/patrickmn/go-cache"
"io/ioutil"
"mime/... |
// Copyright 2013 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 ingore
// Package goobj implements reading of Go object files and archives.
//
// TODO(rsc): Decide where this package should live. (golang.org/issue... |
package downloaders
import (
"context"
"errors"
"github.com/cheggaaa/pb/v3"
"github.com/op/go-logging"
"golang.org/x/sync/errgroup"
"io"
"io/fs"
"io/ioutil"
"os"
"path"
"path/filepath"
"time"
)
type FilesystemDownload struct {
Readpath string
Writepath string
Workers uint
Threads uint
Pa... |
/*
setup.go
Description:
This script is designed to help setup the gurobi.go dependency which is needed to run goop.
*/
package main
import (
"fmt"
"io"
"log"
"os"
"os/exec"
"strings"
versionTool "github.com/hashicorp/go-version"
)
// Type Definitions
type SetupInfo struct {
InitialDirectory string
Gurob... |
// Copyright (c) 2018 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 src
import (
"errors"
"fmt"
"github.com/spf13/viper"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"os"
"strconv"
"strings"
. "sslt/src/data"
. "sslt/src/log"
"time"
)
var (
err error
db *gorm.DB
sqliteMaster SqliteMaster
certs Certs
)
type Certs struct {
ID uin... |
package main
import (
"bufio"
"bytes"
"errors"
"flag"
"fmt"
"log"
"os"
"os/exec"
"strconv"
"strings"
"time"
)
var version = "0.1.1-untracked-dev"
var displaysFound []display
func main() {
if ds, err := fetchDisplays(); err == nil {
displaysFound = ds
} else {
log.Fatal("unable to gather screen infor... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
package api
import (
"archive/zip"
"fmt"
"io"
"net/http"
"os"
"path"
"path/filepath"
"time"
"github.com/photoprism/photoprism/internal/acl"
"github.com/photoprism/photoprism/internal/form"
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/query"
"github.com... |
/*
Copyright © 2020 Dell Inc. or its subsidiaries. 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 ... |
package main
import (
"encoding/csv"
"encoding/json"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
)
const inputDir = "../source/data"
const ooutputDir = "./out"
type SubChapterItem struct {
ID int `json:"id"`
Title string `json:"title"`
Page int `json:"page"`
Begin int `json:"begin"... |
// Copyright 2022 The MaxMQ Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
package rd
import (
"mime"
"mime/multipart"
"net/http"
r "reflect"
"strings"
"sync"
"unsafe"
)
var (
typeBytes = r.TypeOf((*[]byte)(nil)).Elem()
)
func try(err error) {
if err != nil {
panic(err)
}
}
func isReqReadOnly(req *http.Request) bool {
switch req.Method {
case http.MethodGet, http.MethodHead,... |
package groups
import (
"context"
"errors"
"fmt"
"io/ioutil"
"regexp"
"strings"
"go.uber.org/zap"
"golang.org/x/oauth2/google"
admin "google.golang.org/api/admin/directory/v1"
"google.golang.org/api/option"
)
// GroupTree is the service that deals with google groups
type GroupTree struct {
svc *admin.S... |
// Copyright 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 agreed... |
// Copyright © 2019 The OpenEBS 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 weibo implements the OAuth2 protocol for authenticating users through Weibo.
// This package can be used as a reference implementation of an OAuth2 provider for Goth.
package weibo
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
oauth2c "github.com/coscms/oaut... |
package dependency
import (
"net"
"time"
)
// FlagSet is an interface that
type FlagSet interface {
FullFlagSet
ShorthandFlagSet
}
// FullFlagSet is the interface for defining full flags
type FullFlagSet interface {
Uint(name string, value uint, usage string) *uint
Int16(name string, value int16, usage string)... |
// Copyright 2015 CoreOS, 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 (c) 2021 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package devicenetwork
import (
"errors"
"fmt"
"net"
"syscall"
"github.com/lf-edge/eve/pkg/pillar/base"
"github.com/lf-edge/eve/pkg/pillar/types"
)
// This structure contains name of interface and it's corresponding mac address, IP and s... |
// oscalkit - OSCAL conversion utility
// Written in 2017 by <NAME> <<EMAIL>>
// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
// You should have ... |
package main
import (
"bufio"
"bytes"
"errors"
"flag"
"fmt"
"os"
"regexp"
"strconv"
"strings"
"time"
"golang.org/x/tools/benchmark/parse"
)
var noPassthrough = flag.Bool("no-passthrough", false, "Don't print non-benchmark lines")
type BenchOutputGroup struct {
Lines []*parse.Benchmark
// Columns which ... |
package debuggers
import (
"flag"
"net/url"
"os"
"path"
"time"
log "github.com/Sirupsen/logrus"
"github.com/davecgh/go-spew/spew"
"github.com/solo-io/squash/pkg/client"
"github.com/solo-io/squash/pkg/client/debugattachment"
"github.com/solo-io/squash/pkg/models"
"github.com/solo-io/squash/pkg/platforms"
)
... |
package main
import (
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
)
type RuleBounds struct {
low int
high int
}
func (rb *RuleBounds) validate(value int) bool {
return rb.low <= value && value <= rb.high
}
type TicketRule struct {
name string
ruleBounds []RuleBounds
}
func (tr *TicketRule) validat... |
package playbulb
import (
"errors"
"fmt"
"strings"
"time"
"github.com/bettercap/gatt"
"github.com/bettercap/gatt/examples/option"
)
const (
candleServiceUUID = "ff02"
effectCharUUID = "fffb"
colourCharUUID = "fffc"
toggleCharUUID = "2a37"
)
type Candle interface {
Connect() error
Disconnect()
... |
// Copyright © 2020 Techassi
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Package router provides the top-level router
package router
import (
"context"
"fmt"
"chapper.dev/server/internal/config"
"chapper.dev/server/internal/log"
"chapper.dev/server/... |
package network
import (
"bufio"
"errors"
"fmt"
"gopkg.in/yaml.v2"
"io/ioutil"
"net"
"os"
"path"
"strings"
"text/template"
)
// Config represents a list of network
type Config struct {
Networks []Network `yaml:"networks"`
}
// Network represents a network information
type Network struct {
Name string ... |
/* Copyright (c) 2016-2017 - CloudPerceptions, LLC. 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... |
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"os"
"os/exec"
"sync"
"syscall"
"testing"
"time"
)
// Test that CopyPipeToChildLog works even on lines longer than
// bufio.MaxScanTokenSize.
func TestCopyPipeToChildLogLongLines(t *testing.T) {
logger, logBuf := bufLogger()
... |
/*
Copyright 2021 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, ... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package hostnameview
import (
"crypto/rand"
"fmt"
"strings"
"microsoft.com/pkggen/imagegen/attendedinstaller/primitives/navigationbar"
"microsoft.com/pkggen/imagegen/attendedinstaller/uitext"
"microsoft.com/pkggen/imagegen/attendedinsta... |
package git
// github.com/src-d/go-git
import (
"encoding/hex"
"fmt"
"io/ioutil"
"os"
"path"
"sync"
"golang.org/x/crypto/ssh"
gogit "gopkg.in/src-d/go-git.v4"
gogitConfig "gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
ssh2 "gopkg.in/src... |
package webhookhandler
import (
"context"
"io/ioutil"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
admissionv1 "k8s.io/api/admission/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/run... |
package fs
import (
"context"
"encoding/hex"
"errors"
"fmt"
"github.com/golangee/repository/iter"
"io"
"io/fs"
"reflect"
"strings"
"sync"
)
var InvalidFilename = errors.New("invalid file name")
var byteType = reflect.TypeOf(byte(0))
const (
MAX_PATH = 4096 - 1 // default linux limit excluding nul terminat... |
// go_sys_meminfo.go
package sys_mon
// #include "sys_meminfo.h"
import "C"
// Close: Freeing 'C' structure.
func (s *Meminfo) Close() {
if s.meminfo != nil {
C.meminfo_free(s.meminfo)
}
}
// MeminfoNew: Create and initialise 'C' structure.
func MeminfoNew() (*Meminfo, error) {
c := C.meminfo_get()
if c == ni... |
// Copyright 2020 - See NOTICE file for copyright holders.
//
// 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... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"entgo.io/ent/dialect/sql"
"github.com/masseelch/elk/internal/integration/pets/ent/pet"
"github.com/masseelch/elk/internal/integration/pets/ent/toy"
)
// Toy is the model entity for the Toy schema.
type Toy struct {
config `json:"-"`... |
package container
import (
"time"
)
type (
lru_element struct {
prev *lru_element
next *lru_element
v LruValue
}
LruValue struct {
size int64
ts time.Time
key interface{}
val interface{}
}
// Lru is "least recently used" container, which allows to control the
// element by size, time of ... |
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obta... |
package git
import (
"context"
"reflect"
"testing"
"time"
"github.com/sourcegraph/sourcegraph/internal/actor"
"github.com/sourcegraph/sourcegraph/internal/api"
"github.com/sourcegraph/sourcegraph/internal/authz"
"github.com/sourcegraph/sourcegraph/internal/gitserver/gitdomain"
)
func TestRepository_BlameFile... |
// Copyright 2021 <NAME> (<EMAIL>). All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Run: ./floki-proxy -failure-rate=10 -fail-with-prefix="/small3/aaa"
package main
import (
"context"
"crypto/rand"
"encoding/binary"
"flag"
"fmt"
mathrand ... |
/*
* Copyright (c) 2019 <NAME>
*
* This file is part of http-ece, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
package httpece
import (
"crypto/aes"
"crypto/cipher"
"crypto/elliptic"
"crypto/rand"
"errors"
"fmt"
"golang.org/x/crypto/hkdf"
)
type key []byte
type publicKey []byte
type... |
/*
Copyright 2014 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, ... |
// Copyright 2017 Baidu, 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... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
package request
import (
"context"
"fmt"
"regexp"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/tools/generator/cmd/issue/link"
"github.com/Azure/a... |
package main
import (
"time"
"github.com/go-kit/kit/log/level"
"fmt"
"sort"
"math"
"sync"
)
type HotspotData struct {
Symbol string `json:"Symbol"`
HotRank int `json:"HotRank"`
HighLowRatio float64 `json:"HighLowRatio"`
VolumeRatio float64 `json:"VolumeRatio"`
CloseOpenRatio ... |
package dnstrace
import (
"context"
"encoding/base64"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/coredns/coredns/plugin/test"
"github.com/miekg/dns"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
const (
udp = "udp"
tcp = "tcp"
get = "... |
package netup
import (
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path/filepath"
"regexp"
"time"
"github.com/koron/go-arch"
"github.com/koron/go-github"
)
var (
errSourceNotModified = errors.New("source not modified")
errGithubNoRelease = errors.New("absence of github release")
errGithubNoAs... |
// Code generated by go-swagger; DO NOT EDIT.
package v1operation
// 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.... |
package elasticapm
import (
"fmt"
"math/rand"
"os"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
)
const (
envFlushInterval = "ELASTIC_APM_FLUSH_INTERVAL"
envMetricsInterval = "ELASTIC_APM_METRICS_INTERVAL"
envMaxQueueSize = "ELASTIC_APM_MAX... |
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/caict-benchmark/BDC-TS/bulk_data_gen/common"
)
// program options
var (
scene string
filePath string
)
var sceneChoice = []string{"realtime", "history"}
// TimeSlice is the wrapper of the tim... |
package route
import (
"context"
"net/http"
"github.com/evergreen-ci/evergreen/model/patch"
"github.com/evergreen-ci/evergreen/rest"
"github.com/evergreen-ci/evergreen/rest/data"
"github.com/google/go-github/github"
"github.com/mongodb/amboy"
"github.com/mongodb/grip"
"github.com/mongodb/grip/message"
)
con... |
package endpoints
import (
"fmt"
"github.com/nortonlifelock/domain"
"github.com/pkg/errors"
"net/http"
)
func (except *Exception) update(user domain.User, permission domain.Permission, originalBody string) (generalResp *GeneralResp, status int, err error) {
generalResp = &GeneralResp{}
status = http.StatusBadRe... |
package steps
import (
"bytes"
"github.com/bitflow-stream/go-bitflow/bitflow"
"github.com/bitflow-stream/go-bitflow/script/reg"
)
type ExpressionProcessor struct {
bitflow.NoopProcessor
Filter bool
checker bitflow.HeaderChecker
expressions []*Expression
}
func RegisterExpression(b reg.ProcessorRegistry)... |
package handler
import (
"errors"
"os"
"sync"
"github.com/cloudfoundry-incubator/delta_force/delta_force"
Bbs "github.com/cloudfoundry-incubator/runtime-schema/bbs"
"github.com/cloudfoundry-incubator/runtime-schema/models"
"github.com/nu7hatch/gouuid"
"github.com/pivotal-golang/lager"
)
var ErrNoHealthCheckD... |
package spotfeed
import (
"context"
"fmt"
"sort"
"time"
)
// ErrMissingData is the error returned if there is no data for the query time period.
var ErrMissingData = fmt.Errorf("missing data")
// Period is a time period with a start and end time.
type Period struct {
Start, End time.Time
}
type Cost struct {
... |
// Copyright (c) 2021 Terminus, 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 agree... |
package okta
import "time"
/*
{
"id": "00ub0oNGTSWTBKOLGLNR",
"status": "ACTIVE",
"created": "2013-06-24T16:39:18.000Z",
"activated": "2013-06-24T16:39:19.000Z",
"statusChanged": "2013-06-24T16:39:19.000Z",
"lastLogin": "2013-06-24T17:39:19.000Z",
"lastUpdated": "2013-06-27T16:35:28.000Z",
"passwordCh... |
// Copyright (c) 2018, The GoKi 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 gist
import (
"fmt"
"image"
"image/color"
"github.com/goki/ki/kit"
"github.com/goki/mat32"
"github.com/srwiley/rasterx"
)
// Color defi... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: resource.proto
package octraceprotobuf
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... |
// Package desim allows one to quickly create actor-based discrete event simulations.
package desim
import (
"log"
"math/rand"
"sync"
"time"
"github.com/aybabtme/desim/pkg/gen"
)
type SchedulerFn func(actorCount int, res []Resource) (Scheduler, SchedulerClient)
type Simulation interface {
Run([]*Actor, []Reso... |
/*******************************************************************************
*
* Copyright 2021 SAP SE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You should have received a copy of the License along with this
* program. If... |
// 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 core
import (
"bytes"
"errors"
"fmt"
"io"
"math"
"os"
"path/filepath"
"strings"
"github.com/pole-group/lraft/entity"
"github.com/pole-group... |
package randomization
import (
"fmt"
"html/template"
"net/http"
"strings"
"golang.org/x/net/context"
"google.golang.org/appengine"
"google.golang.org/appengine/datastore"
"google.golang.org/appengine/log"
"google.golang.org/appengine/user"
)
var tmpl = template.Must(template.ParseGlob("html_templates/*.htm... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20160901preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Appliance struct {
pulumi.C... |
package middleware
import (
"encoding/base64"
"encoding/binary"
"fmt"
"go-eladmin/common"
"go-eladmin/log_writer"
"go-eladmin/model"
"net/http"
"strings"
"time"
log "github.com/flywithbug/log4go"
"github.com/gin-gonic/gin"
)
//对照表 rid id m c l p
// xReqId userId method statusCode latency path... |
package bc
import (
"context"
"fmt"
"math/big"
"os"
"path"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/regnull/eas... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016 Datadog, Inc.
package grpcsec
import (
"encoding/json"
"fmt"
"net"
"testing"
"github.com... |
package main
import (
"fmt"
"image/color"
"github.com/hajimehoshi/ebiten/v2"
)
var (
// Zoom controls the zoom amount
Zoom = 8
// WindowWidth is the width of the window
WindowWidth = 500
// WindowHeight is the height of the window
WindowHeight = 500
// BoxWidth is the width of the underlying array of par... |
package consumer
import (
"errors"
"fmt"
"github.com/sonasingh46/producer-consumer/pkg/random"
"github.com/sonasingh46/producer-consumer/producer"
"github.com/sonasingh46/producer-consumer/widget"
"sync"
"time"
)
// Consumer is the interface that wraps the Consumer methods.
type Consumer interface {
Consume(w... |
package main
import (
"reflect"
"testing"
"time"
"github.com/prometheus/client_golang/prometheus"
)
type testpairResult struct {
input string
value float64
labels map[string]string
}
var testsResult = []testpairResult{
{"1|label1=value1", 1, map[string]string{"label1": "value1"}},
{"1|label1=value1,label... |
package mux
import (
"errors"
"net/http"
"strings"
)
// variableInfo contains the information about the variable
// that is extracted from the route
type variableInfo struct {
name, route, kind string
}
// containsRoute performs a simple check on if the route is
// already registered in the multiplexer. This is ... |
package bytespool
import (
"math"
"math/bits"
"reflect"
"runtime"
"sync"
"unsafe"
)
const (
minCapacity = 2
defaultMinSize = 2
defaultMaxSize = 8 << 20 // 8 MiB
)
var defaultCapacityPools = NewCapacityPools(defaultMinSize, defaultMaxSize)
type CapacityPools struct {
minSize int
maxSize int
maxIndex... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
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 (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicen... |
package solsha3
import (
"encoding/hex"
"fmt"
"reflect"
"regexp"
"strconv"
"strings"
"github.com/ethereum/go-ethereum/common"
)
var zeros = "0000000000000000000000000000000000000000000000000000000000000000"
func concatByteSlices(arrays ...[]byte) []byte {
var result []byte
for _, b := range arrays {
res... |
// Copyright (c) 2019 Perlin
//
// 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, distri... |
// Copyright © 2020 wego 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 ... |
package ql
import (
_ "encoding/json"
"fmt"
"log"
_ "math/rand"
// "path/filepath"
_ "strconv"
// "github.com/fatih/structs"
//"github.com/mitchellh/mapstructure"
_ "os"
// "database/sql"
qlBase "github.com/cznic/ql"
_ "github.com/cznic/ql/driver"
"upper.io/db.v3/lib/sqlbuilder"
"upper.io/db.v3/ql"
... |
package notifyme
import (
"fmt"
"github.com/ahirata/notifyme/internal/pkg/store"
"github.com/ahirata/notifyme/internal/pkg/ui"
"github.com/ahirata/notifyme/pkg/notifyme/schema"
"github.com/godbus/dbus"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
"sync/atomic"
"time"
)
// Server ...
type Server... |
/*
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, ... |
/* Light wieght server that handles starting and stopping
ccn nodes on remote machines.
*/
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"sync"
)
const (
debugFlag = "-v"
debugLevel = "trace"
lCacheFlag = "-d"
lCachePath = "/home/todd/dist-ccn/test/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.