text
stringlengths
3.08k
10.4k
package diff import ( "fmt" "sort" ) type Document interface { Len() int At(i int) Element Slice(start, end int) Document Join() string AbsoluteRange() (from, to int) } func Diff(a, b Document) []Edit { a, b = TrimCommonElements(a, b) ua := UniqueElements(a) ub := UniqueElements(b) m := make(map[uint64]s...
// //Copyright [2016] [SnapRoute 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 agr...
/* 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 agreed to in writing, sof...
package socks import ( "errors" "io" "net" "strconv" ) // SOCKS auth type const ( AuthNone = 0 AuthPassword = 2 ) // SOCKS request commands as defined in RFC 1928 section 4 const ( CmdConnect byte = 1 CmdBind byte = 2 CmdUDPAssociate byte = 3 ) // SOCKS address types as defined in RFC 1928...
package github_flavored_markdown import ( "bytes" "io/ioutil" "log" "os" "os/exec" "regexp" "testing" "github.com/microcosm-cc/bluemonday" blackfriday "gopkg.in/russross/blackfriday.v1" ) // In this test, nothing should be sanitized away. func TestSanitizeLarge(t *testing.T) { var text = []byte(`### GitHub...
// Copyright 2022 The go-exactonline AUTHORS. All rights reserved. // // Use of this source code is governed by a MIT // license that can be found in the LICENSE file. // Code generated by gen-services.go; DO NOT EDIT. package cashflow import ( "context" "fmt" "io/ioutil" "net/http" "github.com/stack11/go-exacto...
package arp import ( "bufio" "fmt" "net" "os" "strconv" "strings" ) // hwType represents a network harware type. type hwType int // String returns a string representation of the hardware type. func (hwt hwType) String() string { switch hwt { case hwTypeNetROM: return "netrom" case hwTypeEther: return "e...
package grpctest import ( "context" "fmt" "net" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" testpb "google.golang.org/grpc/test/grpc_testing" ) // NewMockServer returns a new MockServer. func NewMockServer(serverOptions []grpc.ServerOption, dialOptions []grpc....
// Copyright © 2018 openSUSE <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...
package main import ( "encoding/json" "io" "log" "net" "os" "os/signal" "sort" "syscall" "time" ) type Rule struct { IsAccept bool IsAddressWildcard bool Address string Mask string IP net.IP IPNet *net.IPNet MinPort int MaxPort ...
/* * Copyright ©2020. The virtual-kubelet 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 fieldtypes import ( "context" "database/sql" "encoding/json" "fmt" "strconv" "strings" "errors" "github.com/digimakergo/digimaker/core/contenttype" "github.com/digimakergo/digimaker/core/db" "github.com/digimakergo/digimaker/core/definition" "github.com/digimakergo/digimaker/core/fieldtype" "gith...
package config import ( "fmt" "net/http" "os" "github.com/xanzy/go-gitlab" "gitlab.com/tozd/go/errors" ) // getProject populates configuration struct with configuration available // from GitLab projects API endpoint. func (c *GetCommand) getProject(client *gitlab.Client, configuration *Configuration) (bool, err...
package nix import ( "bytes" "fmt" "io" "os" "os/exec" "path/filepath" "runtime" "strings" "github.com/benchkram/errz" ) type Dependency struct { // Name of the dependency Name string // Nixpkgs can be empty or a link to desired revision // ex. https://github.com/NixOS/nixpkgs/archive/eeefd01d4f630fcbab...
package main import ( "flag" "fmt" "io/ioutil" "path/filepath" "time" "log" "strings" "syscall" "os" "os/signal" "github.com/fsnotify/fsnotify" "github.com/zzwx/gamutmask/lib" ) const ( inputDefault = "./_input" outputDefault = "./_output" ) // Usage prints how to use the command-line utility func...
/* * Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obta...
package main import ( "flag" "fmt" "io/ioutil" "log" "net/http" "os" "strconv" "strings" "time" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" cron "github.com/robfig/cron/v3" "gopkg.in/yaml.v2" ) var...
package goorm import ( "database/sql" "encoding/json" "errors" "reflect" ) func (this *DB) Insert(sql string, bindarray []interface{}) (int64, error) { Result := this.pdoexec(sql, bindarray) num, err := Result.LastInsertId() return num, err } func (this *DB) Exec(sql string, bindarray []interface{}) (int64, e...
package config import ( "encoding/json" "fmt" "hash/fnv" "log" "strings" "time" "unicode/utf8" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-xray-sdk-go/xray" "github.com/kelseyhightower/envconfig" mkconf "github.com/mack...
// package iexcloud implements a client to receive data from the iexcloud API. package iexcloud import ( "context" "encoding/json" "fmt" "io/ioutil" "net/http" "path" ) // environment is used to set the endpoint. type environment string const ( // Prod is used for real world data and apps running in prod. Pr...
// Copyright 2018 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
package h264parse import ( "bytes" "fmt" "math" ) func Unmarshal(data []byte) (NALUs, error) { var nalus NALUs // var index int rawNALUs := bytes.Split(data, []byte{0x00, 0x00, 0x01}) for _, rawNALU := range rawNALUs[1:] { // fmt.Printf("%#v\n", rawNALU) /* for index = 0; index < len(rawNALU); index++...
package prj import ( "bytes" "fmt" "io/ioutil" "log" "os" "os/exec" "path/filepath" "regexp" "runtime" "strings" "github.com/VonC/ggb/prj/symlink" ) var prj Project var Debug bool type Project interface { RootFolder() string name() string ggoPath() string } type project struct { rootFolder string /...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/api/longrunning.proto package annotations // import "google.golang.org/genproto/googleapis/api/annotations" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not ot...
/* Copyright (c) 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, distribute...
package uptrace import ( "context" "os" "github.com/uptrace/uptrace-go/internal" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semc...
package main import ( "fmt" "github.com/derat/advent-of-code/lib" ) func main() { // Read all input, building up a list of (possibly-overlapping) 'on' rects. var rects []*rect for _, ln := range lib.InputLines("2021/22") { var s string var r rect lib.Extract(ln, `^(on|off) x=(-?\d+)\.\.(-?\d+),y=(-?\d+)\....
package main import ( "bufio" "container/list" "fmt" "math" "os" ) type SnailNum struct { val int depth uint } func list_print(num *list.List) { e := num.Front() for e != nil { fmt.Print(e.Value.(SnailNum), " || ") e = e.Next() } fmt.Print("\n") } func (sn SnailNum) String() string { return fmt.Sp...
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by...
package main //go:generate stringer -type=ingressGroup import ( "encoding/json" "flag" "fmt" "io/ioutil" "log" netv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func (hs *hostService) UnmarshalJSON(b []byte) error { var i interface{} err := json.Unmarshal(b, &i) if err != ni...
// Copyright (c) 2017-2018 The qitmeer developers // Copyright (c) 2014-2016 The btcsuite developers // Copyright (c) 2015-2017 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package params import ( "github.com/Qitmeer/qitmeer/common" "github...
package event import ( "fmt" "sync" "time" ) // Event stores a time window for when the event can be triggered (`from` up to `upTo`), // how long it should take to cooldown before being able to be re-triggered, which // action should be performed when triggered, when it was last triggered, a mutex // and a boolean...
package xresolver import ( "context" "errors" "fmt" "net" "net/url" "regexp" "strconv" "strings" "sync" ) type Lookup interface { // LookupIPAddr looks up host using the local resolver. It returns a slice of that host's IPv4 and IPv6 addresses. LookupRoutes(ctx context.Context, host string) ([]Route, error...
// 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 transit import ( "bufio" "errors" "net" "regexp" "strings" "github.com/chris-pikul/go-wormhole-server/log" ) //Client wraps up the net.Conn connection //with other local properties describing //a client connection to the transit //service type Client struct { conn net.Conn SentOK bool GotToken bo...
package tsv import ( "bytes" "encoding/csv" "fmt" "io" "reflect" "regexp" "strconv" "strings" "github.com/uhppoted/uhppote-core/types" ) type Unmarshaler interface { UnmarshalTSV(string) (interface{}, error) } var ( tBool = reflect.TypeOf(bool(false)) tUint8 = reflect.TypeOf(uint8(0)) tInt = r...
package main import ( "bufio" "fmt" "math" "os" //"strings" //"strconv" ) /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ func main() { scanner := bufio.NewScanner(os.Stdin) scanner.Buffer(make([]byte, 1000000), 1000000) var N int s...
package main import ( "context" "encoding/json" "net/url" "strconv" "sync" "time" "github.com/gammazero/workerpool" "github.com/packethost/cacher/hardware" "github.com/packethost/packngo" "github.com/packethost/pkg/env" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "go.opentele...
// 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...
package replication import ( "fmt" "os" "sync" "time" "github.com/byuoitav/common/log" "github.com/byuoitav/common/nerr" ) func RunRegular(config DatabaseConfig, configChannel chan DatabaseConfig, wg *sync.WaitGroup) *nerr.E { defer wg.Done() savedInterval := 0 //there's a 10 second floor if config.Interv...
package config import ( "encoding/hex" . "gopkg.in/check.v1" ) type EncryptedConfigXmppSuite struct{} var _ = Suite(&EncryptedConfigXmppSuite{}) func bytesFromHex(s string) []byte { val, _ := hex.DecodeString(s) return val } func byteStringFromHex(s string) string { val, _ := hex.DecodeString(s) return stri...
package userstack import ( "context" "encoding/json" "fmt" "io/ioutil" "log" "net" "net/http" "net/url" "time" ) const ( apiHost = "api.userstack.com" ) // defaultClient is an http client with sane defaults. var defaultClient = &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ Time...
package goribot import ( "github.com/PuerkitoBio/goquery" "log" "sync/atomic" "time" ) // DefaultUA is the default User-Agent of spider const DefaultUA = "Goribot" // Spider is the core spider struct type Spider struct { ThreadPoolSize uint64 DepthFirst bool Downloader func(r *Request) (*Response, err...
package p2p import ( "bytes" "github.com/zbo14/pos/merkle" . "github.com/zbo14/pos/util" "golang.org/x/crypto/ripemd160" "io" "sync" ) // From github.com/jaekwon/twirl/types/part_set var ( ErrPartSetUnexpectedIndex = Error("Error part set unexpected index") ErrPartSetInvalidProof = Error("Error part set i...
package dbmeta import ( "database/sql" "fmt" "strings" "github.com/jimsmart/schema" ) type ModelInfo struct { PackageName string StructName string ShortStructName string TableName string Fields []string } // commonInitialisms is a set of common initialisms. // Only add entries that ...
package ingester import ( "fmt" "net/http" "time" "golang.org/x/net/context" "github.com/go-kit/kit/log/level" "github.com/prometheus/common/model" "github.com/weaveworks/common/user" "github.com/weaveworks/cortex/pkg/chunk" "github.com/weaveworks/cortex/pkg/util" ) const ( // Backoff for retrying 'immed...
package util import ( "errors" "fmt" "github.com/faiface/pixel" "github.com/srwiley/oksvg" "github.com/srwiley/rasterx" "image" "image/color" "image/draw" _ "image/jpeg" _ "image/png" "io/ioutil" "log" "math" "net/http" "strings" ) // Function to load an SVG func LoadSVG(fs http.FileSystem, path string...
package main import ( "bufio" "bytes" "encoding/csv" "flag" "fmt" "os" "sort" "strconv" "github.com/xrash/smetrics" ) // TODO Refactor big hairy main // TODO make it work for numcases > 1 // Example // go run simmstring.go -source resources\test_strings.txt -target resources\ref_strings.txt -v func main() {...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: Schedule.proto package spectre_go_entity 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 ...
/** * @File: web * @Author: hsien * @Description: * @Date: 9/17/21 2:28 PM */ package server import ( "context" "custom_server/pkg/config" "custom_server/pkg/database" "custom_server/pkg/log" "github.com/gin-gonic/gin" "gorm.io/gorm" "net/http" "os" "os/signal" "sync" "syscall" "time" ) var once syn...
package main import ( "fmt" "github.com/colinmarc/hdfs" "github.com/colinmarc/hdfs/hadoopconf" krb "gopkg.in/jcmturner/gokrb5.v5/client" "gopkg.in/jcmturner/gokrb5.v5/config" "log" "strings" ) func main() { //client, err := NewClient("slave5.cluster.local:8020") client, err := NewKerbosClient("slave5.cluster...
// Copyright (C) 2014 The Syncthing Authors. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. package tlsutil import ( "crypto/ecdsa" "crypto/elliptic" "crypt...
/* Copyright 2016 The Rook Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to ...
/* Copyright 2018 Gravitational, 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, soft...
package uphold import ( "encoding/json" "time" uuid "github.com/kthomas/go.uuid" ) // OAuthResponse is the API response returned when an authorization code has been successfully upgraded to an access token type OAuthResponse struct { AccessToken *string `json:"access_token"` ExpiresIn *string `json:"expires...
package changelog import ( "fmt" "os" "path" "path/filepath" "sort" "strconv" "strings" "time" "github.com/blang/semver/v4" "github.com/spf13/viper" git "gopkg.in/src-d/go-git.v4" "gopkg.in/yaml.v2" "gitlab.com/l0nax/changelog-go/internal" "gitlab.com/l0nax/changelog-go/pkg/entry" "gitlab.com/l0nax/ch...
package v2 import ( "fmt" "strings" "text/scanner" "unicode" "unicode/utf8" "github.com/prometheus/prometheus/util/strutil" ) const ( VectorOpTypeSum = "sum" VectorOpTypeAvg = "avg" VectorOpTypeMax = "max" VectorOpTypeMin = "min" VectorOpTypeCount = "count" VectorOpTypeStddev = "stddev...
// package testcases defines the Case data structure, and a public function for // instantiating slices of Cases from JSON test specifications in directory // trees on the filesystem. package testcases import ( "bytes" "context" "encoding/json" "fmt" "strings" "github.com/INFURA/eth2-comply/pkg/eth2spec" "gith...
package conf import ( "bytes" "crypto/rsa" "html/template" "sync" "time" "github.com/BurntSushi/toml" "github.com/hashicorp/consul/api" "github.com/stephane-martin/bouncer/consul" ) type GlobalConfig struct { Ldap []LdapConfig `mapstructure:"ldap" toml:"ldap"` DefaultLdap LdapConfig `mapstru...
package throttle import ( "context" "errors" "fmt" "sync/atomic" "testing" "time" "github.com/albertwidi/gonsq" fakensq "github.com/albertwidi/gonsq/fakensq" ) // helper function to start the consumer manager func startConsumer(t *testing.T, cm *gonsq.ConsumerManager) error { t.Helper() var err error err...
// Copyright 2021 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA // // 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...
package model import ( "bufio" "encoding/json" "fmt" "io" "log" "os" "os/exec" "time" "api" ) type JobModel struct { jobs []jobContentVO jobsByID map[int]int jobEnv *JobEnvDef uniqueID int } var _ = (api.Model)(&JobModel{}) var _ = time.Sleep var _ = os.Open var _ = log.Println func NewJobServic...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package forecast import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type ListPredictorsInput struct { _ struct{} `type:"structure"` // An array of filters. For each filter, you prov...
package main import ( "fmt" ) func think(ir int, sensor_data_string string) { fmt.Println("\nIR,DATA IN: ",ir,sensor_data_string) var brain Brain brain = rovers[ir].brain var sensor_data [NUM_NEURONS]byte sensor_data = convert_sensor_data(sensor_data_string) var temp_outps [NUM_NEURONS]byte var memb [NU...
// Copyright 2022 The Project Oak 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...
// Package riaksvc provides a TrafficVault implementation which uses Riak as the backend. package riaksvc /* * 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 owne...
// Copyright (c) 2020, Cloudflare. 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 and the fol...
package main import ( "bytes" "crypto/tls" "crypto/x509" "errors" "io" "log" "mime" "net" "net/http" "path" "reflect" "time" "github.com/remogatto/ftpget" "golang.org/x/net/http2" ) var dialer = &net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, } var httpTransp...
package ntwk // protocol layer //protocol operates on messages and channels not bytestreams //handshake message //heartbeat import ( "bufio" "encoding/hex" "fmt" "log" "math/rand" "strconv" "strings" "time" "github.com/pkg/errors" block "github.com/polygonledger/node/block" cryptoutil "github.com/polygonl...
// Copyright The TB 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 wr...
//go:generate ../../../tools/readme_config_includer/generator package graphite import ( "crypto/tls" _ "embed" "errors" "io" "math/rand" "net" "time" "github.com/influxdata/telegraf" tlsint "github.com/influxdata/telegraf/plugins/common/tls" "github.com/influxdata/telegraf/plugins/outputs" "github.com/infl...
package generator import ( "context" "fmt" "os" "strings" "time" "github.com/docker/oscalkit/impl" "github.com/docker/oscalkit/types/oscal" "github.com/docker/oscalkit/types/oscal/catalog" "github.com/docker/oscalkit/types/oscal/profile" "github.com/sirupsen/logrus" ) // CreateCatalogsFromProfile maps prof...
package parser import ( "github.com/thought-machine/go-protoparser/internal/lexer/scanner" "github.com/thought-machine/go-protoparser/parser/meta" ) // Option can be used in proto files, messages, enums and services. type Option struct { OptionName string Constant string Endpoint *CloudEndpoint // Comments...
// Copyright © 2017 feilengcui008 <<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...
// 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 server import ( "errors" "fmt" "encoding/base64" "proxy/gateway-server/mysql" "proxy/gateway-server/sqlparser" "util/log" ) // HandleTruncate truncate table func (p *Proxy) HandleTruncate(db string, stmt *sqlparser.Truncate) (*mysql.Result, error) { var tableName string if stmt != nil && stmt.Table ...
package main import ( "context" "encoding/json" "fmt" "log" "net/http" "os" "path/filepath" "strings" "sync" "time" "gocloud.dev/blob" _ "gocloud.dev/blob/gcsblob" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ) var mutex sync.Mutex var podFiles = ...
// Copyright The Linux Foundation and each contributor to CommunityBridge. // SPDX-License-Identifier: MIT package onboard import ( "fmt" "time" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" "github.com/aws/aws-sdk-go/service/dynamodb/expression" "github.com/communitybridge/easycla/cla-backend-...
package injector import ( "encoding/json" "fmt" "io/ioutil" "net/http" "strings" "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/sdk/helper/strutil" "github.com/mattbaird/jsonpatch" "k8s.io/api/admission/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io...
// Code generated by protoc-gen-go. // source: snmp_sysuptime.proto // DO NOT EDIT! /* Package cisco_ios_xr_snmp_agent_oper_snmp_information_system_up_time is a generated protocol buffer package. It is generated from these files: snmp_sysuptime.proto It has these top-level messages: SnmpSysuptime_KEYS SnmpSysupti...
// Code generated by go-swagger; DO NOT EDIT. package ip_a_m // 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.com/g...
// Copyright Contributors to the Open Cluster Management project. package launcher import ( "context" "encoding/json" "errors" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/klog/v2" "sigs.k8s.io/yaml" ) const Overrid...
package main import ( "context" "encoding/csv" "flag" "fmt" "log" "math/rand" "os" "strconv" "time" "github.com/peterbourgon/ff/v2/ffcli" "moul.io/godev" ) func main() { rand.Seed(time.Now().UnixNano()) var ( rootFlagSet = flag.NewFlagSet("lexique", flag.ExitOnError) nthFlagSet = flag.NewFlagSet("t...
package graph import ( "testing" "github.com/stretchr/testify/assert" ) var ( // 234 // / \ // 4 - 6 546 // \ \ / // 33 654 // \ / // 2 // 0 1 2 3 4 5 6 testNodes = []interface{}{4, 6, 33, 654, 2, 234, 546} testEdges = []struct { i,...
package pusher import ( "github.com/function61/eventhorizon/config" "github.com/function61/eventhorizon/cursor" "github.com/function61/eventhorizon/pubsub/client" ptypes "github.com/function61/eventhorizon/pusher/types" "github.com/function61/eventhorizon/pusher/writerproxy" "github.com/function61/eventhorizon/r...
// Copyright 2017 Neudesic. All rights reserved. // Use of this source code is governed by MIT license that can be found in the // LICENSE file. // This package implements a REST API that will create an RSA Certificate and // Key for a device, and register the device with credentials in Cloud IoT Core // Device Regist...
/* http.go * * @Author: <NAME> * @Date: November 21, 2019 * @Last Modified by: @suryakencana007 * @Last Modified time: 21/11/19 12:28 */ package suki import ( "context" "fmt" "net" "net/http" "net/url" "os" "os/signal" "stri...
package main import ( "bufio" "compress/zlib" "encoding/binary" "fmt" "io" "os" ) type PrtGenerator struct { enclosedsChan chan *EnclosedChunkJob completeChan chan bool outFile *os.File w *bufio.Writer zw io.WriteCloser particleCount int64 total int boundary *BoundaryLocator }...
package config import ( "os" "strings" "time" "github.com/genuinetools/reg/registry" "github.com/urfave/cli" "go.uber.org/zap" "golang.org/x/xerrors" dbTypes "github.com/aquasecurity/trivy-db/pkg/types" "github.com/aquasecurity/trivy/pkg/log" ) type Config struct { context *cli.Context logger *zap.Sugar...
package webdav import ( "context" "errors" "fmt" "net/http" "net/url" "sort" "strings" "time" "google.golang.org/grpc" "github.com/nyaxt/otaru/cli" "github.com/nyaxt/otaru/logger" "github.com/nyaxt/otaru/pb" ) const MethodPropFind = "PROPFIND" func ServeOptions(w http.ResponseWriter) { // w.Header().S...
package main import ( "fmt" "github.com/gogap/errors" "strconv" "strings" "time" "github.com/aliyunmq/mq-http-go-sdk" ) var loopCount = 0 func ProcessError(err error) { // 如果Commit/Rollback时超过了TransCheckImmunityTime(针对发送事务消息的句柄)或者超过10s(针对consumeHalfMessage的句柄)则会失败 if err == nil { return } fmt.Println(er...
package expressions import ( "errors" "math/big" "strconv" "github.com/zephyrtronium/bigfloat" ) // TODO(zeph): how represent e.g. 0F0(; ; z) = exp(z) // Func is a function from reals to reals. Functions may but generally should // not look up variables. The function should set r to its result and should // not...
package day21 import ( "bytes" "fmt" "math" "strings" ) type Block []byte func ParseBlock(s string) Block { b := make(Block, 0, len(s)) for i := 0; i < len(s); i++ { switch s[i] { case '.': b = append(b, 0x00) case '#': b = append(b, 0x01) } } return b } // Transforms returns mutations of the...
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v3.15.6 // source: testdata/test.proto package testdata import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync ...
package main import ( "flag" "fmt" "github.com/j-keck/plog" "github.com/j-keck/zfs-snap-diff/pkg/config" "github.com/j-keck/zfs-snap-diff/pkg/fs" "github.com/j-keck/zfs-snap-diff/pkg/webapp" "github.com/j-keck/zfs-snap-diff/pkg/zfs" "os" "strings" ) var version string = "SNAPSHOT" type CliConfig struct { l...
package zeekio import ( "bytes" "errors" "net" "unicode/utf8" "github.com/brimdata/zed" "github.com/brimdata/zed/pkg/byteconv" "github.com/brimdata/zed/pkg/nano" "github.com/brimdata/zed/zcode" "golang.org/x/text/unicode/norm" ) type builder struct { zcode.Builder buf []byte fields [...
package testy import ( "time" "github.com/gametimesf/testy/internal/orderedmap" ) type testy struct { tests orderedmap.OrderedMap[string, *testPkg] db DB } type testPkg struct { name string tests orderedmap.OrderedMap[string, testCase] BeforePackage Tester AfterPackage Tester BeforeTes...
package proxy import ( "bytes" "io" "log" "net" "strconv" "sync" "time" "github.com/lucas-clemente/quic-go" "github.com/net-byte/qsocks/common/enum" "github.com/net-byte/qsocks/config" ) func UDPProxy(tcpConn net.Conn, udpConn *net.UDPConn, config config.Config) { defer tcpConn.Close() if udpConn == nil ...
// Package cgi flexibly implements the CGI as specified in RFC 3875. // Allows for non-CGI conforming executables to be used and provides default headers. // The executable set to handle the HTTP requests is always provided with the environment variables described in // RFC 3875 Sections 4.1.2 - 4.1.5, 4.1.7 - 4.1.9, a...