text
stringlengths
3.08k
10.4k
package UI import ( "github.com/gotk3/gotk3/gtk" ) type consumer struct { mainBox *gtk.Box TextArea *gtk.TextView textFrame *gtk.Frame scrollWin *gtk.ScrolledWindow menuBox *gtk.Box ReadButton *gtk.Button StopButton *gtk.Button ClearButton *gtk.Button Offset *offset AutoScroll *autoS...
/* Package cmd Liciense Copyright © 2020 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 odoo import ( "fmt" ) // PurchaseReport represents purchase.report model. type PurchaseReport struct { LastUpdate *Time `xmlrpc:"__last_update,omptempty"` AccountAnalyticId *Many2One `xmlrpc:"account_analytic_id,omptempty"` CategoryId *Many2One `xmlrpc:"category_id,omptempty"` ...
package main import ( "fmt" "io" "io/ioutil" "os" "runtime" "strconv" "strings" "syscall" "time" "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/s3" "github.com/mitchellh/ioprogress" ) type Updater st...
package record import ( "archive/tar" "database/sql" "encoding/json" "github.com/lesovsky/pgcenter/internal/postgres" "github.com/lesovsky/pgcenter/internal/query" "github.com/lesovsky/pgcenter/internal/stat" "github.com/lesovsky/pgcenter/internal/view" "github.com/stretchr/testify/assert" "io" "os" "path/f...
package stitcher import ( "context" "html/template" "io/ioutil" "log" "net/url" "strings" "time" "github.com/Masterminds/sprig" "github.com/PuerkitoBio/goquery" "github.com/bradfitz/iter" "github.com/mailgun/groupcache/v2" "github.com/valyala/fasttemplate" ) // TODO The endpoint code needs to be re-done...
/* Copyright © 2021 Opsani <<EMAIL>> This file is part of https://github.com/opsani/opsani-ignite */ package cmd import ( "context" "fmt" "os" "sort" "time" "github.com/spf13/cobra" appmodel "opsani-ignite/app/model" "opsani-ignite/log" prom "opsani-ignite/sources/prometheus" ) const LOG_FILE = "opsani-i...
package core import ( "os" "os/signal" "syscall" "github.com/schubergphilis/mercury/internal/config" "github.com/schubergphilis/mercury/pkg/healthcheck" "github.com/schubergphilis/mercury/pkg/logging" ) // HealthHandler gets all healthcheck feedback, and sends updates to the core manager // We get all health c...
// Copyright 2021-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...
// Copyright 2020 SEQSENSE, 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 ...
package param import ( "encoding/json" "fmt" "reflect" "strings" "sync" logger "github.com/sirupsen/logrus" "gitlab.cern.ch/lb-experts/golbclient/lbconfig/utils/runner" ) type CollectdAlarmImpl struct { CommandPath string cache alarmMetricCache } // Needed for eventual concurrent map access var alarm...
// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: import.proto /* Package testimport is a generated protocol buffer package. It is generated from these files: import.proto It has these top-level messages: */ package testimport import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "...
package statsrunner import ( "fmt" "sort" "strconv" "time" "git.abyle.org/hps/alolstats/riotclient" "git.abyle.org/hps/alolstats/statsrunner/analyzer" "git.abyle.org/hps/alolstats/storage" "git.abyle.org/hps/alolstats/utils" ) func (sr *StatsRunner) itemWinRateWorker() { defer sr.workersWG.Done() var next...
// Copyright 2021 The Fuchsia 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 rbetrace contains utilities for working with RBE traces. package rbetrace import ( "context" "encoding/json" "fmt" "os" "os/exec" "path/f...
package imagemounter import ( "fmt" "github.com/Masterminds/semver" "github.com/danielpaulus/go-ios/ios" "github.com/danielpaulus/go-ios/ios/zipconduit" log "github.com/sirupsen/logrus" "io" "net/http" "os" "path" "path/filepath" "strings" ) const repo = "https://github.com/haikieu/xcode-developer-disk-ima...
package command import ( "bytes" "errors" "fmt" "path/filepath" "runtime" "strconv" "strings" "github.com/fyne-io/fyne-cross/internal/log" "github.com/fyne-io/fyne-cross/internal/volume" ) const ( // ArchAmd64 represents the amd64 architecture ArchAmd64 Architecture = "amd64" // Arch386 represents the am...
// Copyright 2022 The Hugo 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 ...
// Copyright (c) 2020 Mercari, 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, publish,...
// Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd package sftp import ( "encoding/binary" "os" "syscall" "time" "code.google.com/p/gosshnew/s...
package tracing import ( "context" "fmt" "reflect" "testing" "github.com/stretchr/testify/assert" "go.opencensus.io/trace" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" ) var testGRPCOptions = &gRPCOptions{} func TestDefaultGRPCOptions(t *testing.T) { expected := &gRPCOptions{ metadata...
package userlike import ( "encoding/json" ) type UserlikeBaseOutMessage struct { Event string `json:"_event,omitempty"` Type string `json:"_type,omitempty"` } func UserlikeBaseOutMessageFromBytes(bytes []byte) (UserlikeBaseOutMessage, error) { msg := UserlikeBaseOutMessage{} err := json.Unmarshal(bytes, &msg) ...
package Geo import ( "crypto/sha256" "fmt" "github.com/opensatelliteproject/SatHelperApp/ImageProcessor/Projector" "github.com/opensatelliteproject/SatHelperApp/XRIT" "math" "regexp" "strconv" ) type Converter struct { satelliteLongitude float64 // Satellite Longitude coff int // Column Off...
package zero import ( "fmt" "strconv" "strings" "time" "github.com/tj/go-debug" ) type arrVal struct { Time time.Time Items []string strItems map[string]string numItems map[string]int64 } type arrStore map[Key]arrVal type Arr struct { store arrStore debug debug.DebugFunction } func (a *Arr) Add(key K...
package main import ( "bufio" "fmt" "log" "os" "strconv" "strings" ) // Condition is the input of a Transition type Condition struct { state string symbol rune } func (c Condition) String() string { return "state=" + c.state + " symbol=" + strconv.QuoteRuneToASCII(c.symbol) } // Effect is the output of a ...
/* * Copyright (C) @2021 Webank Group Holding Limited * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by a...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package mediator import ( "errors" "fmt" "sync" "time" "github.com/cucumber/godog" "github.com/hyperledger/aries-framework-go/pkg/client/mediator" "github.com/hyperledger/aries-framework-go/pkg/didcomm/commo...
package state import "fmt" // change holds a change and it's rollback function. type change struct { // execute is the function makes state change. execute func() // rollback is the function rollbacks the change. rollback func() } // heightChanges holds all changes on a particular height. type heightChanges str...
package config import ( "errors" "io/ioutil" "time" "github.com/prometheus/common/model" "gopkg.in/yaml.v2" ) // TODO: error if a user tries to override this with labels //const exporterNameLabel = "exporter_name" // nolint: golint var ( ErrInvalidExportersConfig = errors.New("exporters key is not in the kno...
package main import ( "database/sql" "os" "strings" "time" "github.com/jmoiron/sqlx" _ "github.com/mattn/go-sqlite3" "github.com/rs/xid" ) const ( dbVersion = "0.1.0" ) var justCreated bool var db *sqlx.DB func init() { var err error if _, err = os.Stat("data.sqlite3"); os.IsNotExist(err) { // This me...
package xmlutils import ( "encoding/xml" "fmt" S "strings" // FU "github.com/fbaube/fileutils" SU "github.com/fbaube/stringutils" ) // XmlPublicID = PID = Public ID = FPI = Formal Public Identifier type XmlPublicID string // XmlSystemID = SID = System ID = URI (Universal Resource Identifier) // (can be a filep...
package cmd import ( "github.com/rsteube/carapace" "github.com/rsteube/carapace-bin/pkg/actions/os" "github.com/rsteube/carapace-bin/pkg/actions/ps" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "ps", Short: "report a snapshot of the current processes", Run: func(cmd *cobra.Command, args []...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: github.com/piotrkowalczuk/charon/pb/rpc/charond/v1/common.proto package charond // import "github.com/piotrkowalczuk/charon/pb/rpc/charond/v1" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppre...
package lsp // SemanticTokenType represents the type of a semantic token. type SemanticTokenType string const ( STTNamespace SemanticTokenType = "namespace" // STTType represents a generic type. Acts as a fallback for types which can't // be mapped to a specific type like class or enum. STTType SemanticTokenType...
package http import ( "bufio" "bytes" "net/http" "net/url" "regexp" "strings" "github.com/PuerkitoBio/goquery" ) var ( B2S = regexp.MustCompile("\\<[\\S\\s]+?\\>") DelStyle = regexp.MustCompile("\\<style[\\S\\s]+?\\</style\\>") DelScript = regexp.MustCom...
package verifier import ( "context" "fmt" dhcPdm "github.com/webshield-dev/dhc-common/pdm" "github.com/webshield-dev/dhc-common/vaccinemd" "github.com/webshield-dev/dhc-common/verification" eudvcdatamodel "github.com/webshield-dev/eudvcdecoder/datamodel" "github.com/webshield-dev/eudvcdecoder/helper" ) // // V...
package main import ( "context" "flag" "fmt" "net/http" "os" "os/signal" "strconv" "strings" "time" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" "github.com/fleetframework/sonarqube-prometheus-exporter/pkg" ) var ( port string scrapeTimeout ...
// Copyright 2021-Present Couchbase, Inc. // // Use of this software is governed by the Business Source License included // in the file licenses/BSL-Couchbase.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 Lic...
package cmd import ( "fmt" "io" "os" "github.com/lithammer/dedent" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/weaveworks/ignite/cmd/ignite/cmd/imgcmd" "github.com/weaveworks/ignite/cmd/ignite/cmd/kerncmd" "github.com/weaveworks/ignite/cmd/ignite/cmd/vmcmd"...
// Copyright (c) 2021 <NAME> // Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.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/licen...
package k8s import ( "strings" "net/http" "github.com/astaxie/beego/logs" "io/ioutil" "net/url" "encoding/json" "strconv" "time" "cloud/util" ) // sum(rate(container_cpu_usage_seconds_total{id="/",instance=~"^.*$"}[1m])) / sum (machine_cpu_cores{instance=~"^.*$"}) * 100 cpu使用率 // sum (container_memory_workin...
// Copyright 2020 The Monogon Project Authors. // // 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...
/* Copyright 2013 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 writing, software di...
package overlay // Treat a set of layers as a filesystem, for e.g., putting in the // module search path. import ( "io" "net/http" "os" "path" "strings" ) // Overlay is a read-only filesystem formed with a list of layers // representing diffs. It is designed to behave like a filesystem such // as those used in ...
/** * Copyright 2020 Appvia Ltd <<EMAIL>> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
package main import ( "fmt" "log" "math/rand" "os" "time" "github.com/apparentlymart/gopherhal/ghal" "github.com/apparentlymart/gopherhal/trainhal" prompt "github.com/c-bata/go-prompt" "github.com/spf13/pflag" ) var why = ghal.MakeWord("WRB", "why") var because = ghal.MakeWord("IN", "because") func main() ...
package main import ( "encoding/json" "flag" "fmt" "io/ioutil" "log" "net/url" "os" "sync" "time" "github.com/lc/jenkinz/jenkinz" ) var ( numbuilds = 0 timeout int concurrency int credentials string domain string jobs []string ) type Attack struct { Domain string Host ...
package main import ( "context" "flag" "fmt" "io" "log" "os" "os/signal" "syscall" "time" "github.com/criyle/go-judge/pb" "golang.org/x/crypto/ssh/terminal" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) var ( srvAddr = flag.String("srvaddr", "localhost:5051", "GRPC server addr") ) co...
package main import ( "fmt" "io" "io/ioutil" "log" "os" "strings" "time" ) func main() { if len(os.Args) < 3 { log.Fatal("Usage: $>filecomp.exe \"sourcepath\" \"destpath\"") } // write log (https://stackoverflow.com/a/51628140) logFilename := fmt.Sprintf("filecompare_log_%s.log", time.Now().Format("2006...
package model import ( "github.com/SmallTianTian/dingtalk/model/taobao" "github.com/SmallTianTian/dingtalk/utils" ) func NewOapiRhinoMosLayoutOperationdefGetRequest() *OapiRhinoMosLayoutOperationdefGetRequest { return &OapiRhinoMosLayoutOperationdefGetRequest{} } type OapiRhinoMosLayoutOperationdefGetRequest stru...
package server import ( "flag" "fmt" "log" "net/http" "os" "path" "path/filepath" "strings" "time" "github.com/prometheus/client_golang/prometheus" "github.com/vcabbage/go-unpkg/npm" "os/signal" "golang.org/x/sync/singleflight" ) // Metrics contains prometheus metrics var Metrics = struct { requests ...
package interpreter import ( "fmt" "jsInterpreter/src/lexer" "jsInterpreter/src/parser" ) type globalScopeType uint8 const ( GConst globalScopeType = iota + 1 GLet GVar GFunction ) type GlobalScopeStruct struct { ScopeType globalScopeType Value interface{} } var GlobalScope map[string]GlobalScopeStruc...
// Copyright (c) 2021 Terminus, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
package model type ( // Type is the data structure for storing the parsed values of schema string Type map[string]Collection // key is database name // Collection is a data structure for storing fields of schema Collection map[string]Fields // key is collection name // Fields is a data structure for storing the ...
package main import ( "bytes" "context" "io/ioutil" "net" "os" "os/signal" "strconv" "syscall" "time" "fmt" "net/http" "gopkg.in/alecthomas/kingpin.v2" "github.com/R4scal/zyxel_gs1920_exporter/config" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/pro...
package main import ( "encoding/xml" "flag" "fmt" "io" "io/ioutil" "log" "mime/multipart" "net/http" "os" "strings" "sync" "time" "gopkg.in/gomail.v2" "gopkg.in/yaml.v2" ) const ( RFC3339NOZ = "2006-01-02T15:04:05" TZ = "America/New_York" ) var ( configFile = flag.String("config.fil...
package main import ( "encoding/binary" "flag" "fmt" "github.com/myriadrf/limedrv" "github.com/quan-to/slog" "github.com/racerxdl/lms_tcp/rtltcp" "os" "os/signal" "strings" "syscall" ) var listenAddress = flag.String("a", "", "listen address") var listenPort = flag.Int("p", 1234, "listen port (default: 1234...
// Copyright (c) 2019 <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, distribu...
package creader import ( "bytes" "crypto/md5" "crypto/sha1" "crypto/sha256" "fmt" "hash" "io" "io/ioutil" "math/rand" "os" "reflect" "sync" "testing" ) type randomReaderAt struct{} // Read read random bytes into b, always returns err = nil. func (r *randomReaderAt) ReadAt(b []byte, offset int64) (n int,...
// scanner.go - scan for CVE-2016-5696 // // To the extent possible under law, <NAME> waived all copyright // and related or neighboring rights to this module of grill, using the creative // commons "cc0" public domain dedication. See LICENSE or // <http://creativecommons.org/publicdomain/zero/1.0/> for full details. ...
// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: storage/enginepb/engine.proto package enginepb import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math....
package main import ( "unsafe" "io" "reflect" ) // Copied and adapted code from go runtime var defaultWriter = text_mode_writer{} var defaultErrorWriter = text_mode_error_writer{} func printsp(w io.Writer) { printstring(w, " ") } func printnl(w io.Writer) { printstring(w, "\n") } func printbool(w io...
package spindeploy import ( "context" "encoding/json" "fmt" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/jsonmergepatch" "github.com/armory/spinnaker-operator/pkg/generated" "github.com/go-logr/logr" kerrors "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta" met...
package state import ( "strings" "time" log "github.com/sirupsen/logrus" "github.com/streadway/amqp" ) // AMQP is the AMQP client. type AMQP struct { routing map[string][]string // routing is a map binding queues to a list of routing keys isConnected bool // isConnected indicate if AMQP conn...
package app //go:generate go run github.com/golang/mock/mockgen -destination mock_shadow.go -package app -mock_names Client=MockShadowClient github.com/briggysmalls/detectordag/shared/shadow Client //go:generate go run github.com/golang/mock/mockgen -destination mock_connection_updater.go -package app github.com/brigg...
package main import ( "github.com/marvin-hansen/typedb-client-go/common" "github.com/marvin-hansen/typedb-client-go/data" typeDB "github.com/marvin-hansen/typedb-client-go/src/client/v2" "github.com/marvin-hansen/typedb-client-go/test/client/utils" "log" ) const dbName = utils.DBName const verbose = true // prin...
package worker import ( "bytes" "gmq/mqtt/packets" "gmq/mqtt/message" "gmq/mqtt/ext" "gmq/mqtt/connect" "time" "log" "gmq/mqtt/topic" "sync/atomic" ) type Worker struct { deltaTime uint32; //心跳检查标记 clientId string //链接标识 conn connect.Connect Status int //链接状态1=鉴权中 2=链接正常 3=鉴权失败 4=已断开 ...
// Copyright 2015 <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 writi...
package main import ( "encoding/base64" "github.com/gofiber/fiber/v2" ) const ( nginxXAccelExpires = "X-Accel-Expires" collectorURLReplacement = "__COLLECTOR_URL__" ) const ( errorTypeApp = "app" errorTypeClient = "client" ) const ( mimetypeJS = "text/javascript" mimetypeText = "text/plain" mime...
package coins import ( "encoding/base64" "encoding/json" "fmt" "io/ioutil" "net/http" "github.com/p9c/jorm9/utils" ) // type NodeServices interface { // GetNodeStatus() // } func GetCoins() { coinresultMapA, err := getCCD("https://min-api.cryptocompare.com/data/all/coinlist") if err != nil { fmt.Println(...
package pgfuncs import ( "errors" "fmt" "strconv" "time" "github.com/andsha/replicagor/structs" ) func sliceHasInt(slice []int, number int) bool { for _, n := range slice { if number == n { return true } } return false } // Generates Postgres queries based on information coming in the event func Gen...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: envoy/extensions/filters/network/echo/v3alpha/echo.proto package envoy_extensions_filters_network_echo_v3alpha import ( fmt "fmt" _ "github.com/cncf/udpa/go/udpa/annotations" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to...
package main import ( "fmt" iconv "github.com/djimenez/iconv-go" z "github.com/nutzam/zgo" "io/ioutil" "net/http" "regexp" "strconv" "strings" "time" ) // HTTP 客户端对象 var client http.Client // 各种 MIME 类型的映射 var mimes map[string]string // 浏览器 UserAgent 的映射 var user_agents map[string]stri...
// Copyright 2018 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) Microsoft Corporation. * Licensed under the MIT license. */ package pipeline import ( "context" "fmt" "strings" "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" "github.com/Azure/azure-service-operator/v2/tools/generator/internal/astmodel" "github.com/Azure/azure-se...
package core import ( "fmt" "math/big" "testing" "github.com/nspcc-dev/neo-go/internal/testchain" "github.com/nspcc-dev/neo-go/pkg/core/storage" "github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/io" "github.com/nspcc-dev/neo-go/p...
package config import ( "errors" "fmt" "testing" "github.com/onsi/gomega/types" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) func BeValid() types.GomegaMatcher { return ResultMatcher{Valid} } type ResultMatcher struct { Status ValidationStatus } func (r ResultMatcher) Match(actual interface{}) ...
/* * Copyright (c) 2018 XLAB d.o.o * * 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 app import ( "context" "fmt" "os" // Load all auth plugins _ "k8s.io/client-go/plugin/pkg/client/auth" "github.com/sirupsen/logrus" "github.com/spf13/cobra" cliflag "k8s.io/component-base/cli/flag" cmdutil "k8s.io/kubectl/pkg/cmd/util" "github.com/jetstack/cni-migration/pkg" "github.com/jetstack/...
package config import ( "crypto/tls" "encoding/json" "fmt" "strings" "github.com/dollarshaveclub/pvc" "github.com/pkg/errors" ) type ServerConfig struct { HTTPSPort uint HTTPSAddr string DisableTLS bool TLSCert tls.Certificate WordnetPat...
// Licensed to SolID under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. SolID licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compli...
package cmd import ( "fmt" "os" "path" "time" "github.com/aergoio/aergo-lib/db" "github.com/aergoio/state-tools/stool" sha256 "github.com/minio/sha256-simd" "github.com/spf13/cobra" ) var ( snapshotPath string ) func init() { snapshotCmd.Flags().StringVarP(&snapshotPath, "snapshotPath", "s", "", "Path/to/...
package ldtest import ( "encoding/xml" "fmt" "os" "strings" "sync" "time" "github.com/launchdarkly/sdk-test-harness/framework" "github.com/launchdarkly/sdk-test-harness/framework/harness" o "github.com/launchdarkly/sdk-test-harness/framework/opt" ) type JUnitTestLogger struct { filePath string serviceI...
package genericsite import ( "github.com/xyproto/onthefly" "github.com/xyproto/pinterface" "github.com/xyproto/webhandle" "net/http" "strconv" ) type ( MenuEntry struct { id string text string url string } MenuEntries []*MenuEntry ) var menuIdCounter = 0 // Generate a new menu ID func (me *MenuEntr...
// Copyright 2017 The Cockroach Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
package unifi import ( "bytes" "errors" "fmt" "net" "net/http" "reflect" "strings" "testing" "time" ) func TestClientStations(t *testing.T) { const ( wantSite = "default" wantID = "abcdef123457890" wantHostname = "somehost" ) var ( wantStationMAC = net.HardwareAddr{0xde, 0xad, 0xbe, 0xef...
package cmd import ( "fmt" "github.com/seemywingz/gotoolbox/darksky" "github.com/seemywingz/gotoolbox/epoch" "github.com/seemywingz/gotoolbox/geolocation" "github.com/seemywingz/gotoolbox/gtb" ) // Flag Vars var verbose bool var location string var units string // Format var unitFormat darksky.UnitMeasures var...
package universal import ( "sync" ) func (s *Solution) Run() { var wg sync.WaitGroup for i := 0; i < len(s.Algs); i++ { if s.IsAsync { wg.Add(1) go func(alg int) { defer wg.Done() for int(s.Proc[alg].PC) < len(s.Algs[alg].Commands) && !s.StopNow { s.Step(alg) } }(i) } else { for in...
// Copyright © 2020 <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 wri...
package smt import ( "fmt" "github.com/starcoinorg/starcoin-go/core" "github.com/starcoinorg/starcoin-go/types" ) var SPARSE_MERKLE_PLACEHOLDER_HASH = &types.HashValue{} func init() { SPARSE_MERKLE_PLACEHOLDER_HASH, _ = types.CreateLiteralHash("SPARSE_MERKLE_PLACEHOLDER_HASH") } type Leaf struct { requestedKey...
// Package crypto used to encrypt communication channel. // // After establishing a connection to a CM server, the server and client go through a handshake process // that establishes an encrypted connection. // Client messages are encrypted using AES with a session key that is generated // by the client during the han...
package render3d import ( "math" "math/rand" "github.com/unixpickle/model3d/model3d" ) // A FocusPoint is some part of the scene that warrants // extra rays (e.g. part of a light). // // Focus points perform importance sampling such that the // point or object of interest is sampled more. type FocusPoint interfac...
/* * Copyright 2019 the go-netty project * * 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...
// Copyright 2015 The Tango 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 session import ( "net/http" "net/url" "sync" "time" ) // Tracker provide and set sessionid type Tracker interface { SetMaxAge(maxAge time.Dura...
package main import ( "image" "image/png" "log" "math" "os" "github.com/unixpickle/essentials" "github.com/unixpickle/model3d/model3d" "github.com/unixpickle/model3d/render3d" "github.com/unixpickle/model3d/toolbox3d" ) const ( HolderRadius = 0.3 HolderThickness = 0.1 HolderHeight = 2.0 MinTotalS...
package codechallenge_test import ( "crypto/x509" "fmt" "github.com/smartedge/codechallenge" "github.com/smartedge/codechallenge/deps" "github.com/smartedge/codechallenge/testtools" "github.com/smartedge/codechallenge/testtools/mocks" "regexp" "testing" ) const ( UsageMessageBody = "\n -help\n" + " \td...
package compiler import ( "bytes" "fmt" "path" "path/filepath" "runtime" "text/template" "github.com/Masterminds/sprig" "github.com/vsariola/sointu" "github.com/vsariola/sointu/vm" ) type Compiler struct { Template *template.Template OS string Arch string Output16Bit bool RowSync ...
package utils import ( "crypto/aes" "crypto/cipher" "crypto/md5" crand "crypto/rand" "encoding/hex" "fmt" "io" "math/rand" "os" "os/exec" "os/user" "reflect" "strconv" "strings" "time" "github.com/sergi/go-diff/diffmatchpatch" ) func init() { rand.Seed(time.Now().UnixNano()) } var letterRunes = []r...
package trojan import ( "fmt" "github.com/gobuffalo/packr/v2" "net" "strconv" "strings" "time" "trojan/core" "trojan/util" ) var ( dockerInstallUrl1 = "https://get.docker.com" dockerInstallUrl2 = "https://git.io/docker-install" dbDockerRun = "docker run --name trojan-mariadb --restart=always -p %d:33...
package scanner import ( "fmt" "golox/parseerror" "golox/token" "strconv" ) var keywords = map[string]token.Type{ "and": token.AND, "class": token.CLASS, "else": token.ELSE, "false": token.FALSE, "for": token.FOR, "fun": token.FUN, "if": token.IF, "nil": token.NIL, "or...
package traverser import ( "fmt" "reflect" ) // New traversal code is derivative of https://gist.github.com/hvoecking/10772475 // MIT License; Copyright (c) 2014 <NAME> - See LICENSE for full license const ( opNoop = iota opSet opUnset opSkip opSplice ) // Traverser is the main type and contains the Map & No...