text
stringlengths
3.08k
10.4k
/* Copyright 2019 The Skaffold 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 `bcpfilter` implements mechanisms to reject combinations of services and org units. It can be used to avoid meaningless directories. The interface `OrgServiceFilter` is used by other packages to test whether to `Accept(service, orgUnit)`. `DecidersFilter` implements the interface as an array of `Decider` ...
package dblog import ( "context" "errors" "fmt" "io" "sync" "github.com/jackc/pgconn" "github.com/jackc/pglogrepl" "github.com/jackc/pgx/v4" "github.com/rueian/pgcapture/pkg/pb" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) type SourceDumper interface { LoadDu...
package graphql_test // This test takes a specification and runs GraphQL queries, comparing the output of the query to what is expected. // To add a new test: // 1. Add a new directory in the tests directory. Name it after the query/mutation you are testing. // 2. Add a data.json file to the dir you created. The data ...
package localplan import ( "context" "crypto/sha256" "encoding/json" "fmt" "github.com/oats87/rancher-agent/pkg/applyinator" "github.com/oats87/rancher-agent/pkg/types" "github.com/sirupsen/logrus" "io/ioutil" "os" "path/filepath" "sort" "strings" "time" ) func WatchFiles(ctx context.Context, applyinator...
package snmpfetcher import ( "fmt" "github.com/soniah/gosnmp" "strconv" "time" ) const systemmib_BASE = ".1.3.6.1.2.1.1" const interfaces_BASE = ".1.3.6.1.2.1.2" const hrSystem_BASE = ".1.3.6.1.2.1.25.1" const hrStorage_BASE = ".1.3.6.1.2.1.25.2" const hrDevice_BASE = ".1.3.6.1.2.1.25.3" const mib2_ifmib_BASE = "...
// Copyright 2021 Northern.tech AS // // 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 hashkit import ( "crypto/md5" "fmt" "sort" "sync" "sync/atomic" "overlord/pkg/log" ) const ( _pointsPerServer = 160 _maxHostLen = 64 ) type nodeHash struct { node string hash uint } type tickArray struct { nodes []nodeHash length int } func (p *tickArray) Len() int { return p.l...
package cmd import ( "fmt" "os" "path/filepath" "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/spf13/cobra" "github.com/spf13/viper" amino "github.com/tendermint/go-amino" cfg "github.com/tendermint/tendermint/config" cmn "github.com/tendermint/tendermint/libs/common" tmtime "github.com/te...
package app import ( "errors" "fmt" "log" "net/http" "os" "strings" "github.com/gorilla/handlers" "github.com/openebs/jiva/backend/dynamic" "github.com/openebs/jiva/backend/file" "github.com/openebs/jiva/backend/remote" "github.com/openebs/jiva/controller" "github.com/openebs/jiva/controller/rest" "githu...
package blizzard_api_call import ( "encoding/json" "fmt" "net/http" "os" "sync/atomic" "time" "github.com/hschimke/WorldOfWarcraft_CraftingProfitCalculator-go/pkg/globalTypes" "github.com/hschimke/WorldOfWarcraft_CraftingProfitCalculator-go/pkg/globalTypes/BlizzardApi" ) const ( allowed_connections_per_peri...
/* channel: chan is a bidirectional pipeline used in goroutine for comminication or exchange data. goroutine: goroutine is a concurreny technology in go, it build an abstract layer on os level thread, user use goroutine not directly manage thread, user manage goroutine, go runtime would scheduler goroutine run on syste...
package plugin import ( "context" "encoding/json" "errors" "fmt" "net/url" "time" pb "github.com/e-dard/influxdb-iox-grafana/pkg/iox/github.com/influxdata/iox/management/v1" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt" "github.com/grafana...
package main import ( "github.com/hajimehoshi/ebiten/v2" "github.com/jakecoffman/cp" "github.com/jakecoffman/cpebiten" "log" "math" ) const ( screenWidth = 600 screenHeight = 480 ) const ( PlayerVelocity = 500.0 PlayerGroundAccelTime = 0.1 PlayerGroundAccel = PlayerVelocity / PlayerGroundAccelTime ...
package main import ( "fmt" "io/ioutil" "log" "os" "path" "strings" "time" vault "github.com/hashicorp/vault/api" "github.com/pkg/errors" "github.com/spf13/pflag" ) const ( defaultRetries = 5 defaultRole = "demo" defaultKubernetesTokenPath = "/var/run/secrets/kubernetes.io/ser...
package x509 import ( "crypto/dsa" "crypto/ecdsa" "crypto/rsa" "encoding/json" "fmt" "time" "github.com/dadrian/downgrade-check/ztools/x509/pkix" ) func (k KeyUsage) MarshalJSON() ([]byte, error) { enc := make(map[string]interface{}) enc["value"] = int(k) if k&KeyUsageDigitalSignature > 0 { enc["digital_...
// // Copyright (c) 2019 <NAME> // MIT License // // more info: https://github.com/stefaanc/terraform-provider-windows // package api import ( "bytes" "errors" "fmt" "encoding/json" "log" "strings" "github.com/stefaanc/golang-exec/runner" "github.com/stefaanc/golang-ex...
package json2go import ( "fmt" "sort" "strings" ) func extractCommonSubtrees(root *node) []*node { rootNames := map[string]bool{ root.name: true, } extractedSize := 0 nodes := []*node{root} for len(nodes) != extractedSize { extractedSize = len(nodes) result := nodes for _, n := range nodes { extNo...
package main import ( "database/sql" "log" "time" // Underscore means only import for // the initialization effects. // Without it, Go will throw an // unused import error since the mysql+postgres // import only registers a database driver // and we use the generic sql.Open() "bufio" "fmt" _ "github.com/g...
// Copyright © 2019 <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 client import ( "io/ioutil" "time" "com/models" "strings" "os" "bufio" "io" "com/utils" "strconv" "sync" "path/filepath" "com/logger" ) //缓存归档数据文件后缀 var CACHE_ARCHIVE_DATA_FILE_SUFFIX = ".data"; //缓存归档索引文件后缀 var CACHE_ARCHIVE_INDEX_FILE_SUFFIX = ".index"; var PROPERTY_DATA_CACHE_DIR string func...
package libxml import ( "errors" "fmt" "reflect" "strconv" "github.com/jbowtie/gokogiri/xml" ) const nsCleanParseOption = xml.XML_PARSE_RECOVER | xml.XML_PARSE_NONET | xml.XML_PARSE_NOERROR | xml.XML_PARSE_NOWARNING | xml.XML_PARSE_NSCLEAN // ErrNoRoot is thrown when no root XMLName field is found var ErrN...
package po import ( "database/sql" "fmt" "github.com/captainlee1024/go-gateway/internal/pkg/public" "github.com/captainlee1024/go-gateway/internal/proxy_service/reverse_proxy/loadbalance" "github.com/captainlee1024/go-gateway/internal/proxy_service/settings" "github.com/gin-gonic/gin" "net" "net/http" "string...
/* Package instruments allows you to collects metrics over discrete time intervals. Collected metrics will only reflect observations from last time window only, rather than including observations from prior windows, contrary to EWMA based metrics. Instruments support two types of instruments: Discrete instruments ret...
package main import ( "flag" "log" "net" "net/http" "os" "sync" "time" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/google/gopacket/pcap" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) var mu sync.Mutex const (...
package provider import ( "context" "crypto/tls" "fmt" "io" "os" "os/signal" "sync" "syscall" "github.com/gookit/gcli/v3" dockerterm "github.com/moby/term" gwrest "github.com/ovrclk/akash/provider/gateway/rest" cutils "github.com/ovrclk/akash/x/cert/utils" dcli "github.com/ovrclk/akash/x/deployment/clien...
/* Copyright © 2020 The k3d Author(s) 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,...
// Copyright 2016 The LUCI 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...
package compose import ( "context" "errors" "fmt" "os" "path/filepath" "regexp" "strings" "testing" "time" "strconv" "github.com/docker/libcompose/docker" "github.com/docker/libcompose/docker/ctx" "github.com/docker/libcompose/project" "github.com/docker/libcompose/project/options" ) // docker-compose...
package kcl import ( "bufio" "encoding/json" "io/ioutil" "log" "os" "github.com/pkg/errors" ) var defaultLogger = log.New(ioutil.Discard, "", log.LstdFlags) type KCLProcess interface { Run() error } // Record format comes from https://github.com/awslabs/amazon-kinesis-client/blob/master/amazon-kinesis-clien...
// Copyright 2017-2018 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 ...
// 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 server implements the http frontend package server import ( "fmt" "net/http" "net/url" "path" "github.com/dimfeld/httptreemux" "github.com/go-spatial/tegola/atlas" "github.com/go-spatial/tegola/internal/log" ) const ( // MaxTileSize is 500k. Currently just throws a warning when tile // is larger...
/* Copyright (c) 2016 <NAME> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions an...
package protocode import ( "fmt" "regexp" "strings" "github.com/kindermoumoute/adventofcode/pkg" ) const ( NOP = "nop" ACC = "acc" JMP = "jmp" ADD = "add" MUL = "mul" IN = "in" OUT = "out" NON_ZERO = "ifnz" ZERO = "ifz" LT = "lt" EQ = "eq" // don't ...
// Copyright 2018 Tetrate, 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 applicab...
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use ...
//go:generate jsonenums -type=RequestStatus package webhookrelay import ( "encoding/json" "net/http" "net/url" "strconv" "time" "github.com/pkg/errors" ) // default statuses const ( RequestStatusPreparing RequestStatus = iota RequestStatusSent RequestStatusFailed RequestStatusStalled // if request destinat...
package db import ( "context" "fmt" "os" "time" "github.com/jackc/pgx/v4/pgxpool" ) const ( //sorry if this is ugly its just more readable to me :( dropShort string = "DROP TABLE IF EXISTS shortener;" dropVisit string = "DROP TABLE IF EXISTS visits;" shortenerTable string = `CREATE TABLE IF NOT EX...
package mqttpubsub import ( "crypto/tls" "crypto/x509" "io/ioutil" "encoding/json" "fmt" "sync" "time" log "github.com/sirupsen/logrus" "github.com/brocaar/loraserver/api/gw" "github.com/brocaar/lorawan" "github.com/eclipse/paho.mqtt.golang" ) // Backend implements a MQTT pub-sub backend. type Backend str...
package cloud import ( "bytes" "encoding/json" "fmt" "strings" "text/template" "github.com/go-resty/resty/v2" "go.uber.org/zap" ) type GraphQuery struct { Query string `json:"query"` OperationName string `json:"operationName,omitempty"` Variables string `json:"variables,omitempty"` } type File...
// Package apherror provides a consistent way to handler JSONAPI // related http errors. package apherror import ( "encoding/json" "net/http" "strconv" "github.com/spacemonkeygo/errors" "github.com/spacemonkeygo/errors/errhttp" ) var ( //HTTPError represents generic http errors Errhttp = errors.NewClass("HTTP...
// Copyright 2020 The Moov Authors // Use of this source code is governed by an Apache License // license that can be found in the LICENSE file. package wire import ( "encoding/json" "strings" ) // FIIntermediaryFI is the financial institution intermediary financial institution type FIIntermediaryFI struct { // t...
package resource import ( "errors" "testing" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" "gopkg.in/routeros.v2" "gopkg.in/routeros.v2/proto" "github.com/ogi4i/mikrotik-exporter/collector/context" "github.com/ogi4i/mikrotik-exporter/metrics" "github.com/ogi4i/mikrot...
package linker import ( "fmt" "go/parser" "go/token" "io/ioutil" "os" "strings" set "github.com/scylladb/go-set" "github.com/sirupsen/logrus" ) // Linker defines the link pkg config type Linker struct { GoPath string RepoPath string FullPath string } func init() { initLogLevel() } var ( scannedRepo ...
// Copyright 2017 <NAME>. All rights reserved. package apns2mock import ( "crypto/tls" "crypto/x509" "errors" "net/http" "net/http/httptest" "sync/atomic" "time" "net" "log" "golang.org/x/net/http2" ) // APNS default root URL path. const RequestRoot = "/3/device/" // CommsCfg can be used to configure comm...
// 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 ( "encoding/json" "fmt" "os" "time" "github.com/go-resty/resty/v2" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) type SingleCityWeather struct { Coord struct { Lon float64 `json:"lon"` Lat float64 `json:"lat"` } `json:"coord"` Weather []struct { ...
package band import ( "time" "github.com/brocaar/lorawan" ) // see: https://lora-developers.semtech.com/library/tech-papers-and-guides/physical-layer-proposal-2.4ghz type ism2400Band struct { band } func (b *ism2400Band) Name() string { return "ISM2400" } func (b *ism2400Band) GetDefaults() Defaults { return ...
// 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 ag...
package main import ( "context" "flag" "fmt" "os" "os/signal" "runtime" "syscall" "github.com/go-logr/glogr" "github.com/go-logr/logr" "github.com/golang/glog" "github.com/vshn/wrestic/kubernetes" "github.com/vshn/wrestic/restic" "github.com/vshn/wrestic/stats" ) const ( commandEnv = "BACKUPCOMMAND_...
package vfs import ( "errors" "io" "github.com/shyang107/paw" ) type ViewType int const ( // ViewList is the option of list view using in PrintDir ViewList ViewType = 1 << iota // 1 << 0 which is 00000001 // ViewTree is the option of tree view using in PrintDir ViewTree // ViewLevel is the option of level...
package kitten import ( "context" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/strslice" "github.com/goware/prefixer" pipeline "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/reconciler/v1alpha...
package rest import ( "errors" "fmt" "net/http" "sort" "github.com/abproject/mock-server/internal/models" "github.com/abproject/mock-server/internal/shared" ) type restStorage struct { data map[string]*entityRest global *entityRest entities models.StorageRestEntity } type entityRest struct { Config ...
package main // TODO: // DONE: seperate library and game logic, very messy atm // DONE: fix rand seed setup so I can optionally generate new shuffles/games each runtime. // DONE: log game actions to file, for checking of game logic // DONE: lots of things should be interfaces, for further game dev: Shuffler, Player, S...
/* Copyright AppsCode Inc. and Contributors 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...
/* MIT License Copyright (c) 2020-2021 <NAME> This file is part of NGSI Go https://github.com/lets-fiware/ngsi-go 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 ...
package main import ( "context" "encoding/json" "errors" "flag" "fmt" "io/ioutil" "log" "net/http" "net/url" "os" "os/user" "path/filepath" "github.com/chimeracoder/anaconda" "golang.org/x/oauth2" "golang.org/x/oauth2/google" sheets "google.golang.org/api/sheets/v4" ) var ( // Sheets flags. clientS...
package sdk import ( "testing" "github.com/0chain/gosdk/zboxcore/fileref" ) type nopeHasher struct { } // GetFileHash get file hash func (h *nopeHasher) GetFileHash() (string, error) { return "", nil } // WriteToFile write bytes to file hasher func (h *nopeHasher) WriteToFile(buf []byte, chunkIndex int) error {...
package enclave_runtime_pal // import "github.com/inclavare-containers/rune/libenclave/internal/runtime/pal" import ( "encoding/binary" "fmt" "github.com/go-restruct/restruct" "github.com/inclavare-containers/rune/libenclave/attestation" _ "github.com/inclavare-containers/rune/libenclave/attestation/sgx/ias" "gi...
package handler import ( "fullerite/metric" "fullerite/util" "bytes" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "regexp" "strconv" "time" l "github.com/Sirupsen/logrus" ) func init() { RegisterHandler("Kairos", newKairos) } // Kairos handler type Kairos struct { BaseHandler server string po...
// Copyright 2020 <NAME> (<EMAIL>) package client import ( "bytes" "crypto/tls" "fmt" log "github.com/sirupsen/logrus" "io" "io/ioutil" "net" "net/http" "strings" "time" ) // ReceiverDataLimit is the limit of data in bytes the client will read // from a server. const ReceiverDataLimit int64 = 1e6 // CliOp...
/* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License...
// Copyright (c) 2017-2021 Tigera, 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 ap...
// 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 socks5 import ( "fmt" "io" ) /********************************* Clients Negotiation: +----+----------+----------+ |VER | NMETHODS | METHODS | +----+----------+----------+ | 1 | 1 | 1 to 255 | +----+----------+----------+ **********************************/ // AuthMethods c...
package codegen import ( "reflect" "sort" "strings" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/golang/protobuf/protoc-gen-go/generator" "github.com/pkg/errors" generator2 "github.com/stackrox/rox/central/graphql/generator" "github.com/stackrox/rox/pkg...
package almon import ( "errors" "fmt" "math/rand" "os" "time" "github.com/gorilla/websocket" ) const ( writeWait = 10 * time.Second readWait = 60 * time.Second pingPeriod = (readWait * 9) / 10 maxMessageSize = 512 ) type clientSubscription struct { Name string Specifications []s...
package c import ( "image/color" "math/big" ) type ComplexRat struct { Real *big.Rat Imag *big.Rat } func (lhs *ComplexRat) Add(rhs *ComplexRat) *ComplexRat { return &ComplexRat{ Real: new(big.Rat).Add(lhs.Real, rhs.Real), Imag: new(big.Rat).Add(lhs.Imag, rhs.Imag), } } func (lhs *ComplexRat) Sub(rhs *Comp...
/* Copyright 2018 The OpenEBS 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, soft...
package mysensors import ( "errors" "fmt" "strconv" "strings" "time" "github.com/mycontroller-org/server/v2/pkg/types" "github.com/mycontroller-org/server/v2/pkg/types/cmap" msgTY "github.com/mycontroller-org/server/v2/pkg/types/message" nodeTY "github.com/mycontroller-org/server/v2/pkg/types/node" rsTY "gi...
package commands import ( "context" "fmt" "io" "os" "path/filepath" "regexp" "strings" "unicode" "github.com/nyaosorg/go-windows-junction" "github.com/nyaosorg/go-windows-shortcut" "github.com/nyaosorg/nyagos/nodos" ) type copyMoveT struct { Param Action func(src, dst string) error IsDirOk bool } fu...
// 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...
package packagecallgraph import ( "database/sql" "encoding/json" "fmt" "github.com/markuszm/npm-analysis/codeanalysis/resultprocessing" "github.com/markuszm/npm-analysis/database/graph" "github.com/markuszm/npm-analysis/model" "github.com/pkg/errors" "go.uber.org/zap" "os" "path" "strings" "sync" ) type D...
package authentication import ( "errors" "fmt" "net/http" "strings" "time" "gopkg.in/square/go-jose.v2/jwt" "k8s.io/client-go/tools/clientcmd/api" "github.com/kiali/kiali/business" "github.com/kiali/kiali/config" "github.com/kiali/kiali/log" "github.com/kiali/kiali/util" ) // tokenAuthController contains...
//Package datasource manage the list of datasources and their // selection from tags package datasource import ( "context" "crypto/sha256" "database/sql" "fmt" "io" "os" "strings" "time" "github.com/Sirupsen/logrus" "github.com/marema31/kamino/file" ) //Datasourcer interface for allowing mocking of Dataso...
// Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package orm import "testing" // This test suite runs each operation test in parallel. // Example, if your database has 3 tables, the suite will run: /...
package main import ( "log" "os" "github.com/gdamore/tcell" "github.com/rivo/tview" uuid "github.com/satori/go.uuid" ) func NewUUID() uuid.UUID { id := uuid.NewV4() return id } func getSelectedCell(table *tview.Table) (r, c int) { r, c = table.GetSelection() return r, c } // Render the data in a tview tab...
package main import ( "context" "flag" "fmt" "log" "math" "os" "strings" "time" azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance" "github.com/Azure/azu...
package pregression import ( "errors" "math" "gonum.org/v1/gonum/mat" ) // Auto is to conduct polynomial regression and return optimal model based on AICc(Akaike Information Criterion) // x is slice of input, y is slice of observation // output is (slice of coefficient, R squared, error) // slice of coefficient w...
package convbox import ( "strconv" "strings" "time" ) const ( timeFormat = "2006-01-02" ) //ShortNumber use convert number (integer) to short number (string) func ShortNumber(count int) string { number := strconv.Itoa(count) if len(number) > 6 { m := number[0 : len(number)-6] m1 := number[len(number)-6 : ...
package newapp import ( "context" "fmt" "html/template" "io" "os" "os/exec" "path/filepath" "strings" "github.com/gobuffalo/buffalo-cli/v2/cli/cmds/newapp" "github.com/gobuffalo/plugins" "github.com/gobuffalo/plugins/plugio" "github.com/markbates/pkger" "github.com/spf13/pflag" ) var _ newapp.Newapper =...
// Copyright 2019 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 github import ( "context" "fmt" "github.com/google/go-github/v37/github" "github.com/karlderkaefer/cdk-notifier/config" "github.com/sirupsen/logrus" "golang.org/x/oauth2" "regexp" "strings" ) const ( // HeaderPrefix default prefix for comment message HeaderPrefix = "## cdk diff for" ) // IssuesServ...
package ooxml import ( "archive/zip" "encoding/xml" "errors" "fmt" "io" "log" "os" "sort" "strconv" "strings" ) // Initializes routine func Initialize(filePath string) error { log.Println("Opening document...") // Read zip (ooxml) file r, err := zip.OpenReader(filePath) if err != nil { return err } ...
package dbgraph import ( "context" "strings" "time" "github.com/dgraph-io/dgo/v200" "github.com/dgraph-io/dgo/v200/protos/api" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/soldatov-s/go-garage/providers/base" "github.com/soldatov-s/go-garage/utils" "github.com/soldato...
// Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "github.com/openshift/hive/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // Checkpoints returns a CheckpointInform...
// Copyright Project Harbor Authors. All rights reserved. // Package errs define some system errors with specified types. package errs import ( "encoding/json" ) const ( // JobStoppedErrorCode is code for jobStoppedError JobStoppedErrorCode = 10000 + iota // JobCancelledErrorCode is code for jobCancelledError ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: mproto.proto package protos import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-...
package image import ( "archive/tar" "crypto/sha256" "encoding/json" "errors" "fmt" "io" "os" "code.cloudfoundry.org/lager" "github.com/concourse/atc" "github.com/concourse/atc/db" "github.com/concourse/atc/resource" "github.com/concourse/atc/worker" ) const ImageMetadataFile = "metadata.json" // ErrIma...
package main import ( "encoding/json" "errors" "html/template" "io/ioutil" "net/http" "os" "os/exec" "path/filepath" "strings" "time" "github.com/aws/aws-sdk-go/aws/session" "gopkg.in/alecthomas/kingpin.v2" ) type container struct { Name string Host string Port string Address string Env ...
// vi: sw=4 ts=4: /* --------------------------------------------------------------------------- Copyright (c) 2013-2015 AT&T Intellectual Property 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 ...
/* Copyright 2018 The Jetstack cert-manager contributors. 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...
package udps import ( "context" "fmt" "net" "sync" "github.com/supergiant-hq/xnet/model" "github.com/supergiant-hq/xnet/network" "github.com/supergiant-hq/xnet/udp" "github.com/lucas-clemente/quic-go" "github.com/sirupsen/logrus" ) // Called on initial client connection type ClientConnectedHandler func(*Cl...
package cgo // This file implements a parser of a subset of the C language, just enough to // parse common #define statements to Go constant expressions. import ( "fmt" "go/ast" "go/scanner" "go/token" "strings" ) // parseConst parses the given string as a C constant. func parseConst(pos token.Pos, fset *token....
package mpawstgw import ( "flag" "os" "log" "time" "strings" "errors" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/service/cloudwatch" mp "git...
// Copyright 2021 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writ...
package server import ( "fmt" "io" "net" "sync" "sync/atomic" "time" "github.com/bio-routing/bio-rd/protocols/bgp/metrics" bmppkt "github.com/bio-routing/bio-rd/protocols/bmp/packet" "github.com/bio-routing/bio-rd/routingtable" "github.com/bio-routing/tflow2/convert" "github.com/pkg/errors" log "github.c...
// Copyright (c) 2004-present Facebook All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated (@generated) by entc, DO NOT EDIT. package checklistitem import ( "fmt" "github.com/facebookincubator/ent" ) const ( // Label hold...
// Code generated by go-swagger; DO NOT EDIT. package o_auth2_0 // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.co...