text
stringlengths
3.08k
10.4k
/* * 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 ...
package discovery import "fmt" type Switch struct { // A list of MQTT topics subscribed to receive availability (online/offline) updates. Must not be used together with `availability_topic` // Default: <no value> Availability []Availability `json:"availability,omitempty"` // When `availability` is configured, t...
package mpacket import ( "fmt" ) // Packet - type Packet []byte // NewPacket - func NewPacket() Packet { return make(Packet, 0) } type Opcode byte // CreateWithOpcode - func CreateWithOpcode(op byte) Packet { p := Packet{} p.WriteInt32(0) p.WriteByte(op) return p } func CreateInternal(op byte) Packet { p ...
package engine import ( "context" "sort" "strconv" "strings" "time" "github.com/AlexTransit/vender/cmd/vender/subcmd" "github.com/AlexTransit/vender/hardware" "github.com/AlexTransit/vender/hardware/mdb" "github.com/AlexTransit/vender/helpers" "github.com/AlexTransit/vender/helpers/cli" "github.com/AlexTra...
package register import ( "fmt" "html" "github.com/go-spatial/geom" tegola "github.com/go-spatial/tegola-postgis" "github.com/go-spatial/tegola-postgis/atlas" "github.com/go-spatial/tegola-postgis/config" "github.com/go-spatial/tegola-postgis/mvtprovider" "github.com/go-spatial/tegola-postgis/provider" ) typ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: proto/FileAppend.proto package proto 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...
package topology import ( set "github.com/deckarep/golang-set" log "github.com/sirupsen/logrus" "github.com/turbonomic/turbo-go-sdk/pkg/proto" "sort" "strings" ) type SearchDirection int const ( Up SearchDirection = 0 Down SearchDirection = 1 Full SearchDirection = 2 ) type SupplyChainNodeList []*SupplyCh...
package main import ( "fmt" "strings" // colly - core colly "github.com/sniperkit/colly/pkg" debug "github.com/sniperkit/colly/pkg/debug" // colly - plugins pp "github.com/sniperkit/colly/plugins/app/debug/pp" ) // app vars var ( // appVersion specifies the version of the app. If the executable is built wit...
// +build linux package iouring import ( "fmt" "os" "reflect" "syscall" "unsafe" iouring_syscall "github.com/iceber/iouring-go/syscall" ) var ( uint32Size = uint32(unsafe.Sizeof(uint32(0))) sqeSize = uint32(unsafe.Sizeof(iouring_syscall.SubmissionQueueEntry{})) ) func mmapIOURing(iour *IOURing) (err err...
import "math" // return the closest distance between a polar point and an involute // > 0 on convex side of involute func involute_distance( b float64, // base radius r float64, // radius for point (>b) theta float64, // theta for point ) (d, d_theta float64) { d_theta = math.Acos(b/r) + theta d = math.Sqrt((r*r...
package main import ( "flag" "fmt" "os" "path/filepath" "github.com/pkg/sftp" "github.com/sgaunet/ssftp/pathh" log "github.com/sirupsen/logrus" ) func initTrace(debugLevel string) { // Log as JSON instead of the default ASCII formatter. //log.SetFormatter(&log.JSONFormatter{}) // log.SetFormatter(&log.Tex...
package ImageProcessor import ( "github.com/opensatelliteproject/SatHelperApp/ImageProcessor/ImageTools" "github.com/opensatelliteproject/SatHelperApp/ImageProcessor/Projector" "github.com/opensatelliteproject/SatHelperApp/ImageProcessor/Structs" "github.com/opensatelliteproject/SatHelperApp/Logger" "github.com/o...
// 连接对象 // version 1.0 beta // by koangel // email: <EMAIL> // 2017/7/10 package grapeNet import ( "context" "fmt" "net" "sync" "sync/atomic" "time" cm "github.com/koangel/grapeNet/ConnManager" logger "github.com/koangel/grapeNet/Logger" stream "github.com/koangel/grapeNet/Stream" utils "github.com/koange...
// Copyright © 2018 <NAME> <<EMAIL>> // // 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...
package app import ( "fmt" "path/filepath" "github.com/xluohome/phonedata" "github.com/zu1k/nali/constant" "github.com/zu1k/nali/internal/ipdb" "github.com/zu1k/nali/internal/tools" geoip2 "github.com/zu1k/nali/pkg/geoip" "github.com/zu1k/nali/pkg/ipip" "github.com/zu1k/nali/pkg/qqwry" "github.com/zu1k/nali...
// Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in complian...
package sweet import ( "flag" "fmt" "os" "reflect" "runtime" "sort" "strings" "testing" ) var ( setUpAllTests func(t T) tearDownAllTests func(t T) ) func hasParams(method reflect.Method, paramTypes []reflect.Type) bool { if method.Type.NumIn() != len(paramTypes)+1 { return false } return true } ty...
// Copyright 2021 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 writ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: simplewal/simplewal.proto package simplewal import ( fmt "fmt" proto "github.com/golang/protobuf/proto" eventpb "github.com/hyperledger-labs/mirbft/pkg/pb/eventpb" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var...
// cisco-talos-tcpwrapper (/etc/hosts.deny) // Creator: @robertcsapo github / twitter package main import ( "bufio" "fmt" "io/ioutil" "strings" "net/http" "os" "log" "time" "gopkg.in/alecthomas/kingpin.v2" ) var ( args = kingpin.New(os.Args[0], "Cisco Talos tcpwrapper command-line to overr...
// 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 imagecashletter import ( "fmt" "strings" "unicode/utf8" ) // Errors specific to a BundleControl Record // BundleControl Record type BundleControl struct { // I...
package dhtml import ( "fmt" "github.com/gin-gonic/gin" "github.com/kooksee/ktask/internal/cnst" "github.com/kooksee/ktask/internal/kts" "github.com/kooksee/ktask/internal/utils" "github.com/mafredri/cdp/protocol/dom" "github.com/mafredri/cdp/protocol/page" "github.com/rs/zerolog" "net/http" url2 "net/url" ...
package log import ( "encoding/json" "fmt" "net/http" "os" "sync" "time" "github.com/mgutz/ansi" ) // Namespace is the service namespace used for logging var Namespace = "service-namespace" var humanReadableMutex sync.Mutex // HumanReadable, if true, outputs log events in a human readable format var HumanRe...
/* Copyright 2020 The node-detacher 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 writin...
// Copyright 2022 The Chromium 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 main import ( "encoding/base64" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net" "net/http" "os" "os/signal" "path" "path/filepa...
package dstream import ( "bufio" "compress/gzip" "fmt" "io" "os" "path" "sort" "github.com/golang/snappy" ) type bcols struct { bpath string dtypes map[string]string // Data types for all variables in the source directory, including // those not included in the Dstream when reading. dtypesAll map[stri...
package user_test import ( "bytes" "io/ioutil" "path/filepath" "strings" "testing" "github.com/keys-pub/keys" "github.com/keys-pub/keys/tsutil" "github.com/keys-pub/keys/user" "github.com/stretchr/testify/require" ) func testSeed(b byte) *[32]byte { return keys.Bytes32(bytes.Repeat([]byte{b}, 32)) } func ...
package recwatch import ( "bytes" "errors" "fmt" "io" "log" "net/http" "os" "sort" "strings" "sync" "time" ) type ( // TimeEventMap stores filesystem events TimeEventMap map[time.Time]Event ) // Customizable functions, as exported variables. Can be se to "nil". // LogInfo logs a message as information ...
// Copyright (c) 2015 Western Digital Corporation or its affiliates. All rights reserved. // SPDX-License-Identifier: MIT package core import "time" // This file describes the RPC interface exported by the curator. // Control methods (sent by master, curator, tractserver): // CuratorTractserverHeartbeatMethod is t...
package mid import ( "bytes" "encoding/json" "fmt" "log" "net/http" "net/http/httptest" "net/url" "strings" "testing" "github.com/julienschmidt/httprouter" ) type TestUser struct { Name string `valid:"alphanum,required"` Email string `valid:"email,required"` ID int `valid:"-"` // Bio string `v...
package svc import "encoding/json" const ( RES_PPMQD_TCP int32 = 1 RES_PPMQD_UDP int32 = 2 RES_PPMQD_MQTT int32 = 3 RES_APIGW_GRPC int32 = 4 RES_APIGW_HTTP int32 = 5 RES_APIGW_PPRPC int32 = 6 RES_FTCONN_NAT int32 = 8 RES_FTCONN_RELAY int32 = 9 RES_FTCONN_P2P int32 ...
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v3.6.1 // source: protos/plugin/dependencies.proto package plugin import ( helpers "code-analyser/protos/pb/helpers" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/...
/* FTX exchange FIX plugin Version : FIX 4.2 Need : fixc */ package main import ( "hash" "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "log" "flag" "encoding/json" "io/ioutil" "time" "net/http" "strconv" "strings" "./fixc" ) const SOH = string(1) var _pF...
/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package main import ( "fmt" "os" "path/filepath" "strings" "time" "github.com/bitrise-io/go-utils/log" "github.com/bitrise-io/go-utils/pathutil" "github.com/bitrise-io/go-utils/sliceutil" "github.com/bitrise-steplib/bitrise-step-android-unit-test/cache" "github.com/bitrise-tools/go-android/gradle" "github....
package graphql import ( "fmt" "strings" "github.com/99designs/gqlgen/codegen/templates" "github.com/iancoleman/strcase" "github.com/jinzhu/inflection" "github.com/lolopinto/ent/internal/schemaparser" ) type customFunction struct { SupportsContext bool ReturnsError bool ReturnsComplexType bool Ret...
package main import ( "errors" "flag" "fmt" "log" "net/http" "net/http/httputil" "strings" jwt "github.com/dgrijalva/jwt-go" "github.com/lestrrat/go-jwx/jwk" "github.com/gorilla/mux" "golang.org/x/net/http2" "golang.org/x/net/context" ) type contextKey string const ( contextEventKey contextKey = "jwt...
//go:build exclude package main import ( "fmt" "go/scanner" "go/token" "io/ioutil" "os" "os/exec" "strings" ) const INDENT = " " const NULL_TOKEN = token.Token(-1) func expandTabs(src string) string { expandCmd := exec.Command("expand", "-t", "4") expandStdinPipe, err := expandCmd.StdinPipe(); if err!=n...
package model import "time" type ERCToken struct { From string `json:"_from" bson:"_from"` To string `json:"_to" bson:"_to"` Value string `json:"_value" bson:"_value"` } type ETHTransaction struct { Hash string `json:"hash" bson:"hash"` BlockHash string `json:"blockHash" bson:"block...
package pipeline import ( "errors" "fmt" "runtime/debug" "strings" "github.com/TIBCOSoftware/flogo-lib/core/activity" "github.com/TIBCOSoftware/flogo-lib/core/data" "github.com/TIBCOSoftware/flogo-lib/engine/channels" "github.com/TIBCOSoftware/flogo-lib/logger" ) type Instance struct { def *Definition i...
package roada import ( "bufio" "bytes" "encoding/gob" "errors" "io" "log" "net" "net/http" "sync" ) type ServerError string func (e ServerError) Error() string { return string(e) } var rpcErrShutdown = errors.New("connection is shut down") type rpcCall struct { Route string Args...
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://www.apache.org/licenses/LICENSE-2.0 or in the "license" file accompanying t...
// Copyright (c) 2019 VMware, Inc. // // 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.0 // // Un...
package main import ( "os" "fmt" "net" "time" "encoding/binary" ) const ( MTU = 258 FAME_PER_MS = 17 LONG_LIMIT = 100*60*1000 ) func checkError(err error){ if err != nil { fmt.Println("Error: %s", err.Error()) os.Exit(1) } } var _cur_timestamp int64 func gen...
package main import ( "fmt" "io/ioutil" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" appv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" netv1b1 "k8s.io/api/networking/v1beta1" rbacv1 "k8s.io/api/rbac/v1" "sigs.k8s.io/yaml" ) func Test_APIDeployment(t *testing.T)...
package network import ( "encoding/json" "fmt" log "github.com/sirupsen/logrus" "github.com/weikeit/mydocker/util" "io/ioutil" "net" "strings" ) func (ipam *IPAM) Init(nw *Network) error { if err := ipam.Load(); err != nil { return fmt.Errorf("failed to load IPAllocation info: %v", err) } // for subnet: ...
package project import ( "encoding/json" "fmt" "github.com/FriendsOfShopware/shopware-cli/shop" "io/ioutil" "os" "path/filepath" adminSdk "github.com/friendsofshopware/go-shopware-admin-api-sdk" log "github.com/sirupsen/logrus" ) type MailTemplateSync struct{} func (MailTemplateSync) Push(ctx adminSdk.ApiCo...
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package models import ( json "encoding/json" easyjson "github.com/mailru/easyjson" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" ) // suppress unused package warning var ( _ *json.RawMessage _ *jle...
/* Copyright 2018 <NAME>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
package main import ( "context" "flag" "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "ct_exporter/api/types/v1alpha1" clientV1alpha1 "ct_exporter/clientset/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" //"k8s.io/apimachinery/pkg/util...
package docker import ( "context" "encoding/binary" "fmt" "github.com/alydnh/go-micro-ci-common/utils" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" "io" "strings" ) func GetDockerVersion() (string, error) { if dockerClient, err := client...
package buildbox import ( "fmt" "os" "strings" "log" "errors" "path/filepath" "mime" ) type Artifact struct { // The ID of the artifact ID string `json:"id,omitempty"` // The current state of the artifact. Default is "new" State string `json:"state,omitempty"` // The relative path to the fil...
package main import ( "io/ioutil" "os" "path" "path/filepath" "sort" "strings" "testing" ) func putFile(t *testing.T, src, dst, correct string) { var err error if dst == "" { _, err = Upx("put", src) } else { _, err = Upx("put", src, dst) } Nil(t, err) b, err := Upx("ls", correct) Nil(t, err) Equa...
// 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 (c) 2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
package server import ( "bytes" "fmt" "io/ioutil" "log" "net/http" "strings" "time" "github.com/open-lambda/open-lambda/worker/config" "github.com/open-lambda/open-lambda/worker/handler" ) // Server is a worker server that listens to run lambda requests and forward // these requests to its sandboxes. type S...
// Copyright © 2020 Banzai Cloud // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
// Copyright (c) 2019-2021, AT&T Intellectual Property. All rights reserved. // // Copyright (c) 2017-2018 by Brocade Communications Systems, Inc. // All rights reserved. // // SPDX-License-Identifier: MPL-2.0 //go:generate goyacc -o path_eval.go -p "pathEval" path_eval.y // "pathEval" in the above line is the 'prefi...
package wordlevel import ( "bufio" "fmt" "os" "path/filepath" "sort" "github.com/sugarme/tokenizer" ) type config struct { vocab map[string]int unkToken string } // WordLevelBuilder is a builder for WordLevel model type WordLevelBuilder struct { config *config } // defaultWordLevelBuilder creates a Wor...
package filewalker_test import ( "context" "github.com/nlnwa/warchaeology/internal/filewalker" "github.com/stretchr/testify/assert" "testing" ) func TestFilewalker_Walk(t *testing.T) { tests := []struct { name string paths []string suffixes []string recursive bool followSy...
// Copyright 2011 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 ...
package virtual import ( "encoding/json" "fmt" "net/http" "net/url" "strings" "unicode/utf8" ) // Route represents the list of stops where an urban transit line stops when traveling in a specific direction. type Route struct { StopCodes []string `json:"codes"` // numerical codes of the stops } // RouteList re...
package core import ( "bytes" "fmt" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "io" "log" "net" "os" "path/filepath" "strconv" "sync" "time" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials" _ "google.golang.org/grpc/...
package osm import ( "fmt" "log" "net/http" "os" "github.com/julienschmidt/httprouter" geo "github.com/kellydunn/golang-geo" "github.com/maddevsio/ariadna/config" "github.com/maddevsio/ariadna/elastic" "github.com/maddevsio/ariadna/osm/handler" "github.com/maddevsio/ariadna/osm/parser" "github.com/missingl...
package leveldb // #cgo LDFLAGS: -lleveldb // #include <stdlib.h> // #include "leveldb/c.h" import "C" import ( "bytes" "unsafe" ) const ( IteratorForward uint8 = 0 IteratorBackward uint8 = 1 ) const ( RangeClose uint8 = 0x00 RangeLOpen uint8 = 0x01 RangeROpen uint8 = 0x10 RangeOpen uint8 = 0x11 ) //min ...
package atkvfs /* #cgo linux CFLAGS: -I/usr/include/tcl #cgo linux LDFLAGS: -ltcl -ltk -lX11 -lm -lz -ldl #include <errno.h> #include <string.h> #include <sys/stat.h> #include <tcl.h> extern int _go_DriverCloseProc(ClientData instanceData, Tcl_Interp *interp); static int _c_DriverCloseProc(ClientData instanceData, T...
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) const ( freeFloorType = "free" specialFloorType = "special" reserveCommand = "reserve_desk" requestCommand = "request_desk" ) var ( reader *bufio.Reader requestDesk = "%s got desk %d-%d" requestDeskPrice = "%s got desk %d-%d for %d"...
// Package panicwatch guarantees you that you will never miss a panic. Use it to reliably log any unhandled panics // that may occur in your application. This is completely transparent to your application, and it doesn't affect // it in any way. All signal handling and file descriptor manipulation (either from inside o...
// Copyright 2020 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
package main import ( "context" "net/http" "os" "github.com/ONSdigital/dp-healthcheck/healthcheck" "github.com/ONSdigital/dp-legacy-redirector/config" "github.com/ONSdigital/go-ns/server" "github.com/ONSdigital/log.go/v2/log" "github.com/gorilla/mux" ) var redir = http.StatusTemporaryRedirect var landingPage...
package k8sutils import ( "fmt" "os" "os/signal" "syscall" "time" "github.com/rs/zerolog/log" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util...
package handler import ( "net/http" "strings" "sync" "github.com/zaolab/sunnified/mvc/controller" "github.com/zaolab/sunnified/router" "github.com/zaolab/sunnified/web" ) type DynamicHandler struct { module string controller string action string mutex sync.RWMutex ctrlgroup *controller.Group...
// 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 writing, ...
package tcp import ( "errors" "github.com/sirupsen/logrus" "net" "noone/app/crypto/aes" "noone/app/transport" "strconv" ) type ctx struct { transport.Ctx clientConn *net.TCPConn remoteConn *net.TCPConn clientBuf []byte clientBufLen int clientBufIdx int // 已用数据偏移 remoteBuf []byte remoteBufLen i...
// Copyright 2016 <NAME>. All rights reserved. // Use of this source code is governed by the MIT-license // as defined in the LICENSE file. package main import ( "bytes" "flag" "html/template" "image" _ "image/gif" _ "image/jpeg" "image/png" "log" "os" "os/exec" "strconv" "strings" "github.com/TheGrum/r...
/* ____ _ _ _____ _ _ / __ \ | | | | | __ \ | | | | | | | |_ __ ___| | ___ __| | __ _ ___ _ __ | |__) | __ ___ | |_ ___ ___ ___ | | | | | | '_ \ / _ \ | / _ ...
package braceexpansion import ( "fmt" "testing" ) func (l ListNode) String() string { return fmt.Sprintf("List: %v", l.Phrases) } func (p PhraseNode) String() string { return fmt.Sprintf("Phrase: %v", p.Parts) } func (t TextNode) String() string { return fmt.Sprintf("\"%s\"", t.text) } type parseTest struct {...
package main import ( "bytes" "encoding/csv" "fmt" "io/ioutil" "log" "sort" "strconv" "time" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/plotutil" "github.com/gonum/plot/vg" "github.com/pkg/errors" "github.com/sajari/regression" ) const companyName = "Bobs" const star...
package receiver import ( "bytes" "compress/gzip" "context" "encoding/json" "fmt" "io/ioutil" "net/http" "strings" "sync" "time" "github.com/choria-io/go-lifecycle" "github.com/choria-io/prometheus-streams/circuitbreaker" "github.com/choria-io/prometheus-streams/build" "github.com/choria-io/prometheus...
package main import ( "bytes" "compress/gzip" "encoding/base64" "fmt" "io" "io/ioutil" "log" "os" "os/exec" "path/filepath" "strings" "text/template" flag "github.com/spf13/pflag" ) var ( pkg = flag.StringP("package", "p", "main", "Package name") output = flag.StringP("output", "o", "assets....
package main import ( "fmt" "io" "io/ioutil" "log" "net/http" "os" "path" "strings" "sync" "github.com/k0kubun/go-ansi" "github.com/schollz/progressbar/v3" ) // const flags = os.O_CREATE | os.O_WRONLY type Downloader struct { concurreny int resume bool bar *progressbar.ProgressBar } func NewDown...
// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server import ( "context" "encoding/json" "errors" "fmt" "os" "path/filepath" "strings" "sync" "time" "github.com/ava-labs/avalanche-network-runner/api" "github.com/ava-labs/avalanche-netwo...
package barista import ( "fmt" "strings" "github.com/appadeia/barista/barista-go/commandlib" "github.com/dustin/go-humanize" ) type Package struct { name string desc string vers string downsize string installsize string url string } type Distro struct { matches []stri...
// 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 by entc, DO NOT EDIT. package ent import ( "fmt" "strings" "time" "github.com/facebook/ent/dialect/sql" "github.com/facebookincub...
package task import ( "errors" "time" ) var ErrOverMaxRetry = errors.New("over max retry") var ErrExecuting = errors.New("is executing") const ( StatusUnknown StatusCode = 0 StatusUnavailable StatusCode = 1 StatusWaitingExec StatusCode = 2 StatusExecuting StatusCode = 3 StatusExecuteFin...
/* Copyright 2020 The Nocalhost 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 server import ( "github.com/gin-gonic/gin" "github.com/phpgao/proxy_pool/db" "github.com/phpgao/proxy_pool/job" "github.com/phpgao/proxy_pool/model" "github.com/phpgao/proxy_pool/util" "gitlab.com/NebulousLabs/fastrand" "net/http" "strconv" ) var ( logger = util.GetLogger("reverse") storeEngine...
package cli import ( "flag" "fmt" "os" "reflect" "sort" "strings" "github.com/fatih/color" ) // app command -opt1=1 -opt2=2 // 原理,使用flag包解析 // xx 这是command,可以通过Arg抓取 // -xx 这是option,可以flag parse抓取 // 注意 -1会被认为是option,如果强制认为-1是arg,用 -- -1 // app type CliApp struct { Desc string // 描述 comman...
// Code generated by go-swagger; DO NOT EDIT. package data_transfer // 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 "githu...
package instagram import ( "fmt" "os" "strconv" "strings" "time" "github.com/graniet/go-pretty/table" "github.com/graniet/operative-framework/session" "gopkg.in/ahmdrz/goinsta.v3" ) type InstagramFriends struct { session.SessionModule Sess *session.Session `json:"-"` Friends map[string]string `json:"-...
// Copyright 2014 beego Author. 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 applica...
package engine import ( "io" "mime/multipart" "time" "net" "github.com/trafficstars/echo/log" ) type ( // Server defines the interface for HTTP server. Server interface { // SetHandler sets the handler for the HTTP server. SetHandler(Handler) // SetLogger sets the logger for the HTTP server. SetLogg...
package main import ( "context" "fmt" "log" "os" "strings" "sync" "time" "github.com/cockroachdb/errors" gcp_crm "google.golang.org/api/cloudresourcemanager/v1" gcp_cp "google.golang.org/api/compute/v1" gcp_ct "google.golang.org/api/container/v1" ) // for resources that require enumerating over regions, i...
// Copyright (c) 2021 6 River Systems // // 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, publis...
// Copyright 2018 Comcast Cable Communications Management, 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
// Copyright (c) 2020 <NAME> <<EMAIL>> // MIT Licence applies http://opensource.org/licenses/MIT // Created on 2020-07-29 package cli import ( "fmt" "io/ioutil" "log" "net/url" "os" "path/filepath" "sort" "strings" "time" aw "github.com/deanishe/awgo" "github.com/deanishe/awgo/util" "github.com/pkg/error...
/* Copyright 2011-2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. you may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
package cartridge import ( "io" ) // Memory for storing cartridge PRG and CHR ROM/RAM. type memory struct { prgROM [][]int prgRAM []int isPrgRAMBatteryBacked bool chrMem [][]int isChrMemRAM bool ntMirroringType int } // Cartridge for NES. type Cartr...
/* Copyright 2018 Pax Automa Systems, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
// Copyright 2021 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package kerberos import ( "context" "fmt" "strings" "time" "chromiumos/tast/common/policy" "chromiumos/tast/common/policy/fakedms" "chromiumos...