text
stringlengths
3.08k
10.4k
package suricata import ( "bufio" "context" "encoding/json" "errors" "fmt" "io" "net" "strings" "sync" "github.com/circonus-labs/circonus-unified-agent/cua" "github.com/circonus-labs/circonus-unified-agent/plugins/inputs" ) const ( // InBufSize is the input buffer size for JSON received via socket. // S...
package haproxy import ( "crypto/x509" "fmt" "sync" "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" log "github.com/sirupsen/logrus" "zvelo.io/ttlru" spoe "github.com/criteo/haproxy-spoe-go" "github.com/haproxytech/haproxy-consul-connect/con...
// Copyright 2014-2018 Grafana Labs // Released under the Apache 2.0 license // Modification notice: // 1. `serverConn` was substituted for `Server` as the type of the server object // 2. Debug loglines were altered to work with Oragono's logging system package ldap import ( "crypto/tls" "crypto/x509" "errors" "...
package kafka import ( "github.com/vkaushik/saga/trace" "sync" "time" "github.com/vkaushik/saga/storage/kafka/topic" "github.com/juju/errors" "github.com/Shopify/sarama" ) // BrokerAddresses is the list of broker addresses e.g. ["192.168.1.19:9092", "192.168.1.21:9092"] type BrokerAddresses []string // Part...
// Copyright © 2016, 2018, Oracle and/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. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2...
/* Copyright 2018 Mirantis Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
/* * Copyright 2018 The Trickster 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 ...
package integration import ( "bytes" "crypto/tls" "fmt" "html/template" "io/ioutil" "net/http" "net/url" "path" "regexp" "strings" "testing" knet "k8s.io/apimachinery/pkg/util/net" configapi "github.com/openshift/origin/pkg/cmd/server/apis/config" "github.com/openshift/origin/pkg/oauth/urls" testserve...
/* Copyright 2021 The Hybridnet 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...
// Copyright 2018 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 agree...
package compiler import ( "errors" "unicode" ) type ast struct { label astlabel // the type of node literal rune // a literal value to match, applicable for literal nodes children []*ast // child nodes, see below } // Empty nodes (only for nesting) may have many children // Literals should have 0 chil...
// +build ignore package main type Kind int const ( Settings Kind = 1 Search Kind = 2 Other Kind = 4 ) func isSettings(k Kind) bool { return k&Settings != 0 } func isSearch(k Kind) bool { return k&Search != 0 } type Option struct { Name string Kind Kind...
package rest import ( "bufio" "fmt" "io" "net" "net/http" "reflect" "time" ) // StreamContext is informations when streaming. type StreamContext interface { // Context is normal http context. Context // SetWriteDeadline sets the deadline for future Write calls. SetWriteDeadline(t time.Time) error // Pin...
package semanage /* #cgo CFLAGS: -I/usr/include/semanage #cgo LDFLAGS: -L/usr/lib64 -lsemanage -lsepol #include <semanage.h> #include <stdlib.h> void wrap_set_cb(semanage_handle_t *handle, void *arg); */ import "C" import ( "bytes" "errors" "fmt" "sync" "unsafe" "github.com/go-logr/logr" "github.com/contai...
// Copyright 2015 CNI 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...
package e2e import ( "bytes" "fmt" "os/exec" "strconv" "strings" "time" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" ) func generateTimeBasedName(prefix string) string { var t = strconv.FormatInt(time.Now().Unix(), 10) return fmt.Sprintf("%s-%s", prefix, t) } func ...
// Copyright (C) MongoDB, Inc. 2017-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 bsonx import ( "bytes" "fmt" "github....
package pipeline import ( "fmt" "sync" "time" "github.com/ozonru/file.d/logger" ) type streamer struct { streams map[SourceID]map[StreamName]*stream mu *sync.RWMutex shouldStop bool charged []*stream chargedMu *sync.Mutex chargedCond *sync.Cond blocked []*stream blockedMu *sync.Mutex } f...
package overlay // xlOverlay_go/ip_overlay_test.go import ( "fmt" xr "github.com/jddixon/rnglib_go" xt "github.com/jddixon/xlTransport_go" . "gopkg.in/check.v1" "net" ) var _ = fmt.Print func (s *XLSuite) TestCtor(c *C) { rng := xr.MakeSimpleRNG() name := rng.NextFileName(8) o, err := NewIPOverlay(name, ni...
// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
package db import ( "encoding/json" "io/ioutil" "log" "github.com/ethereum/go-ethereum/common" "gorm.io/gorm" ) // DeliveryCountByPlanName - Given subscription plan name, returns subscription plan's delivery count func DeliveryCountByPlanName(_db *gorm.DB, planName string) (uint64, error) { var subscriptionPla...
package reticulum import ( "errors" layers "github.com/eliquious/reticulum/layers" volume "github.com/eliquious/reticulum/volume" ) const ( // DefaultDropout is the default dropout rate of 0.5 or 50%. Everything less than the dropout rate will be dropped. DefaultDropout float64 = 0.5 ) // Network is the neural...
package exec import ( "strings" "github.com/pkg/errors" "github.com/noirbizarre/gonja/nodes" ) // TrimState stores and apply trim policy type TrimState struct { Should bool ShouldBlock bool Buffer *strings.Builder } func (ts *TrimState) TrimBlocks(r rune) bool { if ts.ShouldBlock { switch r { ...
/* Copyright © 2021 ConsenSys Software Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
// Copyright 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 holdingspace import ( "context" "net/http" "net/http/httptest" "os" "path/filepath" "strconv" "time" "chromiumos/tast/local/chrome" ...
package gou import ( "testing" "github.com/stretchr/testify/assert" ) func TestValidationTypeof(t *testing.T) { assert.True(t, ValidationTypeof("foo", nil, "string")) assert.False(t, ValidationTypeof(1, nil, "string")) assert.False(t, ValidationTypeof(0.618, nil, "string")) assert.True(t, ValidationTypeof(1, ...
// Copyright 2019 eBay Inc. // Primary authors: <NAME>, <NAME>, // <NAME>, and <NAME>. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // https://www.apache.org/licenses/...
package cmd import ( "errors" "fmt" "io" "io/ioutil" "os" "strings" "github.com/smartcontractkit/chainlink/logger" "github.com/smartcontractkit/chainlink/services" strpkg "github.com/smartcontractkit/chainlink/store" "github.com/smartcontractkit/chainlink/store/models" "github.com/smartcontractkit/chainlin...
package tests import ( "context" "fmt" "strings" "time" batchv1 "k8s.io/api/batch/v1" k8sv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "kubevirt.io/client-go/kubecli" ) const ( toSucceed = true toFail = false ) // WaitForJobToSucceed blocks ...
/* * Copyright (c) 2021, Baidu.com, Inc. All Rights Reserved. */ package cmd import ( "encoding/hex" "errors" "fmt" "log" "path/filepath" "github.com/golang/protobuf/proto" "github.com/spf13/cobra" "github.com/xuperchain/xupercore/bcs/ledger/xledger/def" "github.com/xuperchain/xupercore/bcs/ledger/xledge...
package helper import ( "bytes" "fmt" "github.com/stretchr/testify/assert" "log" "math/big" "strconv" "testing" ) func TestBytesToHex(t *testing.T) { b := []byte{0xde, 0xad, 0xbe, 0xef} r := BytesToHex(b) assert.Equal(t, "deadbeef", r) } func TestHexToBytes(t *testing.T) { s := "deadbeef" r := HexToBytes...
package main import ( "flag" "fmt" "github.com/vit1251/golden/pkg/charset" cmn "github.com/vit1251/golden/pkg/common" "github.com/vit1251/golden/pkg/eventbus" "github.com/vit1251/golden/pkg/installer" "github.com/vit1251/golden/pkg/mailer" "github.com/vit1251/golden/pkg/mapper" "github.com/vit1251/golden/pkg/...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v20160901preview import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) type ApplianceDefinition struct {...
package main import ( "bufio" "bytes" "context" "errors" "flag" "fmt" "io/ioutil" "log" "os" "os/signal" "runtime/debug" "strings" "golang.org/x/crypto/ssh/terminal" "github.com/ichiban/prolog" "github.com/ichiban/prolog/engine" ) const ( prompt = "?- " contPrompt = "|- " ) func main() { var ...
// // Copyright 2019 Insolar Technologies GmbH // // 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...
// 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 app...
package graph import ( "encoding/json" "fmt" ) const ( vertexDoesNotBelongMsg = "vertex does not belong to this graph" edgeDoesNotBelongMsg = "edge does not belong to this graph" edgeDoesNotExistMsg = "edge does not exist" vertexDoesNotExistMsg = "vertex does not exist" selfLoopNotAllowedMsg = "self-loo...
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License, ...
package corral import ( "bufio" "context" "encoding/json" "fmt" "github.com/ISE-SMILE/corral/internal/pkg/corcache" "github.com/aws/aws-lambda-go/lambdacontext" "os" "strconv" "strings" "sync/atomic" "time" "github.com/aws/aws-lambda-go/lambda" log "github.com/sirupsen/logrus" "github.com/spf13/viper" ...
/* Copyright 2016 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...
package repos import ( "context" "encoding/json" "fmt" "io/ioutil" "path/filepath" "reflect" "testing" "github.com/google/go-cmp/cmp" "github.com/sourcegraph/sourcegraph/internal/api" "github.com/sourcegraph/sourcegraph/internal/extsvc/gitlab" "github.com/sourcegraph/sourcegraph/internal/rcache" "github.c...
package types import ( "encoding/json" sdk "github.com/ci123chain/ci123chain/pkg/abci/types" "time" ) const ( // TODO: Why can't we just have one string description which can be JSON by convention MaxMonikerLength = 70 MaxIdentityLength = 3000 MaxWebsiteLength = 140 MaxSecurityContactLe...
// Copyright 2020 Anapaya Systems // // 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 ( "bytes" "context" "fmt" "log" "regexp" "strings" "text/template" "time" "github.com/google/go-github/github" "github.com/kelseyhightower/envconfig" "golang.org/x/oauth2" ) type env struct { GithubToken string `envconfig:"GITHUB_TOKEN"` Owner string `envconfig:"OWNER"` Re...
package main import ( "database/sql" "github.com/bwmarrin/lit" _ "github.com/go-sql-driver/mysql" "github.com/kkyr/fig" "github.com/robfig/cron/v3" tb "gopkg.in/tucnak/telebot.v2" "strconv" "strings" "time" ) // Config holds data parsed from the config.yml type Config struct { Token string `fig:"tok...
// Copyright © 2019 NAME HERE <EMAIL ADDRESS> // // 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 ...
package controller import ( "crypto/sha1" "encoding/hex" "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "strconv" "strings" "time" "github.com/lf-edge/eden/pkg/controller/adam" "github.com/lf-edge/eden/pkg/device" "github.com/lf-edge/eden/pkg/models" "github.com/lf-edge/eden/pkg/utils" "github....
package model import ( "bytes" "encoding/base64" "fmt" "image" _ "image/gif" _ "image/jpeg" _ "image/png" "net/http" "net/url" "os" "path" "regexp" "strconv" "strings" "time" "github.com/tomogoma/go-typed-errors" "io" "io/ioutil" "github.com/dgrijalva/jwt-go" ) type ImageMeta struct { ID ...
/* * Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Licen...
package eventbus import ( "sync" ) // Event holds topic name and data. type Event struct { Data interface{} Topic string wg *sync.WaitGroup } // Done calls Done on sync.WaitGroup if set. func (e *Event) Done() { if e.wg != nil { e.wg.Done() } } // CallbackFunc Defines a CallbackFunc. type CallbackFunc f...
// Copyright 2018 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 agr...
package main import ( "encoding/base64" "fmt" "io/ioutil" "net/http" "net/url" "os" "strings" "time" "github.com/Showmax/go-fqdn" "github.com/cenkalti/backoff/v4" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus-community/pushprox/util" "github.com/prometheus/common/promlog" ...
package airflow import ( "bytes" "crypto/md5" //nolint:gosec "errors" "fmt" "text/template" "github.com/astronomer/astro-cli/airflow/types" "github.com/astronomer/astro-cli/airflow/include" "github.com/astronomer/astro-cli/config" "github.com/astronomer/astro-cli/messages" "github.com/astronomer/astro-cli/...
//字典测试 package main import ( "fmt" "sort" ) type Person struct { id int name string parent *Person } //创建字典测试 func createMap() { var mapList map[string]int var mapList2 map[string]int fmt.Printf("mapList类型为:%T 长度为:%d 是否为nil:%v\n", mapList, len(mapList), mapList == nil) //初始化字典 mapList = map[string]in...
/* 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, sof...
package util import ( "database/sql" "reflect" "strings" "sync" "github.com/yz89122/goqu/v10/internal/errors" ) const ( skipUpdateTagName = "skipupdate" skipInsertTagName = "skipinsert" defaultIfEmptyTagName = "defaultifempty" ) var scannerType = reflect.TypeOf((*sql.Scanner)(nil)).Elem() func IsUi...
// Copyright (c) 2022 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...
// Copyright 2018 StreamSets 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...
// Package repository contains everything related to working with git repositories hosted on GitHub: cloning, commits, creating branches, pushing, creating/updating/merging pull requests, and so on. package repository import ( "context" "fmt" "os" "path/filepath" "regexp" "strconv" "github.com/dailymotion-oss/...
package types import ( "fmt" "github.com/lyraproj/issue/issue" "github.com/lyraproj/pcore/hash" "github.com/lyraproj/pcore/px" ) const KeyGoName = `go_name` var typeAttributeKind = NewEnumType([]string{string(constant), string(derived), string(givenOrDerived), string(reference)}, false) var typeAttribute = New...
package api import ( "math/rand" "net/http/httptest" "net/url" "strings" "testing" "github.com/gin-gonic/gin" "github.com/gotify/server/mode" "github.com/gotify/server/model" "github.com/gotify/server/test" "github.com/gotify/server/test/testdb" "github.com/stretchr/testify/assert" "github.com/stretchr/te...
package mediaprocessor import "fmt" // FSConfig contains the filesystem-related parameters used when processing media type FSConfig struct { InputDir string OutputDir string MoveProcessed bool ProcessedDir string Watch bool Workers int } // MediaConfig contains the image and video outpu...
/* Copyright © 2019 BAKEJ <EMAIL> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
package nimiq import ( "encoding/json" "github.com/stretchr/testify/assert" "github.com/trustwallet/blockatlas/coin" "github.com/trustwallet/blockatlas/pkg/blockatlas" "io/ioutil" "path/filepath" "runtime" "sort" "testing" "time" ) const ( basicSrc = ` { "hash": "8b219949f4c1dfe9e7a9cdc5dbbc507e40dc16f44a...
// Package makross is a high productive and modular web framework in Golang. package makross import "strings" // RouteGroup represents a group of routes that share the same path prefix. type RouteGroup struct { prefix string makross *Makross handlers []Handler } // newRouteGroup creates a new RouteGroup with ...
package monitoring import ( "reflect" "sort" "github.com/rancher/rancher/pkg/node" v1 "github.com/rancher/types/apis/core/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" ) type ExporterEndpointController struct ...
package storage import ( "context" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log" "github.com/pkg/errors" "github.com/filecoin-project/go-filecoin/abi" "github.com/filecoin-project/go-filecoin/address" "github.com/filecoin-project/go-filecoin/types" ) // DefaultFaultSlasherGasPrice is the default ...
package broker import ( "fmt" "github.com/automationbroker/bundle-lib/bundle" "github.com/automationbroker/bundle-lib/runtime" log "github.com/sirupsen/logrus" ) // JobStateSubscriber is responsible for handling and persisting JobState changes type JobStateSubscriber struct { dao SubscriberDAO } // NewJobState...
package cmd import ( "fmt" "log" "os" path "path/filepath" "strings" "github.com/jiharal/s1gu/utils" "github.com/spf13/cobra" ) var apiORMCMD = &cobra.Command{ Use: "api-orm [api name]", Short: "It's depend on orm Model, this command is used to create API level bussiness.", Args: cobra.MinimumNArgs(1), ...
package proxy import ( "encoding/binary" "github.com/golang/protobuf/proto" "github.com/redis-force/less-state-hdfs/pkg/model" pb "github.com/redis-force/less-state-hdfs/pkg/proto" ) func modelBlockToINode(blocks []*model.Block) ([]*pb.BlockMeta, []*pb.BlockStorage, []*pb.INodeFileBlock) { ib := make([]*pb.Bloc...
package main const READ_MODE = 0 const WRITE_MODE = 1 // TB_WORKMODE const TB_SHORT_BREAK = 0 const TB_CW = 1 const TB_CCW = 2 const TB_STOP = 3 const TB_WORKMODE_NUM = 4 // TB_PORTMODE const TB_DCM = 0 const TB_SPM = 1 const TB_PORTMODE_NUM = 2 // SVM_PORT const SVM1 = 0 const SVM2 = 1 const SVM3 = 2 const SVM4...
package gaehost import ( "context" "github.com/pkg/errors" "github.com/strongo/bots-framework/core" "github.com/strongo/log" "github.com/strongo/nds" "google.golang.org/appengine/datastore" "strconv" "time" ) // EntityTypeValidator validate entity types type EntityTypeValidator interface { } // GaeBotChatSto...
/* Copyright (c) 2015 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub...
/* Copyright (c) 2016 VMware, 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 Liquidata, 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...
// Copyright 2022 PingCAP, Inc. Licensed under Apache-2.0. package topsql import ( "net/http" "github.com/gin-gonic/gin" "github.com/joomcode/errorx" "go.uber.org/fx" "github.com/pingcap/tidb-dashboard/pkg/apiserver/user" "github.com/pingcap/tidb-dashboard/pkg/apiserver/utils" "github.com/pingcap/tidb-dashbo...
/** * Copyright 2018 Atos * * 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 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 main import ( "flag" "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "time" "gopkg.in/yaml.v2" ) // Version of osxlockdown var Version = "0.9" // ReadFile takes a relative path and returns the bytes in that file func ReadFile(filename string) (data []byte, err error) { path, err := f...
// Copyright 2020, OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// logging_conn.go defines LoggingListener, an implementation of net.Listener // that allows tests to read the text transported over a client-server // connection, and confirm, in the case of a TLS connection, that nothing // sensitive was transported in plain text. package cert import ( "bytes" "context" "errors"...
// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
package downloader import ( "crypto/sha256" "encoding/hex" "fmt" "io" "io/ioutil" "net/http" "net/url" "os" "path/filepath" "runtime" "strings" "time" "github.com/flavio/kuberlr/internal/common" "github.com/flavio/kuberlr/internal/osexec" "github.com/blang/semver/v4" "github.com/schollz/progressbar/v...
package anilistgo import ( "encoding/json" "fmt" ) // Character A character that features in an anime or manga type Character struct { ID int `json:"id"` Name CharacterName `json:"name"` Image CharacterImage `json:"image"` Description string ...
package server import ( "math" "github.com/pion/rtcp" "github.com/pion/rtp" ) // Thanks to MIT-licensed pion/ion for inspiration! // maxSN is a maximum sequence number. const maxSN = uint16(math.MaxUint16) // videoClock represents the clock rate of VP8, VP9 and H264 codecs (90000 Hz). const videoClock = 90000 ...
package main import ( "context" "errors" "fmt" "net/url" "os" "regexp" "github.com/Azure/azure-pipeline-go/pipeline" "github.com/Azure/azure-storage-blob-go/2018-03-28/azblob" log "github.com/Sirupsen/logrus" "github.com/faasaf/frameworks/binding" "github.com/faasaf/frameworks/common" ) // Value is inject...
package executor import ( "bufio" "bytes" "fmt" "math/rand" "os" "path" "regexp" "strings" "time" gofig "github.com/akutz/gofig/types" "github.com/akutz/goof" log "github.com/sirupsen/logrus" "github.com/thecodeteam/rexray/libstorage/api/registry" "github.com/thecodeteam/rexray/libstorage/api/types" "...
package main import ( "encoding/json" "fmt" "io/ioutil" "log" "os" "strconv" "github.com/360EntSecGroup-Skylar/excelize/v2" ) func main() { settingsJson := `{ "serverMin": { "vbrServer": { "cores": 4, "ram": 8 }, "sqlServer": { "cores": 2, "ram": 4 }, "vProxyServer": { "...
// Copyright (c) 2020 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
package rest import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net" "net/http" "net/url" "os" "strings" "syscall" "time" ) type ( Request interface { WithParam(name, value string) Request WithParams(params map[string]string) Request WithHeader(header http.Header) Request...
// 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. // +build windows package winapi import ( "syscall" "github.com/Gipcomp/win32/gdi32" "github.com/Gipcomp/win32/kernel32" "github.com/Gipcomp/win32/user...
package model12 // Code generated by ../../generators/models.go. DO NOT EDIT. // You can regenerate it by running 'go generate ./models' from the directory above. import ( "github.com/andig/gosunspec" "github.com/andig/gosunspec/smdx" "github.com/andig/gosunspec/typelabel" ) // Block12 - IPv4 - Include to support...
package module import ( "bytes" "fmt" "io/ioutil" "net/url" "os" "os/exec" "path/filepath" "regexp" "strings" "syscall" urlhelper "github.com/hashicorp/terraform/helper/url" ) // Getter defines the interface that schemes must implement to download // and update modules. type Getter interface { // Get dow...
// Copyright Fuzamei Corp. 2018 All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package mavl import ( "fmt" "sync" "time" "github.com/bnchain/bnchain/common" dbm "github.com/bnchain/bnchain/common/db" farm "github.com/dgryski/go-farm"...
// (c) Copyright 2019 Hewlett Packard Enterprise Development LP // Windows Go binaries can have version information attached to them. A Go package is available // to help you attach this information: // // https://github.com/josephspurrier/goversioninfo // // What this utility does is take an existing versioninfo.jso...
/* 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, ...
/***** BEGIN LICENSE BLOCK ***** # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # The Initial Developer of the Original Code is the Mozilla Foundation. # Portions cre...
package os import ( "io/ioutil" "path/filepath" "regexp" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "github.com/c2fo/vfs/v6" "github.com/c2fo/vfs/v6/utils" ) /********************************** ************TESTS***************** **********************************/ ...
// Copyright 2020 Fugue, 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 ...
package middleware import ( "fmt" "github.com/gin-gonic/gin" "github.com/hedzr/rate" "github.com/hedzr/rate/rateapi" "gopkg.in/hedzr/errors.v2" "time" ) // ForGin builds a gin.HandlerFunc from a Config object func ForGin(config *Config) gin.HandlerFunc { l := &exLimiter{ enabled: config.Enabled, algorith...