text
stringlengths
3.08k
10.4k
package dkgtasks import ( "context" "math/big" "github.com/MadBase/MadNet/blockchain/dkg" "github.com/MadBase/MadNet/blockchain/interfaces" "github.com/MadBase/MadNet/blockchain/objects" "github.com/ethereum/go-ethereum/common" "github.com/sirupsen/logrus" ) // DisputeMissingShareDistributionTask stores the d...
// Copyright 2018 The mkcert Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Command mkcert is a simple zero-config tool to make development certificates. package mkcert import ( "crypto" "crypto/x509" "github.com/pubgo/antpro...
// Copyright (c) 2022 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 ...
package dao import ( "platform_report/lib" "time" ) type ReportTargetDefines struct { Tip string `json:"tip"` TargetId string `json:"target_id"` Icon string `json:"icon"` EngName string `json:"eng_name"` ChsName string `json:"chs_name"` ReportId string `json:"report_id"` ReportNa...
package dolo import ( "fmt" "github.com/boggydigital/nod" "net/http" "net/url" "os" "strconv" ) //Download gets remote resource, attempting to resume existing partial downloads if the previous //attempt got interrupted. Download supports nod progress reporting. //Download will use provided path parts (see NewRe...
package service import ( "errors" "fmt" "github.com/360EntSecGroup-Skylar/excelize" "go-admin/app/plugins/content/models" "go-admin/app/plugins/content/service/dto" "go-admin/common/core/sdk/service" "gorm.io/gorm" "time" "go-admin/common/actions" cDto "go-admin/common/dto" ) type Announcement struct { se...
package cli import ( "bytes" "context" "fmt" "regexp" "sort" "text/template" "github.com/cheynewallace/tabby" "github.com/linode/linodego" "github.com/sethvargo/go-password/password" ) type PrintInstancesOptions struct { Type string Options map[string]*string } type bootstrapInfo struct { Label ...
package main import ( "bufio" "fmt" "os" "os/exec" "strings" "zgo.at/zli" "zgo.at/zstd/zstring" ) const usage = `gomodgraph takes the output of "go mod graph" and prints it as a tree. https://github.com/arp242/gomodgraph Usage: % go mod graph | gomodgraph Flags: -h, -help Show this help....
package errors import ( "net/http" ) /* 错误码设计 第一位表示错误级别, 1 为系统错误, 2 为普通错误 第二三四位表示服务模块代码 第五六位表示具体错误代码 */ type Errno struct { Code int // 错误码 Message string // 展示给用户看的 HttpCode int // HTTP状态码 } var ( OK = &Errno{Code: 0, Message: "OK", HttpCode: http.StatusOK} DelSignOK = &Errno{Code: 1, Mes...
package server import ( "bufio" "bytes" "crypto/tls" "log" "net" "net/http" "strconv" "github.com/gorilla/websocket" "github.com/luyuhuang/subsocks/utils" ) func (s *Server) wssHandler(conn net.Conn) { s.wsHandler(tls.Server(conn, s.TLSConfig)) } func (s *Server) wsHandler(conn net.Conn) { s.socksHandler...
package main import ( "crypto/tls" "encoding/json" "fmt" "io" "log" "net/http" "net/smtp" "os" "strconv" "time" "golang.org/x/crypto/acme/autocert" ) // LoggingResponseWriter is a response writer that logs requests type LoggingResponseWriter struct { http.ResponseWriter status int } // NewLoggingRespon...
package observer import ( "bytes" "errors" "io" "runtime" "sync" "testing" "time" ) /* what to test: - queuing - terminate -> kill escalation - execution in order - skipping - running multiple observers at the same time (concurrency) - filechanged -> command execution */ type mockProcess struct { terminated...
package triangle import ( "errors" "fmt" "math" "math/big" "strings" ) type side float64 type angle float64 func (triangle AbstractTriangle) isEqual(otherTriangle AbstractTriangle) bool { return triangle.A.isEqual(otherTriangle.A) && triangle.B.isEqual(otherTriangle.B) && triangle.C.isEqual(otherTriangle.C...
package freee import ( "bytes" "context" "encoding/json" "errors" "io" "io/ioutil" "mime/multipart" "net/http" "net/url" "path" "golang.org/x/oauth2" ) const ( HeaderXAPIVersion = "X-Api-Version" HeaderXFreeeRequestID = "X-Freee-Request-ID" APIEndpoint = "https://api.freee.co.jp" APIPath1...
package main import ( "os" "fmt" "math" "math/rand" "runtime" "gonum.org/v1/gonum/mat" "github.com/phil-mansfield/nbody-utils/box" "github.com/phil-mansfield/tetra_deformation/lib" "github.com/phil-mansfield/gotetra/render/io" "github.com/phil-mansfield/gotetra/render/geom" "github.com/phil-mansfield/minn...
package conf import ( "flag" "os" "strconv" "strings" "time" "github.com/BurntSushi/toml" "github.com/bilibili/discovery/naming" "github.com/Terry-Mao/goim/logger" xtime "github.com/Terry-Mao/goim/pkg/time" ) var ( confPath string region string zone string deployEnv string host string a...
package blockstore import ( "context" blocks "github.com/ipfs/go-block-format" cid "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" dsns "github.com/ipfs/go-datastore/namespace" dsq "github.com/ipfs/go-datastore/query" ib "github.com/ipfs/go-ipfs-blockstore" dshelp "github.com/ipfs/go-ipfs-ds-help" ...
package keeper import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" gogotypes "github.com/gogo/protobuf/types" "github.com/umee-network/umee/x/leverage/types" ) // DeriveBorrowAPY derives the current borrow interest rate on a token denom // using its bor...
/* 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) 2022 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
package dbmodel import ( "fmt" "strings" "time" "github.com/influxdata/jaeger-influxdb/common" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/storage/spanstore" ) // InfluxQLTraceQuery abstracts an InfluxQL query for spans type InfluxQLTraceQuery struct { measurement s...
package svm // #include <stdint.h> // #include "./svm.h" // // extern void kv_get(uint8_t*, uint32_t, uint8_t*, uint32_t*); // extern void kv_set(uint8_t*, uint32_t, uint8_t*, uint32_t); // extern void kv_discard(); // extern void kv_checkpoint(uint8_t*); // extern void kv_head(uint8_t*); // import "C" import ( "fmt"...
package revgen import ( "errors" "fmt" "os" "path/filepath" "strings" "github.com/urfave/cli/v2" ) var ( errMissingConfig = errors.New("no valid config file found, run 'revgen init' to create one") errExistingConfig = errors.New("config file found, run 'revgen update' to update it with new go::generators") ...
// Licensed to 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. Apache Software Foundation (ASF) licenses this file to you under // the Apache License, Version 2.0 (the "Li...
/* * Copyright 2018 InfAI (CC SES) * * 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 t...
package main import ( "flag" "fmt" "github.com/warm-metal/bindhost/pkg/plugin" "github.com/warm-metal/bindhost/pkg/plugins/cri" "github.com/warm-metal/bindhost/pkg/plugins/fstab" "k8s.io/klog/v2" "k8s.io/utils/mount" "os" "os/exec" "os/signal" "path/filepath" "strings" "syscall" ) var ( rootfs = "" ...
// Copyright 2020 The Meerkat Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
// Package glsql (Gitaly SQL) is a helper package to work with plain SQL queries. package glsql import ( "context" "database/sql" "strconv" "strings" // Blank import to enable integration of github.com/lib/pq into database/sql _ "github.com/lib/pq" migrate "github.com/rubenv/sql-migrate" "github.com/sirupsen/...
package github import ( "context" "fmt" "strings" "time" "github.com/google/go-github/v33/github" "github.com/shurcooL/githubv4" "github.com/philips-labs/tabia/lib/github/graphql" "github.com/philips-labs/tabia/lib/shared" ) type RestRepo struct { Name string } type Repository struct { ID str...
package server import ( "fmt" "io/ioutil" "log" "net" "net/http" "net/url" "runtime/debug" "strings" "time" ) /* HttpServer server proxy the connections. Its handles http and https proxy connections */ type HttpServer struct { useNewPipe bool pipe func(net.Conn, net.Conn) } type redirectError struct...
package sequence import ( "fmt" "sort" "github.com/0xsequence/ethkit/ethcoder" "github.com/0xsequence/ethkit/go-ethereum/common" "github.com/0xsequence/ethkit/go-ethereum/crypto" ) type WalletConfig struct { Threshold uint16 `json:"threshold"` Signers WalletConfigSigners `json:"signers"` } typ...
package antsdb import ( "context" "time" ipfslite "github.com/hsanjuan/ipfs-lite" "github.com/ipfs/go-datastore" ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" "github.com/ipfs/go-datastore/query" crdt "github.com/ipfs/go-ds-crdt" logging "github.com/ipfs/go-log/v2" "github.com/l...
package ooyalaV2SDK import ( "bytes" "crypto/sha256" "encoding/base64" "errors" "fmt" "io" "io/ioutil" "log" "net/http" "net/url" "sort" "strconv" "time" ) // NewAPI Factory function returns a new api instance. func NewAPI(apiKey, apiSecret string, expires int64) *OoyalaAPI { api := OoyalaAPI{} params ...
// storage/split.go // Copyright(c) 2017 <NAME> // BSD licensed; see LICENSE for details. package storage import ( "bufio" "bytes" "io" ) type MerkleHash struct { Hash Hash Level uint8 } func MerkleFromSingle(hash Hash) MerkleHash { return MerkleHash{hash, 0} } func (sh *MerkleHash) Bytes() []byte { var b ...
//go:generate go run -tags=dev assets_generate.go package main import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" "net/http/httputil" "os" "strings" "time" "github.com/CyberGRX/api-connector-bulk/assets" "github.com/CyberGRX/api-connector-bulk/docs" "github.com/gin-contrib/static" "github.com/g...
// Copyright 2019 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Code generated by the Pulumi SDK Generator DO NOT EDIT. // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** package networkfirewall import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Resource type definition for AWS::Ne...
package application import ( "bytes" "encoding/base64" "encoding/json" "fmt" "regexp" "sync" "time" log "github.com/Sirupsen/logrus" "github.com/brocaar/loraserver/internal/backend" "github.com/brocaar/loraserver/models" "github.com/brocaar/lorawan" "github.com/eclipse/paho.mqtt.golang" "github.com/garyb...
package respond_test import ( "bytes" "encoding/json" "net/http" "net/http/httptest" "testing" "github.com/stretchr/respond" "github.com/stretchr/testify/require" ) var testObject1 = map[string]interface{}{"one": 1, "yes": true, "name": "Stretchr"} func TestRespond(t *testing.T) { for i, test := range []st...
package bigqueue import ( "errors" "strings" ) const ( cInt64Size = 8 ) var ( // ErrEmptyQueue is returned when peek/dequeue is performed on an empty queue ErrEmptyQueue = errors.New("queue is empty") ) // Peek returns the head (slice of bytes) of the queue func (q *MmapQueue) Peek() ([]byte, error) { br := &...
package gql import ( "context" "fmt" "strings" "sync" "github.com/grailbio/gql/hash" "github.com/grailbio/gql/marshal" ) // mapFilterTable implements map() or filter(). type mapFilterTable struct { hashOnce sync.Once hash hash.Hash ast ASTNode // source-code location. src Table // The table to read ...
package state import ( "context" "fmt" "sync" "time" "github.com/timescale/promscale/pkg/ha/client" "github.com/timescale/promscale/pkg/pgmodel/metrics" ) // Lease represents the state of a lease for a cluster // in a given time. It shows which instance is the leader, // and the data time range for which the l...
package golist import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "time" ) type Package struct { Dir string // directory containing package sources ImportPath string // import path of package in dir ImportComment string // path in import co...
// Copyright 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 to in ...
package typeform import ( "fmt" "strings" "time" "encoding/json" "github.com/deze333/alienplugs/util" ) //------------------------------------------------------------ // TypeForm data structures: Responses API //------------------------------------------------------------ type Responses struct { TotalItems ...
package main import ( "context" "errors" "fmt" "io" "io/ioutil" "math" "os" "path" "time" "gocloud.dev/blob" _ "gocloud.dev/blob/fileblob" _ "gocloud.dev/blob/gcsblob" _ "gocloud.dev/blob/s3blob" "gocloud.dev/pubsub" _ "gocloud.dev/pubsub/gcppubsub" _ "gocloud.dev/pubsub/kafkapubsub" "github.com/oss...
/****************************************************************************** * * Description : * * Handler of long polling clients. See also hdl_websock.go for web sockets and * hdl_grpc.go for gRPC * *****************************************************************************/ package main import (...
/******************************************************************************* * * Copyright 2017-2020 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You should have received a copy of the License along with this * progra...
package solc import ( "encoding/json" "fmt" "io" "io/ioutil" "log" "net/http" "net/url" "os" "path/filepath" "runtime" "sort" "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common/compiler" "github.com/shibukawa/configdir" "github.com/withtally/synceth/parser" ) // See: https://do...
// Copyright (c) 2017-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...
package main import ( "fmt" "net" "net/http" "os" "time" "github.com/digineo/go-ping" mon "github.com/digineo/go-ping/monitor" "github.com/fightdou/host-exporter/config" "github.com/fightdou/host-exporter/pkg" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prome...
package perfmon import ( "fmt" "os" "runtime" "time" "github.com/aliyun/aliyun_assist_client/agent/clientreport" "github.com/aliyun/aliyun_assist_client/agent/log" "github.com/aliyun/aliyun_assist_client/agent/metrics" "github.com/aliyun/aliyun_assist_client/agent/statemanager" "github.com/aliyun/aliyun_assi...
/* This package provides configuration for Hydra This includes the Request Abstract. Individual structs as *_config will hold configurations specific to the individual components in Felicity Platform. This package uses Viper for Configuration Management Author: Operations Management Team - Unotech Software */ pa...
package k8shandler import ( "context" "fmt" postgresqlv1 "github.com/mcyprian/postgresql-operator/pkg/apis/postgresql/v1" "github.com/sirupsen/logrus" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" ) type deploymentNode struct { s...
package main import ( "encoding/json" "errors" "fmt" "io" "strings" "github.com/vadimi/grpc-ditto/internal/dittomock" "github.com/vadimi/grpc-ditto/internal/logger" "github.com/golang/protobuf/jsonpb" "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "google.golang.org/grpc" "g...
package game import "github.com/moshenahmias/gopherboy/memory" import "github.com/moshenahmias/gopherboy/cpu" import "time" // MBC3 (max 2MByte ROM and/or 32KByte RAM and Timer) type MBC3 struct { rom *memory.ROM otherBanks *memory.ROM ram *memory.RAM bankRAM uint32 ...
package v1 import ( "fmt" "gin-vue-admin/global" "gin-vue-admin/model" "gin-vue-admin/model/request" "gin-vue-admin/model/response" "gin-vue-admin/service" "github.com/gin-gonic/gin" "go.uber.org/zap" ) // @Tags Branch_office // @Summary 创建Branch_office // @Security ApiKeyAuth // @accept app...
/* * 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 ...
// Copyright 2014 The Azul3D 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 grid implements D* Lite grid-based pathfinding. package grid import ( "math" "azul3d.org/engine/dstarlite" ) // Coord represents an single g...
/* Package app is the primary runtime service. */ package app import ( "context" "crypto/tls" "fmt" "github.com/julienschmidt/httprouter" "github.com/madflojo/hord" "github.com/madflojo/hord/drivers/redis" "github.com/madflojo/tasks" "github.com/sirupsen/logrus" "github.com/spf13/viper" "net/http" "os" "os...
package odoo import ( "fmt" ) // PaymentTransaction represents payment.transaction model. type PaymentTransaction struct { LastUpdate *Time `xmlrpc:"__last_update,omptempty"` AcquirerId *Many2One `xmlrpc:"acquirer_id,omptempty"` AcquirerReference *String `xmlrpc:"acquirer_reference,omptempt...
/* 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 this fi...
package main import ( "context" "fmt" "os" "path/filepath" "strings" "time" "github.com/yuin/gopher-lua" "mvdan.cc/sh/v3/shell" //"github.com/yuin/gopher-lua/parse" "mvdan.cc/sh/v3/interp" "mvdan.cc/sh/v3/syntax" ) func runInput(input string) { running = true cmdString := aliases.Resolve(input) // If ...
package grpc import ( "context" "testing" "google.golang.org/grpc" "google.golang.org/grpc/metadata" "github.com/stretchr/testify/assert" ) type ( SetHeaderMock struct { InMD metadata.MD OutError error } SendHeaderMock struct { InMD metadata.MD OutError error } SetTrailerMock struct { ...
package mtproto import ( "io/ioutil" "log" "os" "strconv" "time" ) func (m *MTProto) GetPhoto(volumeID, secret int64, localID, offset int32, flag bool) (TL, error) { resp := make(chan response, 1) fileLocation := TL_inputFileLocation{volumeID, localID, secret} if flag { m.queueSend <- packetToSend{ msg:...
/* * Copyright (c) 2019. Aberic - 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 ...
// This file contains slightly modified code from the Gorilla project. // // Copyright 2013 The Gorilla Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license below // // Source: // https://github.com/gorilla/handlers/blob/master/handlers.go // // Copyright (c) 2013 The Gorilla H...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Gets a datasource. **Note:** This API requires an admin account to ex...
// 13 february 2014 package ui import ( "fmt" ) type orientation bool const ( horizontal orientation = false vertical orientation = true ) // A Stack stacks controls horizontally or vertically within the Stack's parent. // A horizontal Stack gives all controls the same height and their preferred widths. // A ...
package credentials import ( "encoding/base64" "encoding/hex" "errors" "fmt" "regexp" "strings" "github.com/secrethub/secrethub-go/internals/api" "github.com/secrethub/secrethub-go/internals/auth" "github.com/secrethub/secrethub-go/internals/crypto" "github.com/secrethub/secrethub-go/pkg/secrethub/internals...
package cmd import ( "encoding/json" "fmt" "io/ioutil" "net/http" "net/url" "os" "os/exec" "strconv" "strings" "github.com/labstack/echo" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) var addUsage = `Usage: unislet add [OPTIONS] Options: -e, --environment Set environment (Docker or U...
package main import ( "bufio" "fmt" "log" "os" ) type Ferry struct { SeatingStates []SeatingState MaxRow int MaxCol int } type SeatingState = map[Location]Status type Location struct { Row int Column int } type Status = string const ( Occupied Status = "#" Empty Status = "L" Floor ...
// Copyright 2018 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. // +build !windows // keybase-mount-helper is a simple program intended to be run with // SUID permissions as a keybase helper user, which manages the // /var/lib/keyba...
package installations import ( "context" "encoding/json" "fmt" "os" inspect "github.com/gardener/landscapercli/cmd/installations/inspect" "github.com/go-logr/logr" "github.com/spf13/cobra" "github.com/spf13/pflag" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" "k8s.io/client-go/tools/clie...
package web import ( "context" "encoding/json" "fmt" "io" "net/http" "net/url" ) type ( // Builder is the main entrypoint to the web package Builder interface { // Client sets the *http.Client to use for the request Client(client *http.Client) Builder // Transport is shorthand for Client(&http.Client{...
// Copyright 2018 Istio 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 i...
// Copyright 2017 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
package converter_test import ( "fmt" "strings" "testing" "github.com/stretchr/testify/require" "moul.io/converter" ) func TestConverter(t *testing.T) { cases := []struct { input interface{} converters []string expectedOutput interface{} expectedRunError bool expectedInitError ...
package main import ( "fmt" "math" "github.com/Data-Structures-and-Algorithms/Go/Algorithms/Graph-Algorithms/djikstras/minheapmap" ) //Using a MinHeap with O(1) Lookup for an implementation of the Djikstras algo for minimum cost spanning path. type node struct { name string //ID of the node neighbo...
// Copyright © 2018 <NAME>, github.com/zatte // // 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 image import ( "fmt" "image" "image/draw" "io" "log" "os" "path" "github.com/nfnt/resize" ) // ThumbOption ... type ThumbOption struct { Width, Height uint MaxWidth, MaxHeight uint IsFit bool IsCrop bool CropX, CropY int ctWidth, ctHeight uint // for cr...
/* Copyright 2020 The Flux 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, softwar...
package redis import ( "errors" "fmt" "gopkg.in/redis.v4/internal" ierrors "gopkg.in/redis.v4/internal/errors" "gopkg.in/redis.v4/internal/pool" "gopkg.in/redis.v4/internal/proto" ) // Redis transaction failed. const TxFailedErr = ierrors.RedisError("redis: transaction failed") var errDiscard = errors.New("re...
package lexer import "github.com/skatsuta/monkey-compiler/token" // Lexer represents a lexer for Monkey programming language. type Lexer interface { // NextToken returns a next token. NextToken() token.Token } type lexer struct { input string // current position in input (points to current char) position int /...
package provisioning import ( "github.com/kyma-incubator/compass/components/provisioner/internal/installation/release" "github.com/kyma-incubator/compass/components/provisioner/internal/persistence/dberrors" "github.com/kyma-incubator/compass/components/provisioner/internal/util" "github.com/pkg/errors" "github....
// Copyright 2017 Drone.IO Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gitlab import ( "context" "fmt" "net/url" "strings" "time" "github.com/jenkins-x/go-scm/scm" ) type gitService struct { client *wrapper } func ...
// Copyright 2018 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 ...
// Code generated by smithy-go-codegen DO NOT EDIT. package datasync import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datasync/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/...
package e2e import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "regexp" "strings" "testing" "text/template" "gotest.tools/assert" "gotest.tools/fs" "gotest.tools/golden" "gotest.tools/icmd" ) func TestPushAndPullCNAB(t *testing.T) { dir := fs.NewDir(t, t.Name()) defer dir.Remove() r := s...
// Copyright (C) MongoDB, Inc. 2017-present. // // 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 // Package primitive contains types similar to Go ...
package api import ( "bytes" "crypto/tls" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "os" "strconv" "strings" "time" "github.com/hashicorp/go-cleanhttp" rootcerts "github.com/hashicorp/go-rootcerts" ) // Much of this is cribbed from https://github.com/hashicorp/nomad/blob/master/api/api.g...
package main import ( "flag" "fmt" "os" "os/signal" "runtime" "syscall" "time" "github.com/signalwire/signalwire-golang/signalwire" ) // App environment settings var ( // required ProjectID = os.Getenv("ProjectID") TokenID = os.Getenv("TokenID") DefaultContext = os.Getenv("DefaultContext") /...
// +build ignore // Copyright 2019 The TCell Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use 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 la...
// Copyright 2016 Google 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 applicable...
package vm // Definition states the configuration of a VM within the anxcloud. type Definition struct { Location string `json:"-"` TemplateType string `json:"-"` TemplateID string `json:"-"` // Required - VM hostname // Example: ('my-awesome-new-vm', 'web-001', 'db-001', …) // The hostname will be auto pr...
/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package codegen import ( "bytes" "fmt" "strconv" "strings" "text/template" "unicode" ) type Object struct { *NamedType Fields []Field Satisfies []string Root bool DisableConcurrency bool Stream bool } type Field struct { *Type GQLName string ...
package regional_parameters import ( "errors" "fmt" "math/rand" "time" c "github.com/arslab/lwnsimulator/simulator/components/device/features/channels" models "github.com/arslab/lwnsimulator/simulator/components/device/regional_parameters/models_rp" "github.com/brocaar/lorawan" ) type Cn779 struct { Info mod...
package gogm import ( "fmt" "math" ) // Vec3 is a vector with 3 components, of type T. type Vec3[T number] [3]T // Vec3CopyVec3 copies the content of src to dst. func Vec3CopyVec3[T1, T2 number](dst *Vec3[T1], src *Vec3[T2]) { dst[0] = T1(src[0]) dst[1] = T1(src[1]) dst[2] = T1(src[2]) } // Vec3CopyVec2 copies...
/* Copyright 2021 The KubeSphere 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 wri...