text
stringlengths
3.08k
10.4k
// // Copyright (c) 2014 10X Genomics, Inc. All rights reserved. // // Martian error types. // package syntax import ( "fmt" "strings" ) type errorWriter interface { writeTo(w stringWriter) } // AstError type AstError struct { global *Ast Node *AstNode Msg string } func (self *AstError) writeTo(w string...
package geom import ( "fmt" "sort" ) // GetConvexHull pnts sorted in ccw func GetConvexHull(pnts []Pnt) []Pnt { sort.Sort(ByXThenY(pnts)) count := len(pnts) p1 := pnts[0] pn := pnts[count-1] ePnts := make([]Pnt, 0) pnts1 := make([]Pnt, 0) pnts2 := make([]Pnt, 0) for i := 1; i < count-1; i++ { d := areaWit...
package reflector import ( "io/ioutil" "os" "path" "sync" "time" "github.com/irmf/reflector.go/db" "github.com/irmf/reflector.go/store" "github.com/lbryio/lbry.go/v2/extras/errors" "github.com/lbryio/lbry.go/v2/extras/stop" log "github.com/sirupsen/logrus" ) type increment int const ( sdInc increment =...
package builder // This file implements a job runner for the compiler, which runs jobs in // parallel while taking care of dependencies. import ( "container/heap" "errors" "fmt" "runtime" "sort" "strings" "time" ) // Set to true to enable logging in the job runner. This may help to debug // concurrency or per...
package main import ( "context" "encoding/json" "strings" "testing" "time" "github.com/datawire/ambassador/pkg/consulwatch" "github.com/datawire/ambassador/pkg/watt" "github.com/datawire/ambassador/pkg/k8s" "github.com/datawire/ambassador/pkg/limiter" "github.com/datawire/ambassador/pkg/supervisor" ) typ...
package main import ( "bytes" "encoding/base64" "encoding/csv" "fmt" "io" "io/ioutil" "log" "os" "path/filepath" "regexp" "sort" "strings" "sync" "github.com/araddon/dateparse" "github.com/jhillyerd/enmime" ) const ( malformedMIMEHeaderLineErrorMessage = "malformed MIME header line: " ) var ( base6...
package gb import ( "fmt" "go/build" "path/filepath" "strings" ) // Package represents a resolved package from the Project with respect to the Context. type Package struct { *Context *build.Package Scope string // scope: build, test, etc ExtraIncludes string // hook for test Stale bool // i...
package vpc import ( "encoding/csv" "fmt" "log" "strconv" "sync" "github.com/afeeblechild/aws-go-tool/lib/utils" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" ) type RegionVpcs struct { AccountId string Region string Profile string Vpcs []ec2.Vpc Subnets []e...
package ot import ( "errors" "time" "github.com/wonder-wonder/cakemix-server/db" ) const serverStopDelay = 30 type otStatus int const ( otStatusStarting otStatus = iota otStatusRunning otStatusStopping ) type otServerRequestType int const ( otServerRequestTypeStarted otServerRequestType = iota otServerRe...
/* Copyright 2020 Authors of Arktos. 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, softw...
package vsphere import ( "context" "encoding/json" "fmt" "log" "os" "github.com/pkg/errors" config "github.com/openshift/api/config/v1" mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" vsphere "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" core "k8s.io...
package netutil import ( "net" "strconv" "strings" "github.com/AdguardTeam/golibs/stringutil" ) // Reversed ARPA Addresses // fromHexByte converts a single hexadecimal ASCII digit character into an // integer from 0 to 15. For all other characters it returns 0xff. func fromHexByte(c byte) (n byte) { switch { ...
// Copyright 2017 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 ( "fmt" "io" "os" "regexp" "time" "golang.org/x/net/context" "infra/tools/git/state" "go.chromium.org/luci/cipd/version" ...
// // 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 main import ( "fmt" "os" "path/filepath" "regexp" "time" ) //Function to check if the end date is before the start date func checkDate(startDate time.Time, endDate time.Time) bool { return startDate.Before(endDate) } //Function to check the use inputted date format is valid func validat...
/* 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, soft...
// 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright 2018 The Cockroach Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// package s3 implements an s3 api compatible log store package s3 import ( "bytes" "context" "encoding/base64" "errors" "fmt" "io" "net/url" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session"...
package ecc import ( "encoding/json" "errors" "fmt" "strings" "github.com/Jumper-Bridge/cyberway/btcsuite/btcd/btcec" "github.com/Jumper-Bridge/cyberway/btcsuite/btcutil/base58" ) // var PublicKeyPrefix = "PUB_" // var PublicKeyK1Prefix = "PUB_K1_" // var PublicKeyR1Prefix = "PUB_R1_" // var PublicKeyWAPrefix ...
package requests import ( "encoding/json" "fmt" "io/ioutil" "net/http" "net/url" "strings" "github.com/google/go-querystring/query" "github.com/atomicjolt/canvasapi" "github.com/atomicjolt/canvasapi/models" "github.com/atomicjolt/string_utils" ) // ListAssignmentsAssignmentGroups Returns the paginated lis...
package nvidia import ( "fmt" "strconv" "time" log "github.com/golang/glog" v1 "k8s.io/api/core/v1" ) // update pod env with assigned status func updatePodAnnotations(oldPod *v1.Pod) (newPod *v1.Pod) { newPod = oldPod.DeepCopy() if len(newPod.ObjectMeta.Annotations) == 0 { newPod.ObjectMeta.Annotations = ma...
// Package netutil contains common utilities for IP, MAC, and other kinds of // network addresses. package netutil import ( "errors" "fmt" "net" "net/url" "strconv" "strings" "golang.org/x/net/idna" ) // Various Network Address Utilities // CloneMAC returns a clone of a MAC address. func CloneMAC(mac net.Har...
// Copyright 2015 The LUCI Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
package models import ( "strings" "time" jwtgo "github.com/dgrijalva/jwt-go" "github.com/gosimple/slug" "github.com/jinzhu/gorm" ) type User struct { gorm.Model Username string `json:"username" form:"username" gorm:"type:varchar(50);not null;unique_index" binding:"required,min=6,max=50"` Password string `j...
// Copyright 2019 The Prometheus 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...
package html import ( "strings" "testing" "github.com/stretchr/testify/assert" "golang.org/x/net/html" "github.com/zoomio/tagify/config" "github.com/zoomio/tagify/extension" "github.com/zoomio/tagify/model" ) const ( htmlWithImg = ` <html> <body> <h2>What a beautiful day today!</h2> <div><img src="https...
// Package parser parses incoming JSON files from Android Testing and converts them // into a format acceptable to Skia Perf. package parser import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "strconv" "strings" "go.skia.org/infra/go/metrics2" "go.skia.org/infra/go/sklog" "go.skia.org/infra/p...
// Copyright 2021 gotomicro // // 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...
// Code generated by go-swagger; DO NOT EDIT. package users // 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/go...
/* Copyright 2020 The Alibaba 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 main import ( "context" "fmt" "github.com/function61/gokit/dynversion" "github.com/function61/gokit/jsonfile" "github.com/function61/gokit/logex" "github.com/function61/gokit/ossignal" "github.com/function61/gokit/systemdinstaller" "github.com/joonas-fi/modemrebooter/pkg/internetupdetector" "github.co...
// Copyright ©2021 The star-tex 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 tfm import ( "bytes" "fmt" "io" "star-tex.org/x/tex/font/fixed" "star-tex.org/x/tex/internal/iobuf" ) type fontFamily string const ( fo...
// 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wr...
// Copyright (C) 2018, <NAME> (Flaxen Consulting) // // Portions of this code were derived from the PROJ.4 software // In keeping with the terms of the PROJ.4 project, this software // is provided under the MIT-style license in `LICENSE.md` and may // additionally be subject to the copyrights of the PROJ.4 authors. pa...
package goapi import ( "encoding/json" "fmt" hocon "github.com/go-akka/configuration" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" "google.golang.org/grpc" "io/ioutil" "log" pb "main/grpc" "main/src/itineris" "main/src/utils" "net" "net/http" "os" "regexp" "time" ) const ( d...
// Copyright 2020 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...
// Copyright (c) 2016 Arista Networks, Inc. // Use of this source code is governed by the Apache License 2.0 // that can be found in the COPYING file. package daemon // This file holds the special type, which represents devices files, fifos and unix // domain sockets import ( "fmt" "syscall" "github.com/aristane...
package cmd import ( "crypto/tls" "fmt" "io/ioutil" "log" "net/http" "os" "time" "github.com/plentico/plenti/cmd/build" "github.com/plentico/plenti/common" "github.com/plentico/plenti/readers" "github.com/MakeNowJust/heredoc/v2" "github.com/briandowns/spinner" "github.com/gerald1248/httpscerts" "gith...
package rt import ( "encoding/json" "github.com/pkg/errors" "github.com/suborbital/grav/grav" "github.com/suborbital/reactr/rcap" "github.com/suborbital/vektor/vlog" ) // MsgTypeReactrJobErr and others are Grav message types used for Reactr job const ( MsgTypeReactrJobErr = "reactr.joberr" // any kind of er...
// Copyright 2020 <NAME> // SPDX-License-Identifier: Apache-2.0 // package coreutil provides functions to describe interface of the core contract // in a compact way package coreutil import ( "fmt" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/iscp" "github.com/iotaledger/was...
// The MIT License (MIT) // // Copyright (c) 2017-2020 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 right...
package abi import ( "fmt" "math/big" "math/rand" "reflect" "strings" "github.com/umbracle/go-web3" ) func randomInt(min, max int) int { return min + rand.Intn(max-min) } var randomTypes = []string{ "bool", "int", "uint", "array", "slice", "tuple", "address", "string", "bytes", "fixedBytes", } fun...
// +build e2e /* Copyright 2018 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 i...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sagemaker import ( "context" "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) // Please also see https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobsRequest type ListT...
// Copyright 2019-2022 The Liqo Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
package netutil import ( "net" "strings" ) // IP Address Constants And Utilities // Bit lengths of IP addresses. const ( IPv4BitLen = net.IPv4len * 8 IPv6BitLen = net.IPv6len * 8 ) // CloneIP returns a clone of an IP address that doesn't share the same // underlying array with it. func CloneIP(ip net.IP) (clone...
package main import ( "flag" "fmt" "io/ioutil" "os" "path" "strings" "time" "github.com/Masterminds/goutils" "github.com/ahmdrz/goinsta/v2" sentry "github.com/getsentry/raven-go" "github.com/gorilla/feeds" "github.com/pkg/errors" ) var ( insta *goinsta.Instagram sendtoSentry bool configFile s...
package main import ( "context" "flag" "os" "path/filepath" "time" "github.com/cenkalti/backoff/v3" "github.com/threefoldtech/zos/pkg" "github.com/threefoldtech/zos/pkg/app" "github.com/threefoldtech/zos/pkg/environment" "github.com/threefoldtech/zos/pkg/provision/explorer" "github.com/threefoldtech/zos/pk...
package aliyundrive import ( "context" "fmt" "net/http" "time" ) type ShareFile struct { Popularity int `json:"popularity"` ShareId string `json:"share_id"` ShareMsg string `json:"share_msg"` ShareName string `json:"share_name"` Description string `json:"description"` E...
package webview import ( "time" "github.com/windmilleng/tilt/internal/container" "github.com/windmilleng/tilt/internal/dockercompose" "github.com/windmilleng/tilt/internal/k8s" "github.com/windmilleng/tilt/pkg/model" ) type ResourceInfoView interface { resourceInfoView() RuntimeLog() model.Log Status() strin...
package apps import ( "encoding/json" "io" ) // CallType determines what action is expected of a function. type CallType string const ( // CallTypeSubmit (default) indicates the intent to take action. CallTypeSubmit CallType = "submit" // CallTypeForm retrieves the form definition for the current set of values...
// Copyright 2017-2018 New Vector Ltd // Copyright 2019-2020 The Matrix.org Foundation C.I.C. // // 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/LICE...
package policies import ( "github.com/dynuc/gophercloud" "github.com/dynuc/gophercloud/pagination" ) type RuleId struct { ID string `json:"id"` } type Policies struct { // Specifies the ID of the backend server group to which the requests are forwarded. RedirectPoolID string `json:"redirect_pool_id"` // P...
package qry import ( "fmt" "xelf.org/xelf/cor" "xelf.org/xelf/exp" "xelf.org/xelf/lit" "xelf.org/xelf/typ" ) // Spec is the implementation to resolve calls on query subjects. It sets up the job environment, // resolves arguments to form the task and calls the backend to execute the job when evaluated. type Spec...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rds import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type DescribeInstallationMediaInput struct { _ struct{} `type:"structure"` // A filter that specifies one or more inst...
package main import ( "fmt" "io" "net/http" "net/http/httputil" "os" "os/exec" "path/filepath" "runtime" "strings" ) const ( cliName = "Waldo CLI" cliVersion = "2.0.2" cliAssetBaseURL = "https://github.com/waldoapp/waldo-go-agent/releases" ) var ( cliAgentPath string cliAssetURL string cliWor...
// Copyright 2020 <NAME> 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 ...
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
// +build acceptance package application import ( "fmt" "testing" "github.com/kyma-project/kyma/tests/console-backend-service/internal/domain/shared/auth" tester "github.com/kyma-project/kyma/tests/console-backend-service" "github.com/kyma-project/kyma/tests/console-backend-service/internal/graphql" "github.c...
package server import ( "context" "net/http" "net/http/httptest" "os" "os/signal" "syscall" "time" "github.com/netlify/netlify-commons/nconf" "github.com/netlify/netlify-commons/router" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) const ( defaultPort = 9090 defaultHealthPath = "/health" ...
package contract import ( "encoding/json" "testing" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/confio/tgrade/x/poe/types" ) // TG4EngagementInitMsg contract init message // See https://github.com/confio/tgr...
package main import ( "fmt" "io" "log" "net" "net/http" "net/url" "time" "github.com/foobarren/appdash" "github.com/foobarren/appdash/httptrace" "github.com/foobarren/appdash/traceapp" ) func init() { _, err := CLI.AddCommand("demo", "start a demo web app that uses appdash", "The demo command starts a...
package main import ( "encoding/json" "net" "net/http" "net/url" "strings" "time" "unicode" "github.com/sirupsen/logrus" "github.com/spf13/viper" "gopkg.in/alexcesaro/statsd.v2" ) func init() { viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) viper.AutomaticEnv() viper.SetDefault("log-level", "wa...
package app import ( "context" "fmt" "strings" "github.com/criticalstack/ui/api/v1alpha1" "github.com/criticalstack/ui/internal/log" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/kube" "helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/storage" "helm.sh/helm/v3/pkg/storage/d...
// Copyright 2020 <NAME>, The PTT APP Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agr...
package opsgenie import ( "bytes" "context" "fmt" "strings" "github.com/moira-alert/moira" "github.com/moira-alert/moira/senders" "github.com/opsgenie/opsgenie-go-sdk-v2/alert" blackfriday "gopkg.in/russross/blackfriday.v2" ) const ( titleLimit = 130 msgLimit = 15000 ) // SendEvents sends the events as ...
// Copyright 2020 Saferwall. All rights reserved. // Use of this source code is governed by Apache v2 license // license that can be found in the LICENSE file. package pe import ( "encoding/binary" ) // TLSDirectory represents tls directory information with callback entries. type TLSDirectory struct { ...
package cache import ( "context" "errors" "net" "net/url" "os" "os/signal" "strings" "syscall" "time" "github.com/gomodule/redigo/redis" "github.com/mrz1836/go-cache/nrredis" ) // Client is used to store the redis.Pool and additional fields/information type Client struct { DependencyScriptSha string // S...
package libkb import ( "encoding/hex" "testing" "time" keybase1 "github.com/keybase/client/go/protocol/keybase1" "github.com/keybase/clockwork" "github.com/stretchr/testify/require" context "golang.org/x/net/context" ) type id3FakeUIRouter struct { ui id3FakeUI } func (i *id3FakeUIRouter) SetUI(ConnectionID...
package aws import ( "fmt" "log" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/terraform/helper/schema" ) func dataSourceAwsRoute53Zone() *schema.Resource { return &schema.Resource{ Read: dataSourceAwsRoute53ZoneRead, Schema: map[string]*schem...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package transfer import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) // Please also see https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ListTagsForResourceRequest type ListTagsForR...
package gpio import ( "github.com/stianeikeland/go-rpio" "github.com/sirupsen/logrus" ) var log = logrus.New() type Mode rpio.Mode type Pin rpio.Pin //type State rpio.State type Pull rpio.Pull type Edge rpio.Edge func State(i uint16) rpio.State { return rpio.State(i) } const ( Input = rpio.Input Output = rpi...
package cmd import ( "fmt" "os" "github.com/olorin/nagiosplugin" "github.com/soniah/gosnmp" "github.com/spf13/cobra" ) var ( snmpHost string snmpVersion string snmpContext string snmpSecLevel string snmpAuthProto string snmpPrivProto string snmpCommunity string snmpSecName...
package axis import ( "math" "time" "github.com/mayowa/chart/format" "github.com/mayowa/chart/image" ) // Axis defines an axis (doh) type Axis struct { position Position format Formatter duration time.Duration grid int ticks int center bool } // Formatter is the callback interface function used...
package solver import ( "context" "fmt" "os" "time" "github.com/docker/buildx/util/progress" "github.com/moby/buildkit/client" "github.com/moby/buildkit/identity" digest "github.com/opencontainers/go-digest" "github.com/pkg/errors" "golang.org/x/sync/errgroup" ) type ProgressOption func(*ProgressInfo) erro...
package rest import ( "context" "github.com/pkg/errors" "github.com/titpetric/factory/resputil" "github.com/cortezaproject/corteza-server/pkg/corredor" "github.com/cortezaproject/corteza-server/pkg/payload" "github.com/cortezaproject/corteza-server/pkg/rh" "github.com/cortezaproject/corteza-server/system/rest/...
/* Copyright <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 to in writing, software distributed under th...
package ncco import ( "encoding/json" "strconv" "strings" ) // Action is an interface to ensure all Actions have a prepare() type Action interface { prepare() Action } // Ncco is a parent type to hold the actions type Ncco struct { actions []interface{} } // AddAction to add a next action, in sequence, to the ...
package hfwd import ( "errors" "net/http" "net/url" "path" "io" "log" "net/http/httputil" "fmt" "bytes" "compress/flate" "compress/gzip" "io/ioutil" "github.com/dsnet/compress/brotli" "github.com/kei2100/h-fwd/config" ) // NewHandler returns http.Handler which performs forward proxy. func NewHandl...
package pdf import ( "bytes" "errors" "fmt" gocolor "image/color" "image/jpeg" "io" "io/ioutil" ) func newDCTDecoder(reader io.Reader, space string, bits int) *DCTReader { d := &DCTReader{reader: reader, bitsPerComponent: bits} switch space { default: d.colorComponents = 1 case "DeviceGray": d.colorCom...
package dkim import ( "bytes" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/base64" "encoding/pem" "errors" "fmt" "net/mail" "regexp" "strings" ) const ( CRLF = "\r\n" DOUBLE_CRLF = "\r\n\r\n" Empty = "" WSP = " " ) var ( CRLF_AS_BYTE = []byte{'\r', '\n'} WSP_AS_BYTE = [...
package main import ( "github.com/ByteArena/box2d" "github.com/wdevore/RangerGo/api" "github.com/wdevore/RangerGo/engine/nodes/custom" "github.com/wdevore/RangerGo/engine/rendering" ) // BoxComponent is a box type BoxComponent struct { visual api.INode b2Body *box2d.B2Body scale float64 categoryBits uint16 ...
package txt import ( "unicode" "unicode/utf8" "github.com/jakubDoka/mlok/ggl" "github.com/jakubDoka/mlok/mat" ) // Drawer draws text for ContentBox type Drawer struct { *Atlas Region mat.Vec glyph ggl.Sprite tab float64 } // NDrawer is drawer constructor func NDrawer(atlas *Atlas) *Drawer { t := &Drawe...
package main import ( "fmt" "net/http" "net/url" "path/filepath" "strings" "time" "github.com/gorilla/mux" "github.com/kjk/apptranslator/store" "github.com/kjk/u" ) func serveFileFromDir(w http.ResponseWriter, r *http.Request, dir, fileName string) { filePath := filepath.Join(dir, fileName) if !u.PathExis...
package tracing import ( "context" "errors" "fmt" "io" "net/http" "github.com/containous/traefik/v2/pkg/log" "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" ) type contextKey int const ( // SpanKindNoneEnum Span kind enum none. SpanKindNoneEnum ext.SpanKindEnum = "none"...
package oj_getter import ( "encoding/json" "fmt" "io/ioutil" "net/http" "regexp" "self/models" "strconv" "strings" ) const ( hduBaseUrl = "http://acm.hdu.edu.cn/showproblem.php?pid=" HduUserId = 1 ) type HDUGetter struct { BaseGetter } func (this HDUGetter) getter() { end := this.getProblemIdMax() fo...
package errors import ( "fmt" "io" "strings" ) // format is the implementation of a generic error formatting functions which // supports the following verbs: // // %s writes the value returned by calling .Error on the the error // %q same as %s but quotes and escapes the string // %v prints the e...
package rsync import ( "bytes" "errors" "fmt" "math" "os" "os/exec" "strings" "time" "koding/klient/util" "github.com/koding/kite" "github.com/koding/logging" ) type Progress struct { Progress int `json:progress` Error kite.Error `json:error` } type Client struct { log logging.Logger } fun...
// Copyright (c) 2019 Uber Technologies, 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 o...
package main // This file adds the Disgord message route multiplexer, aka "command router". // to the Disgord bot. This is an optional addition however it is included // by default to demonstrate how to extend the Disgord bot. import ( "fmt" "os" "github.com/w8kerr/delubot/models" "github.com/w8kerr/delubot/x/mu...
// Package ts3 implements the Teamspeak 3 ServerQuery protocol // described here http://media.teamspeak.com/ts3_literature/TeamSpeak%203%20Server%20Query%20Manual.pdf package ts3 import ( "bufio" "bytes" "errors" "fmt" "net" "strconv" "strings" ) type Client struct { conn net.Conn scan ...
package auth import ( v1 "goer/app/http/controllers/v1" authRequest "goer/app/http/requests/v1/auth" "goer/app/models/user" "goer/global" "goer/global/errno" "goer/pkg/auth" "github.com/gin-gonic/gin" "github.com/goer-project/goer/form" "github.com/goer-project/goer/response" "golang.org/x/crypto/bcrypt" "...
package main /* #cgo LDFLAGS: -l g15daemon_client -l g15render -Wl,--allow-multiple-definition #include <g15daemon_client.h> #include <libg15.h> #include <libg15render.h> #include <stdlib.h> #include "repeat.c" */ import "C" import ( "log" "os" "time" "unsafe" "github.com/godbus/dbus/v5" ) // MusicMetadata con...
// Copyright 2011 <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 writi...
package main import ( "os" "path/filepath" "runtime" "strings" ) // Package represents package info, needed for this tool. type Package struct { Name string Path string } // NewPackage creates new Package. func NewPackage(name, path string) Package { return Package{ Name: name, Path: path, } } func init...
// Copyright 2014 <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 writi...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: room/special/special.proto package special 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 // Thi...
// MIT License // // Copyright (c) Microsoft Corporation. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the righ...
/* Copyright 2016 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, ...