text
stringlengths
3.08k
10.4k
// +build e2e /* Copyright 2020 The Tekton 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 collector import ( "fmt" "strings" "time" "github.com/NobleD5/modbus_exporter/pkg/master" "github.com/NobleD5/modbus_exporter/pkg/structures" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/prometheus/client_golang/prometheus" ) // Collector structure type Collector struct ...
package clientman import ( "sync" "time" "github.com/aler9/gortsplib" "github.com/aler9/gortsplib/pkg/base" "github.com/aler9/rtsp-simple-server/internal/client" "github.com/aler9/rtsp-simple-server/internal/logger" "github.com/aler9/rtsp-simple-server/internal/pathman" "github.com/aler9/rtsp-simple-server/i...
package alicloud import ( "fmt" "time" "github.com/alibaba/terraform-provider/alicloud/connectivity" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/services/ess" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" ) fu...
package cmd import ( "fmt" "io" "io/ioutil" "os" "os/exec" "strings" "time" "github.com/Benchkram/errz" "github.com/hpcloud/tail" "github.com/puppetlabs/wash/api/client" apitypes "github.com/puppetlabs/wash/api/types" "github.com/puppetlabs/wash/cmd/internal/config" cmdutil "github.com/puppetlabs/wash/cm...
package dao import ( "context" "github.com/derailed/k9s/internal/client" "github.com/derailed/k9s/internal/config" "github.com/derailed/k9s/internal/render" "github.com/itchyny/gojq" "github.com/rs/zerolog/log" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ...
package engine // zobrist.go contains an interface for creating and incrementally updating // the zobrist hash value of a given position. // // https://www.chessprogramming.org/Zobrist_Hashing const ( // A constant representing the value to use when seeding the random // numbers generated for zobrist hashing. Zobr...
package main import ( "flag" "fmt" "github.com/cokemine/ServerStatus-goclient/pkg/status" jsoniter "github.com/json-iterator/go" "log" "net" "os" "strconv" "strings" "time" ) var ( SERVER = flag.String("h", "", "Input the host of the server") PORT = flag.Int("port", 35601, "Input the port of the ser...
// Copyright © 2019 The Knative 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 reid import ( "github.com/skyhookml/skyhookml/skyhook" "github.com/skyhookml/skyhookml/exec_ops" "github.com/skyhookml/skyhookml/exec_ops/pytorch" "fmt" "io/ioutil" "log" "os" "os/exec" "path/filepath" "strconv" ) type Params struct { skyhook.PytorchTrainParams // MatchLengths should be TrackDura...
package filters import ( "gitee.com/andrewgithub/FireShotGo/firetheme" "github.com/golang/freetype/truetype" "github.com/golang/glog" "golang.org/x/image/font" "golang.org/x/image/math/fixed" "image" "image/color" "strings" ) // DPI constant. Ideally it would be read from the various system. const DPI = 96 t...
package main import ( "context" "encoding/json" "errors" "flag" "fmt" "io/ioutil" "log" "os" "os/signal" "strings" "sync" "syscall" "github.com/fatih/color" "github.com/miekg/dns" ) const ( keyHostname = "hostname" keyPriority = "priority" keyTTL = "ttl" keyValue = "value" ) var ( addr, ...
/* 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 ...
/* Package server provides basic wrapping for go web server. Supporting: * Context derived from base context for each request * Named routing and url reversing * Middleware supports * Server graceful shutdown * Restful resource for json restful api */ package server import ( "html/template" "net/http" "ti...
package main import ( "fmt" "image" "image/color" "image/png" "log" "os" ) const ( eachBlockLong int = 10 ) // QrBlock 颜色快 type QrBlock struct { long int isBlack bool } func main() { // input versionNum := 8 tagPathName := "tagQrImage.png" // input end whiteBlock, blackBlock := QrGodeInit() this...
/* * Copyright (c) 2013-2014 Conformal Systems <<EMAIL>> * * This file originated from: http://opensource.conformal.com/ * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice...
// Copyright 2017 <NAME>. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. package amass import ( "bufio" "errors" "io" "io/ioutil" "log" "strings" "time" "github.com/OWASP/Amass/amass/core" "github.com/OWASP/Amass/amass/dnssrv" "github....
package config import ( "context" "github.com/owncloud/ocis/v2/ocis-pkg/shared" ) type Config struct { Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service Service Service `yaml:"-"` Tracing *Tracing `yaml:"tracing"` Log *Log `yaml:"log"` D...
// Copyright 2020 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 pid import ( "gonum.org/v1/plot/plotter" "math" "testing" "time" "github.com/stretchr/testify/assert" "gonum.org/v1/plot" "gonum.org/v1/plot/plotutil" "gonum.org/v1/plot/vg" ) // simulatedClock provides us control over the exact time and seconds to advance by. type simulatedClock struct { t time.Tim...
package gocore import "github.com/randall77/corelib/core" // A region is a piece of the virtual address space of the inferior. // It has an address and a type. // Note that it is the type of the thing in the region, // not the type of the reference to the region. type region struct { p *Process // TODO: can we rem...
// Copyright (c) 2018 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
// Copyright (c) 2016 Intel Corporation. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package hsm import ( "fmt" "math/rand" "time" "golang.org/x/net/context" "github.com/wastore/go-lustre" "github.com/wastore/go-lustre/llapi" "g...
package nodes import ( "crypto/sha256" _ "embed" "fmt" "math" "strings" "time" "go.mondoo.com/mondoo-operator/api/v1alpha2" "go.mondoo.com/mondoo-operator/pkg/utils/k8s" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io...
package webserver import ( "context" "fmt" "net/http" "regexp" "sort" "strconv" capsulev1alpha1 "github.com/clastix/capsule/api/v1alpha1" "github.com/gorilla/mux" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" ...
// This is the core implementation of the worker. package worker import ( "context" "errors" "fmt" "time" "github.com/cenkalti/backoff/v3" "github.com/go-logr/logr" tcclient "github.com/taskcluster/taskcluster/v41/clients/client-go" "github.com/taskcluster/taskcluster/v41/clients/client-go/tcqueue" "github....
package internal import ( "bytes" "fmt" "path/filepath" "strings" "github.com/phrase/phrase-cli/cmd/internal/paths" "github.com/phrase/phrase-cli/cmd/internal/placeholders" "github.com/phrase/phrase-cli/cmd/internal/shared" "github.com/phrase/phrase-go/v2" "github.com/spf13/viper" ) type Targets []*Target ...
package ec2 import ( "encoding/csv" "fmt" "log" "sync" "github.com/afeeblechild/aws-go-tool/lib/utils" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" ) type InstanceOptions struct { Tags []string } type RegionInstances struct { AccountId str...
// 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, ...
// // Copyright 2019-2020 Nestybox, 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
/******************************************************************************* * Copyright 2019 Dell Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licen...
package polarion import ( "bytes" "encoding/json" "encoding/xml" "fmt" "io/ioutil" "mime/multipart" "net/http" "regexp" "github.com/jstemmer/go-junit-report/formatter" ) const ( XunitEndpoint = "/xunit" JobQueueEndpoint = "/xunit-queue" idRegex = "^(?:.+)*?([A-Z][0-9]{2}).*$" ) type PolarionXUnit st...
package main import ( "fmt" "os" "path/filepath" "strconv" "strings" "github.com/david-biro/rtpdump/codecs" "github.com/david-biro/rtpdump/log" "github.com/david-biro/rtpdump/rtp" "github.com/urfave/cli" ) type dumpOptions struct { codecMetadata codecs.CodecMetadata rtpStreams []*rtp.RtpStream streamI...
package live import ( "database/sql" "errors" "fmt" "io/fs" "io/ioutil" "strings" "unicode" "getsturdy.com/api/pkg/comments" db_comments "getsturdy.com/api/pkg/comments/db" db_snapshots "getsturdy.com/api/pkg/snapshots/db" "getsturdy.com/api/pkg/workspaces" "getsturdy.com/api/vcs/executor" ) func context...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package inspector 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/inspector-2016-02-16/ListAssessmentRunsRequest type ListAssessm...
package ginalexa import ( "github.com/gin-gonic/gin" echoRequest "github.com/go-alexa/alexa/parser" echoResponse "github.com/go-alexa/alexa/response" "github.com/nicksnyder/go-i18n/i18n" ) const ( EventOnLaunch = "OnLaunch" EventOnIntent = "OnIntent" EventOnSessionEnded = "OnSessionEnded" EventOnA...
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
// Copyright © 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 // // Unless required by applicable law or agreed...
// Copyright 2018 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 main import ( "bufio" "encoding/base64" "flag" "fmt" "httpt" "log" "net" "net/http" "net/http/httputil" "strings" ) var secretLink = flag.String("secret-link", "secretLink", "TODO") // TODO: description var debug = flag.Bool("debug", true, "Enable debug output. Default: TODO.") // TODO var...
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" smithy "github.com/awslabs/smithy-go" "github.com/awslabs/smithy-...
package main import ( "github.com/andy-zhangtao/logchain/logging" "fmt" "sync" "github.com/docker/docker/daemon/logger" "io" "path/filepath" "os" "github.com/pkg/errors" "github.com/docker/docker/daemon/logger/jsonfilelog" "syscall" "github.com/tonistiigi/fifo" "context" "encoding/binary" protoio "github...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: add_object_to_group.proto package identityd2 import ( fmt "fmt" _ "github.com/envoyproxy/protoc-gen-validate/validate" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ =...
package test import ( "context" "strings" "time" ) var _ = time.Second type GomodelInsertBuilder struct { db *GomodelDB table string values []*Gomodel fields []string } func newGomodelInsertBuilder(db *GomodelDB) *GomodelInsertBuilder { return &GomodelInsertBuilder{ db: db, table: GomodelTable...
package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" "os" "sort" "strings" ) const ( username = "Administrator" password = "<PASSWORD>" ) const ( indexerURL = "http://127.0.0.1:9000/settings/indexes" queryURL = "http://127.0.0.1:9499/query/service" ) func init() { setIndexerMode() fireQ...
package stream import ( "fmt" "io" "io/ioutil" "github.com/tealeg/xlsx/v3" log "github.com/sirupsen/logrus" ) type xlsxStream struct { workBook *xlsx.File sheets map[string]*xlsxSheet } type xlsxSheet struct { idx int sheet *xlsx.Sheet name string } type xlsxRow struct { idx int empty bool va...
package main import ( "context" "fmt" "net" "strings" "testing" "time" "unicode" "google.golang.org/grpc" "grpc_complex_app_name/internal/gen/pkg/servers/gateway" "grpc_complex_app_name/internal/gen/pkg/servers/gateway/encoder_backend" ebpb "grpc_complex_app_name/internal/gen/pb/encoder_backend" pb "grpc...
// Copyright 2019 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 ui import ( "context" "fmt" "time" "chromiumos/tast/common/perf" "chromiumos/tast/ctxutil" "chromiumos/tast/errors" "chromiumos/tast/l...
package util import ( "log" "fmt" "os" "strings" "io/ioutil" "encoding/json" "gopkg.in/yaml.v3" "strconv" "os/exec" ) type Text struct { lines []string } func GetHomeDir() string { home,err := os.UserHomeDir() if err != nil { log.Fatal(err) } return home } func FindIDFile() (string,strin...
package format import ( "testing" "github.com/stretchr/testify/assert" ) func TestSplit(t *testing.T) { list, err := split("A") assert.Nil(t, err) assert.Equal(t, []string{"A"}, list) list, err = split("goZero") assert.Nil(t, err) assert.Equal(t, []string{"go", "Zero"}, list) list, err = split("Gozero") ...
// Code generated by sqlabble, DO NOT EDIT. package qux import ( "database/sql" "strings" "github.com/sqlabble/sqlabble" "github.com/sqlabble/sqlabble/stmt" ) // ArticleDB Article table type ArticleDB struct { Table stmt.Table TableAlias stmt.TableAlias BoolColumn stmt.Column Boo...
package image import ( "embed" "errors" "log" "path/filepath" "strings" "sync" "github.com/dgraph-io/ristretto" "github.com/docker/go-units" "github.com/sheerun/queue" ) var ErrNotFound = errors.New("not found") var ErrNotAnImage = errors.New("not a supported image extension, might be video") type ImageId ...
/* Copyright 2020 The Knative 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
// Code generated by smithy-go-codegen DO NOT EDIT. package s3 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/s3/types" smithy "github.com/awslabs/smithy-go" "github.com/awslabs/smithy-go/middlewar...
package utils import ( "fmt" "io" "io/fs" "io/ioutil" "log" "net/http" "os" "strings" "github.com/TwinProduction/go-color" "github.com/anaskhan96/soup" "github.com/jung-kurt/gofpdf" ) // Message ... Function that allows you to display many messages, such as errors, etc. // - str(string): Content of the m...
package infrastructure import ( "bytes" "errors" "fmt" "os" "sync" "text/template" "time" "flamingo.me/flamingo/v3/core/locale/domain" "flamingo.me/flamingo/v3/framework/config" "flamingo.me/flamingo/v3/framework/flamingo" "github.com/nicksnyder/go-i18n/i18n/bundle" ) // TranslationService is the default ...
package main import ( "fmt" "net/http" "sort" "sync" "time" "github.com/lxc/lxd/lxd/cluster" "github.com/lxc/lxd/lxd/db" "github.com/lxc/lxd/lxd/db/query" "github.com/lxc/lxd/lxd/state" "github.com/lxc/lxd/lxd/util" "github.com/lxc/lxd/shared" "github.com/lxc/lxd/shared/api" "github.com/lxc/lxd/shared/lo...
package yort import ( "bufio" "bytes" "encoding/binary" "encoding/hex" "fmt" "io" "io/ioutil" "net/http" "github.com/carbonblack/mockc2/internal/log" "github.com/carbonblack/mockc2/pkg/protocol" ) // TODO since HTTP is stateless we really need command queuing in order to send // commands to the agent when ...
/* 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, ...
//go:build gofuzz // +build gofuzz /* Copyright 2021 The Vitess 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 ...
package exec import ( "bytes" "context" "fmt" "sort" "time" "github.com/x-mod/routine" ) const maxNum = 1000000 //ReportData struct type ReportData struct { AvgTotal float64 Fastest float64 Slowest float64 Average float64 Ops float64 AvgDelay float64 DelayMax float64 DelayMin float64 Lats ...
package runtime // Inspired from https://github.com/google/starlark-go/blob/70c0e40ae1287fd2c0aa43184b482838d8db051d/repl/repl.go import ( "context" "errors" "fmt" "io" "os" "os/signal" "strings" "github.com/alecthomas/chroma/v2" "github.com/alecthomas/chroma/v2/formatters" "github.com/alecthomas/chroma/v2...
package generator import "html/template" const templateRule = `{ "if": { "allOf": [ { "field": "location", "in": "[parameters('resourceLocation')]" }, { "field": "type", "equals": "{{.ResourceType}}" } ...
package relationships import ( "errors" "fmt" "github.com/bor3ham/reja/schema" ) type ForeignKey struct { RelationshipStub Key string ColumnName string Type string Nullable bool Default func(schema.Context, interface{}) Pointer } func (fk ForeignKey) GetKey() string { return fk.Key } func...
// Copyright (c) 2017 Cisco and/or its affiliates. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
package cmd import ( "github.com/rsteube/carapace" "github.com/rsteube/carapace-bin/pkg/actions/tools/git" "github.com/spf13/cobra" ) var pullCmd = &cobra.Command{ Use: "pull", Short: "Fetch from and integrate with another repository or a local branch", Run: func(cmd *cobra.Command, args []string) {}, } fu...
package main import ( "fmt" "log" "net/http" "github.com/jcuga/golongpoll" ) func main() { manager, err := golongpoll.StartLongpoll(golongpoll.Options{ LoggingEnabled: true, // NOTE: if not defined here, other options have reasonable defaults, // so no need specifying options you don't care about }) if e...
package talk import ( "fmt" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/golang/protobuf/proto" "github.com/juju/errors" "github.com/thingio/edge-core/common/conf" "github.com/thingio/edge-core/common/log" "github.com/thingio/edge-core/common/proto/talk" "time" ) type TMsgHandler func(path string, p...
package replay import ( "bytes" "crypto/tls" "io" "log" "net" "os" "strconv" "strings" "time" "github.com/fsnotify/fsnotify" ) // Request - main struct that holds replay request/response data type Request struct { ID string // The ID as displayed in the table Host string // the destinat...
package manifest import ( "fmt" "path" "strings" "github.com/docker/buildx/util/platformutil" v1 "github.com/opencontainers/image-spec/specs-go/v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type DeploymentOp...
package session import ( "fmt" "unsafe" "github.com/pkg/errors" iscsidsc "github.com/wk8/go-win-iscsidsc" "github.com/wk8/go-win-iscsidsc/internal" ) var procGetIScsiSessionListW = internal.GetDllProc("GetIScsiSessionListW") // GetIScsiSessionList retrieves the list of active iSCSI sessions. // see https://doc...
package morningstarit import ( "context" "fmt" "net/http" "github.com/PuerkitoBio/goquery" "github.com/mmbros/quotes/internal/quotegetter" "github.com/mmbros/quotes/internal/quotegetter/scrapers" ) // scraper gets stock/fund prices from www.morningstar.it type scraper struct { name string client *http.Clie...
package mqtt import ( "strconv" "strings" ) /////////////////////////////////////////////////////////////////////////////// type Subscription struct { ctx *Context // topic string topic *Topic qos byte next, prev *Subscription } func NewSubscription(ctx* Context, qos byte) (*Subscription){ sub := new...
package unreconciled import ( "fmt" "github.com/keep94/finance/apps/ledger/common" "github.com/keep94/finance/fin" "github.com/keep94/finance/fin/categories" "github.com/keep94/finance/fin/findb" "github.com/keep94/goconsume" "github.com/keep94/toolbox/db" "github.com/keep94/toolbox/http_util" "html/template"...
// Copyright (c) 2020-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package server import ( "context" "strings" "github.com/mattermost/mattermost-server/v5/mlog" "github.com/mattermost/matterwick/model" "github.com/google/go-github/v32/github" ) func (s *Server) han...
package inspect import ( "bytes" "fmt" "log" "os/user" "sync" "github.com/gyuho/linux-inspect/proc" "github.com/gyuho/dataframe" "github.com/olekukonko/tablewriter" ) // SSEntry is a socket entry. // Simplied from 'NetTCP'. type SSEntry struct { Protocol string Program string State string PID int...
/* * Copyright (c) 2020 Cossack Labs Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
// Copyright 2019 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 apps provides general ChromeOS app utilities. package apps import ( "context" "chromiumos/tast/errors" "chromiumos/tast/local/chrome" ...
package updates import ( "context" "sync" "time" "golang.org/x/xerrors" "github.com/gotd/td/tg" "go.uber.org/atomic" "go.uber.org/zap" ) const ( idleTimeout = time.Minute * 15 fastgapTimeout = time.Millisecond * 500 diffLimitUser = 100 diffLimitBot = 100000 ) // Engine deals with gaps. type Engine...
/* Copyright 2019 The KubeCarrier 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 scrape import ( //"crypto/tls" //"fmt" "go-MyVIT/api/Godeps/_workspace/src/github.com/PuerkitoBio/goquery" "io/ioutil" //"log" "net/http" //"net/http/cookiejar" "net/url" //"os" //"os/exec" //"path/filepath" "strings" ) type Attendance2 struct { Attend map[string]SubjectAttendance `json:"attendan...
package patrol import ( "fmt" "io/ioutil" "strings" "time" "github.com/karimsa/patrol/internal/checker" "github.com/karimsa/patrol/internal/history" "github.com/karimsa/patrol/internal/logger" "gopkg.in/yaml.v2" ) type checkCmd string func (cmd *checkCmd) String() string { return string(*cmd) } func (cmd *...
// Code generated by entc, DO NOT EDIT. package ent import ( "fmt" "strings" "github.com/facebookincubator/ent/dialect/sql" "github.com/knabben/ggql/ent/fieldtype" ) // FieldType is the model entity for the FieldType schema. type FieldType struct { config `json:"-"` // ID of the ent. ID int `json:"id,omitemp...
// Copyright 2012-2013 <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bufio" "flag" "fmt" "io" "log" "os" "strconv" "strings" ) const kInitSentLength = 256 const separator = `\^` var specialChars = [...
package openshiftadmission import ( "bytes" "io" "io/ioutil" "os" "reflect" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/apis/apiserver" configv1 "github.com/openshift/api/config/v1" oadmission "github.com/openshift/origin/pkg...
package gen import ( "bytes" "fmt" "hash/fnv" "io" "path" "reflect" "sort" "strings" ) const basic = "github.com/reddyvinod/partialencode/basic" // PartialGenerator generates the requested marshaler/unmarshalers. type PartialGenerator struct { out *bytes.Buffer pkgName string pkgPath string buildT...
// Copyright (c) 2020 10X Genomics, Inc. All rights reserved. // Implements string interning for the parser. package syntax import ( "bytes" "unicode/utf8" ) type stringIntern struct { internSet map[string]string } // makeStringIntern creates a stringIntern object, prepopulated with string // constants which ar...
// +build ignore /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributio...
package transport import ( "bufio" "errors" "fmt" "io" "net/http" "os" ) // ReadSeekCloser combines io.ReadSeeker with io.Closer. type ReadSeekCloser interface { io.ReadSeeker io.Closer } // NewHTTPReadSeeker handles reading from an HTTP endpoint using a GET // request. When seeking and starting a read from ...
// This source file is part of the EdgeDB open source project. // // Copyright 2020-present EdgeDB Inc. and the EdgeDB 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 // // h...
package service import ( "fmt" "net/http" "net/http/httptest" "os" "strings" "testing" "github.com/WatchBeam/clock" eeservice "github.com/fleetdm/fleet/v4/ee/server/service" "github.com/fleetdm/fleet/v4/server/config" "github.com/fleetdm/fleet/v4/server/fleet" "github.com/fleetdm/fleet/v4/server/ptr" kitl...
package telnyx var FakeErrorResponse = `{ "errors":[ { "code":"10006", "title":"Invalid resource ID", "detail":"The provided resource ID was invalid", "source":{ "pointer":"/id" }, "meta":{ "url":"https://developers.telnyx.com/docs/api/v2/overview/errors/10006" } } ] }` var FakeMessagi...
// Copyright 2019 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 a...
// Copyright (C) 2020 Storj Labs, Inc. // See LICENSE for copying information. // Package testcontext implements convenience context for testing. package testcontext import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "runtime" "strings" "sync" "time" "golang.org/x/sync/errgroup" "storj.io/common/m...
package frame // Copyright (c) 2018 Bhojpur Consulting Private Limited, India. All rights reserved. // 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...
package utils import ( "fmt" "net" "os" "strconv" "time" ) func ping(host string) int { count := 3 size := 4 timeout := 32 neverstop := false cname, _ := net.LookupCNAME(host) starttime := time.Now() conn, err := net.DialTimeout("ip4:icmp", host, time.Duration(timeout*1000*1000)) checkError(err) ip := c...
package storage import ( "encoding/binary" "math" "github.com/john-nguyen09/phpintel/internal/lsp/protocol" ) // PutUInt64 appends an uint64 to the byte slice func PutUInt64(dst []byte, v uint64) []byte { return append(dst, byte(v>>56), byte(v>>48), byte(v>>40), byte(v>>32), byte(v>>24), byte(v>>16), byte(v>>8),...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iotsitewise import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) type ListGatewaysInput struct { _ struct{} `type:"structure"` // The...
package main import ( "context" "regexp" "encoding/csv" "encoding/json" "fmt" "io" "log" "os" "reflect" "strings" "time" "github.com/cheggaaa/pb" "github.com/jawher/mow.cli" "github.com/olivere/elastic/v7" "golang.org/x/sync/errgroup" ) var Version string func removeLBR(text string) string { re :...
package main import ( "bytes" "fmt" ) // *练习6.4: // 实现一个Elems方法,返回集合中的所有元素,用于做一些range之类的遍历操作。 type IntSet struct { words []uint64 } // Len return the number of elements func (s *IntSet) Len() int { n := len(s.words) cnt := 0 for i := 0; i < n; i++ { for j := 0; j < 64; j++ { if s.words[i]&(1<<j) != 0 { ...