text stringlengths 3.08k 10.4k |
|---|
//go:build !manifestcodegen
// +build !manifestcodegen
// Code generated by "menifestcodegen". DO NOT EDIT.
// To reproduce: go run github.com/9elements/converged-security-suite/v2/pkg/intel/metadata/manifest/common/manifestcodegen/cmd/manifestcodegen github.com/9elements/converged-security-suite/v2/pkg/intel/metadata... |
// Copyright (c) 2018 The Ecosystem Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or or or http://www.opensource.org/licenses/mit-license.php
// Package secp256k1 wraps the bitcoin secp256k1 C library.
package secp256k1
/*
#cgo CFLAGS: -I./libsecp256k1
#cgo CFLAGS: -I./l... |
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the cod... |
// Copyright (C) MongoDB, Inc. 2014-present.
//
// 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 progress exposes utilities to asynchron... |
package mapeditor
import (
"strings"
"fyne.io/fyne"
"fyne.io/fyne/widget"
)
// Widget is a complete map editor as a widget
type Widget struct {
size fyne.Size
position fyne.Position
hidden bool
data []byte
datastring string
x int
y int
cx int
cy int
ri... |
package tcp
import (
"github.com/davyxu/cellnet"
"github.com/davyxu/cellnet/peer"
"github.com/davyxu/cellnet/util"
"net"
"sync"
"sync/atomic"
"time"
)
// Socket会话
type tcpSession struct {
peer.CoreContextSet
peer.CoreSessionIdentify
*peer.CoreProcBundle
pInterface cellnet.Peer
// Socket原始连接
conn n... |
package rake
import (
"regexp"
"strconv"
"strings"
)
//IsNumber returns true if the supplied string is a number
func IsNumber(str string) bool {
if strings.Contains(str, ".") { //deal with float
if _, err := strconv.ParseFloat(str, 32); err != nil {
return false
}
} else { //deal with int
if _, err := s... |
package context
import (
"errors"
"net"
"net/http"
"strings"
"sync"
"time"
log "github.com/Sirupsen/logrus"
"github.com/gorilla/mux"
"github.com/danielkrainas/canaria-api/uuid"
)
var (
ErrNoRequestContext = errors.New("no http request in context")
ErrNoResponseWriterContext = errors.New("no http r... |
package output
import (
"github.com/benthosdev/benthos/v4/internal/batch/policy"
"github.com/benthosdev/benthos/v4/internal/component/metrics"
"github.com/benthosdev/benthos/v4/internal/component/output"
"github.com/benthosdev/benthos/v4/internal/docs"
"github.com/benthosdev/benthos/v4/internal/impl/aws/session"
... |
package openstack
import (
"github.com/sirupsen/logrus"
"github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
operv1 "github.com/openshift/api/operator/v1"
"github.com/openshift/installer/pkg/asset/installconfig/openstack/validation"
"github.com/openshift/installer/pkg/quota"
machineapi "github.com/... |
package header
//TODO: consider moving this into the message package
import (
"bytes"
"encoding/binary"
"fmt"
"math/rand"
"strings"
"github.com/dusk-network/dusk-blockchain/pkg/p2p/wire"
"github.com/dusk-network/dusk-blockchain/pkg/p2p/wire/encoding"
"github.com/dusk-network/dusk-blockchain/pkg/util"
"githu... |
/*
Copyright 2019 Google 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 required by applicable law or agreed to in w... |
package onmemory
import (
"context"
"encoding/json"
"sync/atomic"
"time"
"golang.org/x/xerrors"
"github.com/saiya/dsps/server/domain"
)
type onmemoryMessage struct {
domain.Message
channelClock uint64
ExpireAt domain.Time
}
func (msg *onmemoryMessage) Validate() error {
if _, err := json.Marshal(msg.... |
package release
import (
"fmt"
repotools "github.com/awslabs/aws-go-multi-module-repository-tools"
"github.com/awslabs/aws-go-multi-module-repository-tools/changelog"
"github.com/awslabs/aws-go-multi-module-repository-tools/git"
"github.com/awslabs/aws-go-multi-module-repository-tools/gomod"
"log"
"path"
"path... |
package common
import (
"bytes"
"encoding/binary"
"errors"
"io"
"github.com/amitbet/vncproxy/logger"
)
var TightMinToCompress = 12
const (
SegmentBytes SegmentType = iota
SegmentMessageStart
SegmentRectSeparator
SegmentFullyParsedClientMessage
SegmentFullyParsedServerMessage
SegmentServerInitMessage
Segm... |
package lib
import (
"encoding/json"
"fmt"
"log"
"os"
"path"
"regexp"
"strconv"
"sync"
"time"
)
const (
wikiLeaksURLTemplate = "https://www.wikileaks.org/%s/get/%d"
foiaMetaDataURLTemplate = "https://foia.state.gov/searchapp/Search/SubmitSimpleQuery?searchText=*&beginDate=false&endDate=false&collectionM... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package waf
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type CreateRuleGroupInput struct {
_ struct{} `type:"structure"`
// The value returned by the most recent call to GetC... |
package map1
import (
"bytes"
"math/rand"
"reflect"
"runtime/debug"
"sort"
"testing"
"time"
)
func testKeys(
t *testing.T,
newKeys func() Keys,
genKey func() interface{},
elemKind reflect.Kind) {
defer func() {
if err := recover(); err != nil {
debug.PrintStack()
t.Errorf("Fatal Error: Keys(%s): %... |
package cmd
import (
"os"
"github.com/christianh814/gokp/cmd/argo"
"github.com/christianh814/gokp/cmd/capi"
"github.com/christianh814/gokp/cmd/export"
"github.com/christianh814/gokp/cmd/github"
"github.com/christianh814/gokp/cmd/kind"
"github.com/christianh814/gokp/cmd/templates"
"github.com/christianh814/gok... |
package main
import (
"container/list"
"context"
"encoding/json"
"fmt"
"io"
"log"
"code.vegaprotocol.io/go-wallet/wallet"
"github.com/vegaprotocol/api-clients/go/generated/code.vegaprotocol.io/vega/proto"
"github.com/vegaprotocol/api-clients/go/generated/code.vegaprotocol.io/vega/proto/api"
vegagrpc "github... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package channelconfig
import (
"fmt"
"math"
cb "github.com/arogyaGurkha/fabric-protos-go/common"
"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/common/capabilities"
"github.com/hyperledger/fabric/common/ut... |
package resource
import (
"fmt"
"io/ioutil"
"math"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"time"
"github.com/juju/errors"
)
// GraphiteDaemon represents a remote Graphite server. For more information, see
// http://graphite.readthedocs.org/ .
type GraphiteDaemon struct {
// Base is the URL wher... |
package Event
import (
"github.com/dancingmokey/goonvif/xsd"
)
type FilterType xsd.String
//<xsd:union memberTypes="xsd:dateTime xsd:duration"/>
type AbsoluteOrRelativeTimeType struct { //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
xsd.DateTime
xsd.Duration
}
type SubscriptionPolicy struct { //tev http://www.onv... |
package run
import (
"fmt"
"os"
consulapi "github.com/hashicorp/consul/api"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
logger "github.com/thevan4/logrus-wrapper"
)
var rootCmd = &cobra.Command{
Use: "capi",
Short: "consul api worker for lbos ;-)",
}
// Execute ...
func... |
// Copyright 2017 The LUCI Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package frontend
import (
"fmt"
"net/http"
"strconv"
"strings"
bbv1 "github.com/TriggerMail/luci-go/common/api/buildbucket/buildbucket/v... |
/************************************************************************************
**Author: <NAME>; Email: <EMAIL>
**Package: ring
**Element: ring.Ring
**Type: struct
------------------------------------------------------------------------------------
**Definition:
type Ring struct {
Value interface{} ... |
package rpc
import (
"flag"
"fmt"
"net"
"net/http"
"github.com/Sukhavati-Labs/go-miner/config"
"github.com/Sukhavati-Labs/go-miner/errors"
"github.com/Sukhavati-Labs/go-miner/logging"
gw "github.com/Sukhavati-Labs/go-miner/rpc/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"golang.org/x/net/context... |
package curse
// http://en.wikipedia.org/wiki/ANSI_escape_code#Sequence_elements
import (
"bufio"
"errors"
"fmt"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
"github.com/kless/term"
)
type Cursor struct {
Position
StartingPosition Position
Style
terminal *term.Terminal
}
type Position struct {
X, Y i... |
// Copyright 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 in wri... |
// Copyright 2017 Xiaomi, 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 2016 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... |
/*
Copyright 2017 The Kubernetes 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 ag... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iotthingsgraph
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/iotthingsgraph-2018-09-06/GetSystemTemplateRevisionsReques... |
package wasm_test
import (
"github.com/CosmWasm/wasmd/x/wasm/ibctesting"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"
ibcexported "github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
"gith... |
// *** 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 v20200501preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type ScheduledQueryRule struct {
... |
package aurora
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"sync"
"time"
"github.com/MadDogTechnology/telegraf"
"github.com/MadDogTechnology/telegraf/internal"
"github.com/MadDogTechnology/telegraf/internal/tls"
"github.com/MadDogTechnology/telegraf/plugins/inputs"
)
type Role... |
package statedb
import (
"encoding/json"
"fmt"
"github.com/incognitochain/incognito-chain/common"
"reflect"
)
type PortalStatusState struct {
statusType []byte
statusSuffix []byte
statusContent []byte
}
func (s PortalStatusState) StatusType() []byte {
return s.statusType
}
func (s *PortalStatusState) Se... |
package log
import (
"encoding/json"
"fmt"
"net/http"
"os"
"path/filepath"
"runtime"
"sync"
"time"
)
type (
MsgType uint8
OutType uint8
)
const (
MessageLog MsgType = 0
Message2Log MsgType = 1
WarningLog MsgType = 2
DebugLog MsgType = 3
ErrorLog MsgType = 4
... |
package toreq
/*
* 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
* "... |
package middlewares
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/containous/traefik/testhelpers"
"github.com/stretchr/testify/assert"
"github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/roundrobin"
)
func TestRetry(t *testing.T) {
testCases := []struct {
desc st... |
package redisc
import (
"encoding/json"
"errors"
"sync"
"time"
"github.com/garyburd/redigo/redis"
"github.com/gotgo/fw/logging"
)
type RedisCache struct {
readPool *roundRobinPools
writePool *roundRobinPools
Log logging.Logger `inject:""`
Encoder func(v interface{}) ([]byte, error)
Decoder func... |
/*
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, ... |
package charts
import (
"fmt"
"sync"
"time"
log "github.com/Sirupsen/logrus"
id "github.com/ilsiepotamus/gfycatid"
)
var Sets = map[string]*Set{}
type function func(int) float64
type xAxis struct {
name string
values []int64
}
type yAxis struct {
name string
values []float64
function function
}
... |
package zipkin_graphql
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/Laisky/zap"
"github.com/Laisky/go-utils"
"github.com/pkg/errors"
jsoniter "github.com/json-iterator/go"
)
var (
json = jsoniter.ConfigCompatibleWithStandardLibrary
httpClient = &http.Client{ // default http ... |
package main
import (
"flag"
"fmt"
"io"
"log"
"net/http"
"net/http/httptest"
"net/http/httputil"
_ "net/http/pprof"
"net/url"
"os"
"os/exec"
"path/filepath"
"runtime"
"sort"
"strings"
"time"
"bosun.org/_third_party/gopkg.in/fsnotify.v1"
"bosun.org/cmd/bosun/conf"
"bosun.org/cmd/bosun/sched"
"bosun... |
package cache
import (
"context"
"crypto/tls"
"flag"
"fmt"
"strings"
"time"
"unsafe"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/go-redis/redis/v8"
)
// RedisConfig defines how a RedisCache should be constructed.
type RedisConfig struct {
Endpoint string `yaml:"endpoin... |
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file ... |
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"os"
"strings"
"sync"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/elastic/go-sysinfo"
"github.com/google/uuid"
"github.com/gorilla/websocket"
)
const (
BUFFER_SIZE int = 16
)
var (
... |
// Copyright 2010 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 (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (... |
package criu
import (
"errors"
"fmt"
"os"
"os/exec"
"strconv"
"syscall"
"github.com/checkpoint-restore/go-criu/rpc"
"github.com/golang/protobuf/proto"
)
// Criu struct
type Criu struct {
swrkCmd *exec.Cmd
swrkSk *os.File
}
// MakeCriu returns the Criu object required for most operations
func MakeCriu() *... |
package cmd
import (
"bufio"
"fmt"
"io"
"log"
"math"
"os"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/minio/minio-go"
"github.com/minio/minio-go/pkg/encrypt"
"github.com/spf13/cobra"
)
var (
outputfile string
decryptkey string
)
func init() {
getCmd.Flags().StringVarP(&outputfile, "output", "o... |
package crconfigpoller
/*
* 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 ... |
package tablepacked
import (
"errors"
"fmt"
"sync"
"github.com/buger/jsonparser"
"github.com/chamot1111/waldb/wutils"
)
func (rd RowData) appendToJSON(table Table, inputBuffer *wutils.Buffer) error {
var err error
var logError error
var res = inputBuffer
grow := 2
for i := 0; i < len(table.Columns); i++ {... |
package controllers
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/jinzhu/gorm"
aiv1beta1 "github.com/openshift/assisted-service/api/v1beta1"
"github.com/openshift/assisted-service/internal/host"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
k8serrors "k8s.io/apimachinery/pkg/api/errors"... |
// Copyright 2015 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package common
import (
"bytes"
"encoding/binary"
"fmt"
"io"
"time"
ed "github.com/FactomProject/ed25519"
)
const (
// CommitEntrySize = 1 + 6 + 32 + 1 + 32 + 64
CommitEntr... |
/*
* MinIO Go Library for Amazon S3 Compatible Cloud Storage
* (C) 2018-2021 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/LICENSE... |
package spec
import (
"fmt"
"os"
"os/exec"
"strings"
"time"
"github.com/summerwind/h2spec/config"
"github.com/summerwind/h2spec/log"
)
// ClientTestGroup represents a group of test case.
type ClientTestGroup struct {
Key string
Section string
Name string
Parent *ClientTestGroup
Groups []*ClientT... |
package builder
import (
"context"
"io"
"math"
"github.com/buildbarn/bb-remote-execution/pkg/cas"
re_filesystem "github.com/buildbarn/bb-remote-execution/pkg/filesystem"
"github.com/buildbarn/bb-storage/pkg/blobstore"
"github.com/buildbarn/bb-storage/pkg/blobstore/buffer"
"github.com/buildbarn/bb-storage/pkg/... |
/*
* 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... |
// Copyright 2018 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package cover
import (
"fmt"
"sort"
"github.com/google/syzkaller/pkg/cover/backend"
"github.com/google/syzkaller/pkg/host"
"github.com/google/syzkal... |
package service
import (
"context"
"fmt"
"github.com/fabric8-services/fabric8-auth/app"
"github.com/fabric8-services/fabric8-auth/application/service"
"github.com/fabric8-services/fabric8-auth/application/service/base"
servicecontext "github.com/fabric8-services/fabric8-auth/application/service/context"
resourc... |
package craft
import (
"encoding/hex"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"github.com/andygeiss/create-go-app/internal/craft/templates"
"github.com/andygeiss/create-go-app/pkg/generate"
)
// Bin ...
type Bin struct {
Build string `json:"build"`
Generator string `json:"generator"`
GitBuild st... |
package jowt
import (
"crypto/hmac"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"net/http"
"strings"
)
const (
// HS512alg is used to implement HS512 Algorithm
HS512alg string = "HS512"
// HS256alg is used to implement HS512 Algorithm
HS256alg string = "HS256"
// typeJWT is for fill ... |
/*
Sniperkit-Bot
- Status: analyzed
*/
// Copyright © 2018 <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
//
// Unl... |
/*
Copyright (c) 2020 GMO GlobalSign, Inc.
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 License at
https://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software
distributed under... |
// 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-2020 Datadog, Inc.
// Package memcache provides functions to trace the bradfitz/gomemcache pack... |
package queryrange
import (
"context"
"fmt"
"time"
"github.com/cortexproject/cortex/pkg/querier/queryrange"
"github.com/cortexproject/cortex/pkg/util/spanlogger"
"github.com/go-kit/kit/log/level"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/promql"
"github.com/prometheus/pr... |
package email
import (
"context"
"html/template"
"time"
"github.com/pkg/errors"
"github.com/TheFlies/ofriends/internal/app/customer"
"github.com/TheFlies/ofriends/internal/app/cusvisitassoc"
"github.com/TheFlies/ofriends/internal/app/types"
"github.com/TheFlies/ofriends/internal/app/visit"
envconfig "github... |
package vkubelet
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/virtual-kubelet/virtual-kubelet/log"
"k8s.io/kubernetes/pkg/kubelet/server/remotecommand"
)
func loggingCon... |
package memorydb
import (
"sync"
"testing"
"time"
"github.com/krstak/testify"
)
func TestAddAndFindById(t *testing.T) {
db := Create()
db.Identifier("ID")
// ******** str *********
user := testUserStr{Age: 15}
id := db.Add(&user, "users")
res, err := db.FindById(id, "users")
actUser := *(res.(*testUserSt... |
// Copyright Project Harbor Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
package build
import (
"context"
"reflect"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/apiserver/pkg/storage/names"
"k8s.io/kubernetes/pkg/api/legacyscheme"
kapi "k8s.io/kubernetes/pkg/apis/core"
buildapi "github.com... |
// Copyright (c) 2014 The SurgeMQ 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 ... |
package dbcache
import (
"crypto/md5"
"encoding/hex"
"fmt"
jsoniter "github.com/json-iterator/go"
"github.com/sirupsen/logrus"
"gorm.io/driver/mysql"
"gorm.io/gorm"
"io"
"time"
)
var (
expire = 300
emptyString = "MNIL"
dbs map[string]*gorm.DB
defaultDb = "default"
dbDebug = false
ca... |
// +build linux
/*
* Copyright (C) 2019 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... |
package main
import (
"encoding/json"
"fmt"
"log"
"sort"
"time"
)
// Result contains Data plus post-processed statistics.
type Result struct {
*Data
TCP []*TCPFlowResult
Meta MetaResult
}
func NewResult(d *Data) (r *Result) {
r = &Result{
Data: d,
TCP: make([]*TCPFlowResult, 0, len(d.TCP4)+len(d.TCP6)... |
package finger
import (
"crypto/tls"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
)
type resps struct {
url string
body string
header map[string][]string
server string
statuscode int
length int
title string
jsurl []s... |
// Package prompt is a slightly modified version of promptui's list. The original
// version can be found at https://github.com/manifoldco/promptui
// A little copying is better than a little dependency. - Go proverbs.
package prompt
import (
"fmt"
"reflect"
"strings"
"github.com/sahilm/fuzzy"
)
type interfaceSo... |
package main
import (
"fmt"
"math/rand"
"os"
"runtime"
"strconv"
"strings"
"time"
)
func main() {
// complex_test()
// strings_test()
// time_test()
// pointer_test()
// a, err := strconv.Atoi("wasd")
// if err != nil {
// fmt.Println(err)
// } else {
// fmt.Println(a)
// }
// fmt.Println(is_equ... |
package goja
type weakMap uint64
type weakMapObject struct {
baseObject
m weakMap
}
func (wmo *weakMapObject) init() {
wmo.baseObject.init()
wmo.m = weakMap(wmo.val.runtime.genId())
}
func (wm weakMap) set(key *Object, value Value) {
key.getWeakRefs()[wm] = value
}
func (wm weakMap) get(key *Object) Value {
... |
// 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... |
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"bytes"
"encoding/json"
"io"
"io/ioutil"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"g... |
/*
* 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... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package responders
import (
"github.com/MG-RAST/golib/stretchr/codecs"
"github.com/MG-RAST/golib/stretchr/codecs/constants"
codecsservices "github.com/MG-RAST/golib/stretchr/codecs/services"
"github.com/MG-RAST/golib/stretchr/goweb/context"
"net/http"
)
const (
// DefaultStandardFieldDataKey is the default resp... |
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package notifiers
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/openinsight-project/grafinsight/pkg/bus"
"github.com/openinsight-project/grafinsight/pkg/components/simplejson"
"github.com/openinsight-project/grafinsight/pkg/infra/log"
"github.com/openinsight-project/grafinsight/pkg/models"
"github.co... |
package main
import (
"encoding/json"
"fmt"
"net/http"
"github.com/rs/zerolog/log"
)
type TriggerSuite struct {
c *Config
}
func (t *TriggerSuite) RunTests() {
// let's test trigger nodes
// create a new keygroup on nodeA
logNodeAction(t.c.nodeA, "Creating keygroup triggertesting")
t.c.nodeA.CreateKeygroup... |
/*
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, so... |
// Copyright 2017 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// nrzled writes to a strip of LEDs using the NRZ protocol.
//
// This includes the ws2811/ws2812/ws2812b family LEDs and compatible ICs like... |
package main
import (
"fmt"
)
// i am ripo video
func findProjectMetrics(metrics []FileMetric) ProjectMetric {
totalSloc := 0
tooLongFiles := 0
tooLongMethods := 0
nestingDepthSloc := 0
totalComments := 0
badComments := 0
commentDuplicates := 0
for _, i := range metrics {
totalSloc += i.FileLength
if ... |
package rules
import (
"regexp"
"strings"
)
type keyMatcher interface {
getPrefix() string
match(string) (keyMatch, bool)
getPattern() string
getPrefixesWithConstraints(constraints map[string]constraint) []string
}
type regexKeyMatcher struct {
regex *regexp.Regexp
fieldMap map[string]int
pattern string... |
// Copyright 2020 The Operator-SDK 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 (c) 2015 <NAME>, Nahanni Systems Inc
* 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, th... |
package fisymup
import (
"fmt"
"log"
"net/http"
"strings"
"sync"
"time"
ui "github.com/gizak/termui"
"github.com/gizak/termui/widgets"
// Must be imported this way for rclone to work
_ "github.com/ncw/rclone/backend/dropbox"
_ "github.com/ncw/rclone/backend/local"
"github.com/ncw/rclone/fs"
"github.com/... |
/*
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... |
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Un... |
/*
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, ... |
/*
Copyright 2017 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.