text stringlengths 3.08k 10.4k |
|---|
//Copyright 2017 Improbable. All Rights Reserved.
// See LICENSE for licensing terms.
package grpcweb
import (
"bytes"
"encoding/base64"
"encoding/binary"
"io"
"net/http"
"strings"
"golang.org/x/net/http2"
"google.golang.org/grpc/grpclog"
)
// grpcWebResponse implements http.ResponseWriter.
type grpcWebResp... |
package kubernetes
import (
"context"
"errors"
"log"
"time"
"github.com/fjogeleit/policy-reporter/pkg/report"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/watch"
)
// Mapper converts maps into report structs
type Mapper interface {
// MapPolicyReport maps a map into a PolicyReport
MapPolicyReport(report... |
/*
* MinIO Go Library for Amazon S3 Compatible Cloud Storage
* Copyright 2015-2017 MinIO, 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/L... |
package caddytls
import (
"os"
"testing"
"github.com/xenolf/lego/acme"
)
func TestHostQualifies(t *testing.T) {
for i, test := range []struct {
host string
expect bool
}{
{"example.com", true},
{"sub.example.com", true},
{"Sub.Example.COM", true},
{"127.0.0.1", false},
{"127.0.1.5", false},
{"... |
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in licenses/BSD-vitess.txt.
// Portions of this file are additionally subject to the following
// license and copyright.
//
// Copyright 2017 The Cockroach Authors.
//
// Licensed unde... |
package model
import (
// "database/sql"
"time"
"fmt"
"github.com/covrom/dingo/app/utils"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)
// Comments are a slice of "Comment"s
type Comments []*Comment
// A Comment defines comment item data.
type Comment struct {
Id bson.ObjectId
Post... |
// 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... |
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package describe
import (
"bytes"
"encoding/json"
"fmt"
"sort"
"text/tabwriter"
"github.com/aws/copilot-cli/internal/pkg/aws/sessions"
"github.com/aws/copilot-cli/internal/pkg/config"
"github.com/aws/c... |
// Code generated by protoc-gen-go.
// source: pkg/jsonpb/testing/testing.proto
// DO NOT EDIT!
package testing
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "go.pedge.io/pb/go/google/protobuf"
// Reference imports to suppress errors if they are not otherw... |
package storage
import (
"fmt"
"os"
"path/filepath"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/chrislusf/seaweedfs/weed/storage/idx"
"github.com/syndtr/goleveldb/leveldb"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed... |
package operator
import (
"strings"
"testing"
"github.com/3scale/3scale-operator/pkg/helper"
"github.com/3scale/3scale-operator/pkg/3scale/amp/component"
appsv1alpha1 "github.com/3scale/3scale-operator/pkg/apis/apps/v1alpha1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apima... |
package it
import (
"strings"
"github.com/GGP1/kure/auth"
cmdutil "github.com/GGP1/kure/commands"
"github.com/spf13/cobra"
bolt "go.etcd.io/bbolt"
)
const example = `
* No arguments
kure it
* Command without flags
kure it ls
* Command with flags
kure it ls -s -q
* Only the name
kure sample`
// NewCmd retur... |
// Copyright 2019-present Open Networking Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
// GENERATED CODE, DO NOT EDIT
package dstream
import (
"fmt"
"io"
"math"
"os"
"strconv"
"time"
)
// Next advances to the next chunk.
func (cs *CSVReader) Next() bool {
if cs.done {
return false
}
if cs.limitchunk > 0 && cs.limitchunk <= cs.chunknum {
cs.done = true
return false
}
cs.chunknum++
... |
package types
// Ping https://api.coingecko.com/api/v3/ping
type Ping struct {
GeckoSays string `json:"gecko_says"`
}
// SimpleSinglePrice https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
type SimpleSinglePrice struct {
ID string
Currency string
MarketPrice float32
}
// Sim... |
/*
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
package config
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"path/filepath"
"reflect"
"strings"
"time"
"github.com/bmeg/grip/elastic"
"github.com/bmeg/grip/mongo"
"github.com/bmeg/grip/server"
"github.com/bmeg/grip/sql"
"github.com/bmeg/grip/util"
"github.com/bmeg/grip/util/rpc"
"github.com/g... |
package vault
import (
"fmt"
"log"
"regexp"
"strings"
"time"
"github.com/99designs/aws-vault/prompt"
"github.com/99designs/keyring"
"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/iam"
)
type Rotator str... |
package booklitcmd
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"path/filepath"
"github.com/sirupsen/logrus"
"github.com/vito/booklit"
"github.com/vito/booklit/baselit"
"github.com/vito/booklit/load"
"github.com/vito/booklit/render"
)
type Command struct {
Version func() `short:"v" long:"version"... |
// Package lexer transforms an input string into a stream of PHP tokens.
package lexer
import (
"fmt"
"regexp"
"strings"
"unicode"
"unicode/utf8"
"github.com/stephens2424/php/token"
)
// Lexer represents the state of "lexing" items from a source string.
// The idea is derived from a Rob Pike talk:
// http://ww... |
package keybindings
import (
"github.com/stuartleeks/gocui"
)
// StrToGocuiKey maps a string representing they key to a gocui key
var StrToGocuiKey = map[string]gocui.Key{
"up": gocui.KeyArrowUp,
"down": gocui.KeyArrowDown,
"left": gocui.KeyArrowLeft,
"right": gocui.KeyArrowRight,
"back... |
/*
Copyright 2015 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... |
/*
Copyright © 2020 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, ... |
package view
import (
"bytes"
"fmt"
"os/exec"
"regexp"
"testing"
"time"
"github.com/profclems/glab/internal/utils"
"github.com/acarl005/stripansi"
"github.com/profclems/glab/commands/cmdtest"
"github.com/profclems/glab/commands/cmdutils"
"github.com/profclems/glab/internal/config"
"github.com/profclems/g... |
// Code generated by go-swagger; DO NOT EDIT.
package t_r_a
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go... |
package types
import (
"fmt"
"time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/venus/venus-shared/actors/builtin"
"g... |
package aap
import (
"errors"
"fmt"
"github.com/neo4j/neo4j-go-driver/neo4j"
"strings"
"time"
)
func stripChars(str, chr string) string {
return strings.Map(func(r rune) rune {
if strings.IndexRune(chr, r) < 0 {
return r
}
return -1
}, str)
}
func CreatePublishes(tx neo4j.Transaction, requestedBy Ide... |
package cmd
import (
"time"
"github.com/fatih/color"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/avinor/tau/pkg/config"
"github.com/avinor/tau/pkg/config/loader"
"github.com/avinor/tau/pkg/getter"
"github.com/avinor/tau/pkg/helpers/paths"
"github.com/avinor/tau/pkg/helpers/ui"
"github.com/... |
package httptracker
import (
"bytes"
"context"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/cenkalti/rain/internal/logger"
"github.com/cenkalti/rain/internal/tracker"
"github.com/zeebo/bencode"
)
// HTTPTracker is a torrent tracker that talks ... |
package project
import (
"fmt"
"net"
"path/filepath"
"strings"
"github.com/rahveiz/topomate/config"
"github.com/rahveiz/topomate/utils"
)
const (
defaultSubnetLength4 = 30
)
type IGPSettings struct {
ISIS struct {
Circuit int
Passive bool
}
OSPFArea int
}
type NetInterface struct {
IfName strin... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package apigatewayv2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/apigatewayv... |
// Copyright 2016 The etcd 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 deployment
import (
"testing"
"k8s.io/apimachinery/pkg/types"
crd "github.com/RedHatInsights/clowder/apis/cloud.redhat.com/v1alpha1"
apps "k8s.io/api/apps/v1"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/api/resource"
)
func defaultMetaObject() met... |
package to_string
import (
"bytes"
"fmt"
)
// 返回ts.String生成的字符串格式化之后的结果, indentSpacesCount指定缩进使用的空格数. 例如: s为:"{slice:[1, 2, 3], m:{1:"string", 2:"var"}}", indentSpacesCount为4, 则格式化后的结果如下:
// {
// slice:[
// 1,
// 2,
// 3
// ],
// m:{
// 1:"string",
// 2:"var"
// ... |
package agent
import (
"context"
"errors"
"log"
"math/rand"
"sort"
"sync"
"time"
"github.com/georgemac/adagio/pkg/adagio"
"github.com/oklog/ulid/v2"
)
var (
// ErrRuntimeDoesNotExist is returned when a node is claimed with an
// unknown runtime type
ErrRuntimeDoesNotExist = errors.New("runtime does not e... |
package octopusdeploy
import (
"bytes"
"encoding/json"
"fmt"
"os"
"reflect"
"regexp"
"strings"
"github.com/dghubble/sling"
)
func isNilFixed(i interface{}) bool {
if i == nil {
return true
}
switch reflect.TypeOf(i).Kind() {
case reflect.Ptr, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice:
r... |
package gocbcore
import (
"fmt"
"github.com/couchbase/gocbcore/v10/connstr"
"strconv"
)
// DCPAgentConfig specifies the configuration options for creation of a DCPAgent.
type DCPAgentConfig struct {
UserAgent string
BucketName string
SeedConfig SeedConfig
SecurityConfig SecurityConfig
CompressionConfig Co... |
package main
import (
"math"
_ "time"
"github.com/faiface/pixel"
"github.com/faiface/pixel/imdraw"
"github.com/faiface/pixel/pixelgl"
)
// Light structure for a light source
type light struct {
bounds *Bounds
color pixel.RGBA
angleSpread float64
angle flo... |
package grafana
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"text/template"
"time"
"github.com/pkg/errors"
"github.com/target/goalert/alert"
"github.com/target/goalert/integrationkey"
"github.com/target/goalert/permission"
"github.com/target/goalert/retry"
"github.com/targe... |
/*
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) 2018 Cisco and/or 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 applicabl... |
/*
Package disk provides an FS that wraps the johnsiilver/fs/os package to be
used for a disk cache that expires files.
Example use:
diskFS, err := disk.New(
"",
disk.WithExpireCheck(5 * time.Second),
disk.WithExpireFiles(10 * time.Second),
)
if err != nil {
// Do something
}
defer os.RemoveAll(diskFS.Loc... |
package webserver
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/textproto"
"net/url"
"os/signal"
"reflect"
"regexp"
"runtime"
"runtime/debug"
"sort"
"strconv"
"strings"
"time"
"github.com/google/uuid"
"github.com/gorilla/mux"
)
// func pointers for injectio... |
// Copyright 2017-2018 New Vector Ltd
// Copyright 2019-2020 The Matrix.org Foundation C.I.C.
//
// 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/LICE... |
package version
import (
"sort"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestInfo_LargerThanOrEqualTo(t *testing.T) {
assertLargerOrEqual(t, "0", "0")
assertLargerOrEqual(t, "0.1", "0.0.1")
assertLargerOrEqual(t, "1", "0")
assertLargerOrEqual(t, "1", "0.9")... |
//
// Copyright (C) 2020 IBM Corporation.
//
// Authors:
// <NAME> <<EMAIL>>
// <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/L... |
package odp
import (
"fmt"
"syscall"
"unsafe"
)
const (
DATAPATH = iota
VPORT = iota
FLOW = iota
PACKET = iota
FAMILY_COUNT = iota
)
var familyNames = [FAMILY_COUNT]string{
"ovs_datapath",
"ovs_vport",
"ovs_flow",
"ovs_packet",
}
type Dpif struct {
sock *NetlinkSocket
fami... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"time"
)
// Describes a principal for use with AWS Resource Access Manager.
type Principal struct {
// The time when the principal was associated with the resource share.
CreationTime *time.Time
// Indicates whether the principal belong... |
// Copyright 2020 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
// +build wasm_sdk_e2e
package e2e
import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"t... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 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 obtain a copy of the Li... |
/*
Copyright (c) 2019 SAP SE or an SAP affiliate company. 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 applic... |
// 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... |
// Copyright 2013 <NAME>. All rights reserved.
// Based on the path package, Copyright 2009 The Go Authors.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
package router
import (
"reflect"
"strings"
"testing"
"github.com/valyala/fasthttp"
)
type cleanPath... |
package c5
import (
"fmt"
"strings"
"time"
ogs "github.com/mabels/object-graph-streamer"
)
const JSISOStringFormat = "2006-01-02T15:04:05.999Z07:00"
type GeneratorProps struct {
SimpleEnvelopeProps *SimpleEnvelopeInternal
Hash *string
T int64
}
type IdGeneratorFn func(Genera... |
package ifreload
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"context"
"fmt"
"time"
"github.com/Azure/go-autorest/autorest/to"
projectv1 "github.com/openshift/api/project/v1"
securityv1 "github.com/openshift/api/security/v1"
securityclient "github.com/openshift/c... |
/*******************************************************************************
* Copyright 2019 Dell 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/licen... |
// Copyright 2021 The Prometheus 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 camera
import (
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
fp "path/filepath"
"strconv"
"strings"
"github.com/sirupsen/logrus"
bolt "go.etcd.io/bbolt"
)
var developmentMode = false
// RaspiCam is controller for Raspberry Pi camera.
// It's used to capture the camera stream and process it.
type RaspiCam... |
package models
import (
"errors"
"net/http"
"net/url"
"path"
"strings"
apiErrors "github.com/go-openapi/errors"
)
const (
defaultRouteTimeout = 30 // seconds
htfnScaleDownTimeout = 30 // seconds
)
var (
ErrInvalidPayload = errors.New("Invalid payload")
ErrRoutesAlreadyExists = errors.New("Route alre... |
// 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 msgbus
import (
"context"
"errors"
"fmt"
"net/http"
"regexp"
"strings"
"github.com/lfkeitel/yobot/librenms"
"github.com/lfkeitel/yobot/pkg/bot"
"github.com/lfkeitel/yobot/pkg/config"
"github.com/lfkeitel/yobot/pkg/utils"
)
func init() {
RegisterMsgBus("librenms", handleLibreNMS)
}
var (
libreNMS... |
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copy... |
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"text/template"
"time"
)
type datestampFlagValue struct {
time.Time
}
func (d *datestampFlagValue) String() string {
if (*d).IsZero() {
return ""
}
return fmt.Sprint((*d).Tim... |
package main
import (
"bytes"
"flag"
"fmt"
"os"
"path/filepath"
"strings"
"text/tabwriter"
"github.com/genuinetools/img/internal/binutils"
_ "github.com/genuinetools/img/internal/unshare"
"github.com/genuinetools/img/types"
"github.com/sirupsen/logrus"
)
const (
defaultBackend = types.AutoBackend
... |
// Copyright (C) The Arvados Authors. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
package arvadostest
import (
"crypto/rand"
"crypto/rsa"
"encoding/base64"
"encoding/json"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"time"
"gopkg.in/check.v1"
"gopkg.in/square/go-jose.v2"
)
type ... |
package models
import (
"bytes"
"compress/gzip"
"crypto/tls"
"github.com/astaxie/beego/logs"
"io"
"net/http"
"net/url"
"sync"
"time"
"github.com/signintech/gopdf"
)
//SaveImagePDF 导出图形到PDF
func SaveImagePDF(hostids []string, start, end string) ([]byte, error) {
pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config... |
// 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 ... |
// Copyright (C) 2018 rameshvk. All rights reserved.
// Use of this source code is governed by a MIT-style license
// that can be found in the LICENSE file.
// Package table implements a loose 2d collection of values
package table
import (
"github.com/dotchain/dot/changes"
"github.com/dotchain/dot/changes/types"
)
... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 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 obtain a copy of the Li... |
// This is a client that writes out to a file, and optionally rolls the file
package main
import (
"flag"
"fmt"
"github.com/nsqio/nsq/client"
"log"
"os"
"os/signal"
"syscall"
"time"
"github.com/mreiferson/go-options"
"github.com/nsqio/nsq/internal/app"
"github.com/nsqio/nsq/internal/lg"
"github.com/nsqio... |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package fan
import (
"context"
"io"
"log"
"net"
"sync"
"time"
)
// RedirectionConfig specifies the configuration of stateless fan-in forwarding.
type RedirectionConfig struct {
// The timeout of a connection in idle state.
Timeout time.Duration
// FanIn function will allocate buffer in `BufferSize` while lis... |
package aoc2020
import (
"strconv"
"strings"
aoc "github.com/janreggie/aoc/internal"
"github.com/pkg/errors"
)
// parseEquation returns a sequence of symbols in the form of a string slice from a given string output.
func parseEquation(eqn string) []string {
// add spaces to parentheses so that they may be parse... |
package mains
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"strings"
"time"
"github.com/zetamatta/nyagos/dos"
. "github.com/zetamatta/nyagos/ifdbg"
"github.com/zetamatta/nyagos/lua"
"github.com/zetamatta/nyagos/shell"
)
func versionOrStamp() string {
if Version != "" {
return Vers... |
package cmd
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"github.com/Jeffail/gabs"
"github.com/jaeles-project/jaeles/core"
"github.com/jaeles-project/jaeles/database"
"github.com/jaeles-project/jaeles/libs"
"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/vip... |
// Copyright (c) 2021 Nordix Foundation.
//
// 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
//... |
package cmd
import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"github.com/spf13/cobra"
"github.com/twpayne/chezmoi/internal/chezmoi"
)
var chattrCmd = &cobra.Command{
Use: "chattr attributes targets...",
Args: cobra.MinimumNArgs(2),
Short: "Change the attributes of a target in the source st... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codepipeline
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Represents the input of a ListActionTypes action.
type ListActionTypesInput struct {
_ struct{} `type:"structure"`
... |
package ip
import (
"encoding/json"
"errors"
"strconv"
"sync"
"github.com/qiniu/logkit/transforms"
. "github.com/qiniu/logkit/utils/models"
)
var (
_ transforms.StatsTransformer = &Number2Ip{}
_ transforms.Transformer = &Number2Ip{}
_ transforms.Initializer = &Number2Ip{}
)
type Number2Ip struct ... |
package service
import (
"context"
"database/sql"
"fmt"
account "github.com/fabric8-services/fabric8-auth/account/repository"
"github.com/fabric8-services/fabric8-auth/application/repository"
"github.com/fabric8-services/fabric8-auth/application/transaction"
"github.com/fabric8-services/fabric8-auth/authorizati... |
/*
Copyright 2021 <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
distribu... |
// Copyright 2018 jsonnet-bundler 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 a... |
package keychain
import (
"crypto/sha256"
"errors"
"fmt"
"github.com/decred/dcrd/dcrec/secp256k1/v2"
"github.com/decred/dcrd/hdkeychain/v2"
)
var errPubOnlyKeyRing = errors.New("keyring configured as pubkey only")
// HDKeyRing is an implementation of both the KeyRing and SecretKeyRing
// interfaces backed by a... |
/* ====================================================
# Copyright (C)2019 All rights reserved.
#
# Author : domchan
# Email : <EMAIL>
# File Name : mq.go
# Created : 2019/1/8 19:20
# Last Modified : 2019/1/8 19:20
# Describe :
#
# ===========================================... |
// main.go
package main
import (
b64 "encoding/base64"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"regexp"
"strings"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
"tidbyt.dev/pixlet/encode"
"tidbyt.dev/pixlet/runtime"
)
var (
apiPort int
applets []string
APPLETS_PATH = "./applets"
)
... |
package main
import (
"context"
"fmt"
"net/http"
"os"
"os/exec"
"strings"
"time"
"github.com/prometheus/client_golang/api"
v1 "github.com/prometheus/client_golang/api/prometheus/v1"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/model"
"github.com/sirupsen/logrus"
... |
package qjson_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/weaveworks/wksctl/pkg/qjson"
)
func TestCollectStringsOnScalarShouldReturnEmptyResultsSet(t *testing.T) {
strings, err := qjson.CollectStrings("", []byte(`"foobar"`))
assert.NoError(t, err)
assert.Equal(t, []string{}, string... |
// Copyright 2021 dfuse Platform 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 agre... |
package server
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"strings"
"time"
"gopkg.in/yaml.v2"
)
//APIList describes the list of APIs for the application
type APIList struct {
Description string
Application map[string][]map[string]interface{}
}
// Keys ...
func Keys(m map[string][]string) (keys []str... |
package dcrwallet
import (
"context"
"time"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/wire"
"github.com/decred/dcrlnd/chainscan"
"github.com/decred/dcrlnd/chainscan/csdrivers"
"github.com/decred/dcrlnd/lnwallet"
"decred.org/dcrwallet/v2/errors"
"decred.org/dcrwallet/v2/wallet"
)
... |
// Copyright 2020, Shulhan <<EMAIL>>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package xmlrpc
import (
"bytes"
"fmt"
"reflect"
"sort"
)
//
// Value represent dynamic value of XML-RPC type.
//
type Value struct {
Kind Kind
// In... |
package styx
import (
"crypto/tls"
"net"
"time"
"aqwari.net/retry"
"github.com/halfwit/styx/internal/util"
)
// Types implementing the Logger interface can receive
// diagnostic information during a Server's operation.
// The Logger interface is implemented by *log.Logger.
type Logger interface {
Printf(string... |
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
// Copyright 2019 - now The https://github.com/nvwa-io/wago 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 ... |
// Copyright 2019 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package main
import (
"fmt"
"io"
"log/syslog"
"net"
"os"
"os/exec"
"strconv"
"strings"
"github.com/bonan/dhcp6rd"
"gopkg.in/alecthomas/kingpin.v2"
)
var (
execCommand = exec.Command
app = kingpin.New("sixrd", "dhclient configuration helper for IPv6 rapid deployment (6rd)")
startCmd ... |
package systemctl
import (
"bytes"
"errors"
"time"
log "github.com/Sirupsen/logrus"
)
// StateAggregator is an utility to calc state statistics
type StateAggregator struct {
ResourceName string
AggState map[string]uint64
CurrentState string
CurrentStateDuration uint64
StateCollec... |
/*
Copyright 2019 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 writing, software
dist... |
// Copyright 2010 The Walk 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 walk
import (
"github.com/lxn/win"
)
type splitterLayout struct {
container Container
orientation Orientation
fractions []float64
resetNeed... |
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.