text stringlengths 3.08k 10.4k |
|---|
package rest
import (
"log"
"mime"
"net/http"
"os"
"strings"
)
// ResourceHandler implements the http.Handler interface and acts a router for the defined Routes.
// The defaults are intended to be developemnt friendly, for production you may want
// to turn on gzip and disable the JSON indentation for instance.
... |
package cluster
import (
"context"
"fmt"
"github.com/fabric8-services/fabric8-common/log"
"github.com/fabric8-services/fabric8-tenant/auth"
authclient "github.com/fabric8-services/fabric8-tenant/auth/client"
"github.com/pkg/errors"
"io/ioutil"
"strings"
"sync"
"time"
)
// Cluster a cluster
type Cluster stru... |
package main
import (
"bufio"
"context"
"crypto/ed25519"
"crypto/rand"
"encoding/base64"
"encoding/pem"
"errors"
"flag"
"fmt"
"os"
"os/exec"
"strings"
"time"
gossh "golang.org/x/crypto/ssh"
"github.com/mikesmitty/edkey"
"github.com/gliderlabs/ssh"
)
// TODO: copy host key to clipboard?
func main()... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package clouddirectory
import (
"context"
"fmt"
"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"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cl... |
/*
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, ... |
// Copyright 2020 Northern.tech AS
//
// 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 ... |
// Copyright 2020 Netflix Inc
// Author: <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 app... |
// Copyright 2015 The Gorilla WebSocket 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 main
import (
"encoding/json"
"flag"
"fmt"
"html/template"
"log"
"math"
"net/http"
"os"
"strconv"
"time"
"github.com/gorilla... |
package resources
import (
"errors"
"finala/collector"
"finala/collector/aws/common"
"finala/collector/aws/register"
"finala/collector/config"
"finala/expression"
"time"
awsClient "github.com/aws/aws-sdk-go/aws"
awsCloudwatch "github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/... |
package pho
import (
"fmt"
"net/http"
"strings"
"sync"
"github.com/gorilla/websocket"
)
// Sockets is the list of all sockets
type WebSockets map[string]ResponseWriter
// Mux is a simple WebSocket route multiplexer
//
// Mux is designed to be fast, minimal and offer a powerful API for building
// modular and c... |
package commands
import (
"bytes"
"encoding/csv"
"flag"
"fmt"
"os"
"text/template"
"time"
"github.com/uhppoted/uhppote-core/types"
"github.com/uhppoted/uhppoted-lib/config"
)
var GetTimeProfilesCmd = GetTimeProfiles{
template: `
-------------------------------------------
TIME PROFILES {{.DeviceID}} {{.Tim... |
package skimo
import (
"bufio"
"errors"
"fmt"
"io"
"os"
"path"
"regexp"
"strings"
)
var IncludeRegex = regexp.MustCompile("#include\\s+\"(?P<path>.*?)\"")
var IncludeRegexStd = regexp.MustCompile("#include\\s+<(.+)>")
type ReaderProvider interface {
GetReader(string) (io.Reader, error)
}
type DefaultReaderP... |
package model
import (
"context"
"fmt"
"strings"
"gxt-park-assets/internal/app/errors"
"gxt-park-assets/internal/app/model/impl/gorm/internal/entity"
"gxt-park-assets/internal/app/schema"
"github.com/jinzhu/gorm"
)
// NewProjCostItem 创建项目成本项存储实例
func NewProjCostItem(db *gorm.DB) *ProjCostItem {
return &Proj... |
/*
* Copyright 2022 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 writ... |
package grouped
import (
"context"
"errors"
)
// ErrFuncs helps starting and waiting for a group of error-returning functions.
type ErrFuncs struct {
// Sets cancellation context for any functions added after this is set.
// If a function has a context set, the function result is ignored if
// the context is don... |
package main
import (
"context"
"errors"
"fmt"
"io"
"os"
"runtime"
"strconv"
"github.com/Merith-TK/gosh/api"
)
// helpCmd represents the `help` command
// which prints out help information about other commands
type helpCmd string
func (h helpCmd) Name() string { return string(h) }
func (h helpCmd) Usage... |
package ethbase
import (
"bytes"
"context"
"log"
types "github.com/ethereum/go-ethereum/core/types"
crypto "github.com/ethereum/go-ethereum/crypto"
ethclient "github.com/ethereum/go-ethereum/ethclient"
ethdb "github.com/ethereum/go-ethereum/ethdb"
rlp "github.com/ethereum/go-ethereum/rlp"
trie "github.com/et... |
package cpu
import (
"github.com/moshenahmias/gopherboy/memory"
"fmt"
"time"
)
// Frequency of the cpu cycles per seconds
const Frequency int = 4194304
func noSuchInstructionError(opcode byte) error {
return fmt.Errorf("No such instruction %02x", opcode)
}
// TimedUnit is a cpu cycles observer
type TimedUnit i... |
package statistics
import (
"math"
"sync"
"time"
"github.com/matrix-org/dendrite/federationsender/storage"
"github.com/matrix-org/gomatrixserverlib"
"github.com/sirupsen/logrus"
"go.uber.org/atomic"
)
// Statistics contains information about all of the remote federated
// hosts that we have interacted with. I... |
/*
Copyright © 2020 tczekajlo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package main
import (
"fmt"
"net"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/miekg/dns"
)
const (
// defaultTTL specifies the time in seconds a response can be cached.
defaultTTL uint32 = 5
// defaultInvalidTTL specifies the time in seconds a NXDOMAIN response for
// a question format not su... |
// Package tagset implements tagset mappings to Universal Part-of-Speech Tagset
// REF: https://arxiv.org/abs/1104.2086
// REF: http://petrovi.de/data/universal.pdf
package tagset
// Penn Treebank Project - EN, consolidated among multiple sources
// REF: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treeba... |
/*
Copyright © 2014–5 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... |
package server
import (
"time"
)
import (
"bytes"
"io"
"log"
"mime"
"net/http"
"regexp"
"github.com/emicklei/go-restful"
"github.com/emicklei/go-restful/swagger"
"github.com/thesyncim/at/msg"
"path/filepath"
"strings"
)
type NodeService struct {
Url string
Req msg.ReqTunnel
}
// +gen *
type Node str... |
// Copyright (c) 2019-2020 Latona. All rights reserved.
package k8s
import (
"context"
"fmt"
"time"
"bitbucket.org/latonaio/aion-core/config"
"bitbucket.org/latonaio/aion-core/pkg/log"
"github.com/avast/retry-go"
apiV1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/p... |
// Copyright The Shipwright Contributors
//
// SPDX-License-Identifier: Apache-2.0
package buildrunttlcleanup
import (
"context"
buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/config"
"github.com/shipwright-io/build/pkg/ctxlog"
corev1 "k8s.io/api/core/... |
package keycredential
import (
"fmt"
"strings"
"time"
"github.com/google/uuid"
v1 "github.com/nais/liberator/pkg/apis/nais.io/v1"
"github.com/nais/msgraph.go/ptr"
msgraph "github.com/nais/msgraph.go/v1.0"
"github.com/nais/azureator/pkg/azure"
"github.com/nais/azureator/pkg/azure/credentials"
"github.com/na... |
package main
import (
"BloomCredit/db"
"bufio"
"errors"
"fmt"
"log"
"os"
"strconv"
"strings"
"sync"
"time"
)
type column struct {
start int
end int
}
type worker struct {
sentence string
columns []column
}
type syncedArray struct {
parseArray [][]interface{}
syc sync.Mutex
counter int
}
... |
package goldentest
/* Copyright 2020 The Bazel 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 appli... |
package specs
import (
"testing"
"github.com/go-rel/rel"
"github.com/go-rel/rel/sort"
"github.com/go-rel/rel/where"
"github.com/stretchr/testify/assert"
)
// Query tests query specifications without join.
func Query(t *testing.T, repo rel.Repository) {
// preparte tests data
var (
user = User{Name: "name1",... |
package v0_15
import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// ModuleName The name that will be used throughout the module
ModuleName = "incentive"
)
// GenesisState is the state that must be provided at genesis.
type GenesisState struct {
Params Params `json:"params" yaml:"params"`
USDX... |
package main
import (
"image"
"image/color"
"image/draw"
)
var (
pw = 60
ph = 60
wh = 20 * 3
lw = 40
radius = 10
background = color.RGBA{170, 170, 255, 255}
dracula = color.RGBA{40, 42, 54, 255}
close = color.RGBA{255, 95, 86, 255}
minimum = color.RGBA{255, 189, 46, 255}
maximum = color.RGBA{39, ... |
// Copyright 2018 ProximaX Limited. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package sdk
import (
"github.com/json-iterator/go"
"github.com/proximax-storage/proximax-utils-go/str"
"math/big"
"strings"
"unsafe"
)
// NamespaceI... |
package raft
import (
"errors"
"time"
)
var (
errTimeout = errors.New("timeout")
)
// Peer is the local representation of a remote node. It's an interface that may
// be backed by any concrete transport: local, HTTP, net/rpc, etc. Peers must be
// encoding/gob encodable.
type Peer interface {
// 获取 Server 标识接口
... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
)
var challengeDotGovUrl = "https://www.challenge.gov/"
type challenge struct {
Name string `json:"name"`
Agency string `json:"age... |
package argo
import (
"context"
"encoding/json"
"time"
"capact.io/capact/pkg/engine/k8s/policy"
hubpublicapi "capact.io/capact/pkg/hub/api/graphql/public"
hubclient "capact.io/capact/pkg/hub/client"
"capact.io/capact/pkg/sdk/apis/0.0.1/types"
"capact.io/capact/pkg/sdk/renderer"
"github.com/pkg/errors"
)
c... |
//<developer>
// <name><NAME></name>
// <email><EMAIL></email>
// <wx>superexc</wx>
// <qqgroup>128148617</qqgroup>
// <url>https://jsq.ink</url>
// <role>pku engineer</role>
// <date>2019-03-16 20:02:48</date>
//</624461712388526080>
//版权所有(c)2016 BTCSuite开发者
//此源代码的使用由ISC控制
//可以在许可文件中找到的许可证。
p... |
package tui
import (
"context"
"fmt"
"log"
"time"
"github.com/charmbracelet/bubbles/progress"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/noborus/pgsp"
)
var (
UpdateInterval time.Duration
AfterCompletion time.Duration
RightMargin int = 10
MinimumTa... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package updatecmd
import (
"errors"
"io"
"testing"
"github.com/hyperledger/fabric-cli/pkg/environment"
"github.com/hyperledger/fabric-cli/pkg/fabric"
"github.com/hyperledger/fabric-sdk-go/pkg/client/channel"
... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package storage
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Deprecated: ZipBlob res... |
// Copyright 2009 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.
package strconv_test
import (
"os";
. "strconv";
"testing";
)
type quoteTest struct {
in string;
out string;
}
var quotetests = []quoteTest{
quoteTest{... |
package objects
import (
"fmt"
"github.com/bulutistan/go-sophos/sophos"
)
// Cron is a generated struct representing the Sophos Cron Endpoint
// GET /api/nodes/cron
type Cron struct {
CronAt CronAt `json:"cron_at"`
CronGroup CronGroup `json:"cron_group"`
}
var _ sophos.Endpoint = &Cron{}
var defsCron = m... |
// +build !enterprise
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: physical/types.proto
package physical
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 _ =... |
package review
import (
"strconv"
"strings"
"github.com/PuerkitoBio/goquery"
"github.com/rl404/go-malscraper/pkg/malscraper/config"
"github.com/rl404/go-malscraper/pkg/malscraper/constant"
"github.com/rl404/go-malscraper/pkg/malscraper/model/common"
model "github.com/rl404/go-malscraper/pkg/malscraper/model/re... |
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ssm"
"github.com/aws/aws-sdk-go/service/ssm/ssmiface... |
// Copyright 2021 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
// Copyright © 2018 Circonus, Inc. <<EMAIL>>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package generic
import (
"fmt"
"regexp"
"strings"
"time"
"github.com/circonus-labs/circonus-agent/internal/builtins/collector"
"github.com/circonus-labs/circon... |
package fleprocess
/*
Copyright © 2020 <NAME>, ON4KJM <<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... |
package mat
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestSplitPerfectCube(t *testing.T) {
box := NewBoundingBoxF(-1, -4, -5, 9, 6, 5)
left, right := SplitBounds(box)
assert.Equal(t, NewPoint(-1, -4, -5), left.Min)
assert.Equal(t, NewPoint(4, 6, 5), left.Max)
assert.Equal(t, NewPoint(4, -... |
package infra
import (
"context"
"errors"
"fmt"
"io"
"strings"
"google.golang.org/api/compute/v1"
"google.golang.org/api/dns/v1"
"github.com/orijtech/frontender"
"github.com/odeke-em/go-uuid"
)
// Goals:
// 1. Lookup already created domain with zone
// a) Zone Name
// b) ZoneID
//
// 2. If proxy ser... |
package restic
import (
"encoding/json"
"fmt"
"math"
)
// Message should match any restic message
type Message struct {
Type string `json:"message_type"`
Body string
}
// StatusMessage should match status messages from restic
// which are emitted during backup
type StatusMessage struct {
PercentDone float... |
package main
import (
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"os"
"reflect"
"sort"
"sync"
"testing"
"time"
"github.com/ChronixDB/chronix.go/chronix"
"github.com/ChronixDB/chronix.ingester/ingester"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/config"
"github.com/promet... |
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package issues
import (
"fmt"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gite... |
// Copyright (c) 2017-2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package websockets
import (
"encoding/hex"
"fmt"
"net/http"
"sync"
"time"
"github.com/davecgh/go-spew/spew"
"github.com/decred/politeia/util"
"github.com/gorilla... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License... |
// +build unstable
package allegro
// #include <allegro5/allegro.h>
import "C"
// Sets the depthbuffer depth used by newly created bitmaps (on the current
// thread) if they are used with al_set_target_bitmap. 0 means no depth-buffer
// will be created when drawing into the bitmap, which is the default.
//
// See ht... |
// Copyright (C) 2019 <NAME>, Inc.
// See LICENSE for copying information.
package tlsopts
import (
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"io/ioutil"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"storj.io/common/identity"
"storj.io/common/peertls"
"storj.io/common/peertls/extensions... |
/*
Copyright (c) 2013-2016 the Godepq Authors
Use of this source code is governed by a MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
package deps
import (
"errors"
"fmt"
"go/build"
"os"
"regexp"
"strings"
)
type Dependencies struct {
// Map of package -... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package applicationinsights
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListProblemsInput struct {
_ struct{} `type:"structure"`
// The time when the problem ended, in ... |
package waffleiron
import (
"github.com/pkg/errors"
"github.com/hashicorp/go-multierror"
)
// And returns a parser that runs p0 and then runs p1
func And[T, U any](p0 Parser[T], p1 Parser[U]) Parser[Tuple2[T, U]] {
return Parser[Tuple2[T, U]]{p: andParser[T, U]{p0, p1}}
}
type andParser[T, U any] struct {
p0 Pa... |
// ***************************************************************************
//
// Copyright 2017 <NAME>) Smith, <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
//
// ... |
/*
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 agreed to in writing, sof... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License i... |
package deprecated
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin"
"github.com/iver-wharf/wharf-api/pkg/model/database"
"github.com/iver-wharf/wharf-api/pkg/model/request"
"github.com/iver-wharf/wharf-api/pkg/modelconv"
"github.com/iver-wharf/wharf-core/pkg/ginutil"
"github.com/iver-wharf/wharf-core/pkg/... |
// Copyright (c) 2018 Uber Technologies, Inc.
//
// 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... |
package main
import (
"encoding/json"
"fmt"
"github.com/ViaQ/cluster-logging-load-client/loadclient"
"github.com/mitchellh/go-homedir"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"math/rand"
"os"
"strings"
"time"
)
var opt = loadclient.Option... |
package main
import (
"context"
"crypto/tls"
"errors"
"fmt"
"net"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"github.com/sonr-io/webauthn.io/config"
"github.com/sonr-io/webauthn.io/controller"
db "github.com/sonr-io/webauthn.io/database"
"github.com/sonr-io/webauthn.io/logger"
log "github.com/sonr-... |
// Copyright 2018 The Containerfs 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 2014 Apcera, Inc. All rights reserved.
package s3util
import (
"bytes"
"crypto/md5"
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"time"
"github.com/apcera/util/hmac"
)
const (
// S3_URL is the URL that S3 is located at.
S3_URL = "s3... |
package curator
import (
"errors"
"path"
"sync"
"sync/atomic"
"github.com/samuel/go-zookeeper/zk"
)
type ChildrenCacheEvent struct {
ChildNode string
Data []byte
Stat *zk.Stat
Type ChildrenCacheEventType
}
type ChildrenCacheEventType int
const (
ChildrenCacheAdd ChildrenCacheEventType =... |
package gogm
import (
"strconv"
)
type nodeQueryBuilder struct {
n *node
registry *registry
deltaProperties map[string]interface{}
isLabelsDirty bool
removedRelationships map[int64]graph
removedRelationshipsOtherNodes ... |
package spot
import (
"encoding/json"
gfnt "github.com/weaveworks/goformation/v4/cloudformation/types"
)
type (
Resource struct {
ResourceCredentials
ServiceToken *gfnt.Value `json:"ServiceToken,omitempty"`
FeatureFlags *gfnt.Value `json:"featureFlags,omitempty"`
Parameters ResourceParame... |
/*
Copyright The Kubepack 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, softwar... |
package broadcast
import (
"context"
"sync"
"chainspace.io/chainspace-go/blockmania"
"chainspace.io/chainspace-go/internal/log"
"chainspace.io/chainspace-go/internal/log/fld"
)
type blockData struct {
deps []blockmania.BlockID
id blockmania.BlockID
prev blockmania.BlockID
ref *SignedData
}
type depgraph... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/config/filter/listener/http_inspector/v2/http_inspector.proto
package envoy_config_filter_listener_http_inspector_v2
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Referenc... |
package country
import (
"encoding/json"
"errors"
"io/ioutil"
"orderedmap"
"path"
"scraper"
"strings"
"time"
)
var NoPagesForCountryError = errors.New("No pages for country")
var NoPagesForTimeError = errors.New("No pages for this country and time")
var countryCache = map[string]Country{}
type Country struc... |
package main
import (
"encoding/csv"
"fmt"
"io"
"math/rand"
"os"
"strconv"
"strings"
"time"
"github.com/TomOnTime/utfutil"
"golang.org/x/text/encoding/unicode"
)
func readAndRandomDiane(fileName string, outputFileName string, mapping map[string]string) error {
rand.Seed(time.Now().UTC().UnixNano())
encod... |
/*
common is a package that summarizes the common processing of lssh package.
*/
package common
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/user"
"path/filepath"
"reflect"
"strings"
"time"
"golang.org/x/crypto/ssh/terminal"
)
var characterRunes = []rune("abcdefg... |
package proxy
import (
"context"
"math/big"
"myModule/config"
"myModule/model"
"myModule/utils"
"strings"
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/sirupsen/logrus"
)
var client *ethclient.Client
var... |
package asyncui
import (
"fmt"
"github.com/kyma-incubator/hydroform/parallel-install/pkg/components"
"github.com/kyma-incubator/hydroform/parallel-install/pkg/deployment"
"github.com/kyma-project/cli/pkg/step"
)
//End-user messages
const (
deployPrerequisitesPhaseMsg string = "Deploying pre-requisites"
undep... |
// Modified code from golang.org/x/build/cmd/gopherbot. License for gopherbot is
// here:
//
// Copyright 2017 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.
// Package maintainerbot contains tools for running automated tasks... |
/*
Copyright and license information from original project:
Licence: https://github.com/google/trillian/blob/6127136b153156fc6becb74edd21259fe4260ddc/LICENSE
Source: https://github.com/google/trillian/blob/ceda464a95a36e37e16fb361a5e426877c49d450/cmd/trillian_log_signer/main.go
Copyright SecureKey Technologies Inc. A... |
package parser
import (
"context"
"strings"
"sync"
"sync/atomic"
"github.com/cockroachdb/errors"
"github.com/inconshreveable/log15"
"github.com/opentracing/opentracing-go/log"
"github.com/sourcegraph/go-ctags"
"github.com/sourcegraph/sourcegraph/cmd/symbols/internal/fetcher"
"github.com/sourcegraph/source... |
/*
Package rpc implements bridge to Lachesis full node API interface.
We recommend using local IPC for fast and the most efficient inter-process communication between the API server
and an Opera/Lachesis node. Any remote RPC connection will work, but the performance may be significantly degraded
by extra networking ov... |
// Copyright 2015 The Cockroach 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 gumble
import (
"bytes"
"encoding/binary"
"errors"
"io"
"net"
"sync"
"time"
"github.com/golang/protobuf/proto"
"github.com/unascribed/gumble/gumble/MumbleProto"
"github.com/unascribed/gumble/gumble/varint"
)
// Conn represents a connection to a Mumble client/server.
type Conn struct {
sync.Mutex
... |
package commonlib
import (
"errors"
"fmt"
"reflect"
"strconv"
"time"
)
// 使用map填充struct结构体
func FillStruct(data map[string]string, obj interface{}) error {
for k, v := range data {
tagName := GetFieldNameByTagName(obj, k)
if tagName == "" {
continue
}
err := SetField(obj, tagName, v)
if err != nil ... |
package securityservices
import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/pagination"
)
type SecurityServiceType string
// Valid security service types
const (
LDAP SecurityServiceType = "ldap"
Kerberos SecurityServiceType = "kerberos"
ActiveDirect... |
package cmd
// Terragrunt doesn't give us an easy way to access all of the Locals from a module
// in an easy to digest way. This file is mostly just follows along how Terragrunt
// parses the `locals` blocks and evaluates their contents.
import (
"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io... |
package hypergin
import (
"bytes"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
"github.com/hypertrace/goagent/instrumentation/hypertrace/net/hyperhttp"
"github.com/hypertrace/goagent/instrumentation/opentelemetry/internal/tracetesting"
sdkhttp "github.com/hypertrace/goagent... |
// Copyright 2021 Northern.tech AS
//
// 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/json"
"net"
"os/exec"
"path/filepath"
"strconv"
"syscall"
"vimagination.zapto.org/reverseproxy"
)
type servers map[string]*server
func (s servers) Init() {
for name, server := range s {
server.Init(name)
}
}
func (s servers) Shutdown() {
for _, server := range s {
serv... |
package crane
import (
"crypto/md5"
"fmt"
"os"
"runtime"
"strconv"
"strings"
)
type AcceleratedMount interface {
Run()
Reset()
Logs(follow bool)
VolumeArg() string
Volume() string
}
type acceleratedMount struct {
RawVolume string
RawIgnore string `json:"ignore" yaml:"ignore"`
RawFlags []string `j... |
package types
import (
sdk "github.com/hbtc-chain/bhchain/types"
cutypes "github.com/hbtc-chain/bhchain/x/custodianunit/types"
"github.com/satori/go.uuid"
"github.com/stretchr/testify/assert"
"github.com/tendermint/tendermint/crypto/secp256k1"
"testing"
)
var from, _ = sdk.CUAddressFromBase58("HBCTGvSBNT8oEA4xE... |
package main
/*
IMPORT
Imports a CSV file into MongoDB database
*/
import (
"errors"
"fmt"
"os"
"path"
"strings"
"time"
"github.com/smartystreets/scanners/csv"
"github.com/tomekwlod/utils"
"github.com/mongodb/mongo-go-driver/bson"
"github.com/mongodb/mongo-go-driver/mongo"
modelsMongodb "github.com/tom... |
// Code generated by protoc-gen-go.
// source: file.proto
// DO NOT EDIT!
/*
Package file is a generated protocol buffer package.
It is generated from these files:
file.proto
It has these top-level messages:
File
*/
package file
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
... |
package log
import (
"bytes"
"testing"
)
var (
logHits int
exitHits int
)
type hitsFormatter struct{}
func (f *hitsFormatter) Format(level Level, msg string, logger *Logger) []byte {
logHits++
return []byte(msg)
}
func init() {
Default.Formatter = new(hitsFormatter)
Default.Out = new(bytes.Buffer)
Exit ... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
// Copyright 2021 The Chromium OS 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 main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"os/signal"
"path/filepath"
"sysc... |
// Copyright © 2020 Attestant Limited.
// 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.