CombinedText
stringlengths
4
3.42M
package main import ( "bytes" "encoding/hex" "encoding/xml" "errors" "flag" "fmt" "github.com/FactomProject/FactomCode/notaryapi" "github.com/conformal/btcrpcclient" "github.com/conformal/btcutil" "github.com/FactomProject/dynrsrc" "github.com/FactomProject/gobundle" "github.com/FactomProject/gocoding" "i...
package routing import ( "fmt" "net" "sync" "sync/atomic" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lnwire" ) //...
// // Copyright (c) 2016 Intel Corporation // // 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 2015 Factom Foundation // Use of this source code is governed by the MIT // license that can be found in the LICENSE file. package wire import ( // "bytes" "encoding/binary" "errors" "fmt" "io" // "strconv" "github.com/FactomProject/FactomCode/factoid" "github.com/FactomProject/FactomCode/util" ...
// Big monolithic binding file. // Binds a ton of things. package middleware import ( "bufio" "bytes" "crypto/tls" "encoding/base64" "errors" "fmt" "github.com/DeedleFake/Go-PhysicsFS/physfs" "github.com/GeertJohan/go.linenoise" "github.com/carbonsrv/carbon/modules/glue" "github.com/carbonsrv/carbon/modules...
// 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...
// prints the content found at a URL package main import( "fmt" "io/ioutil" "net/http" "os" ) func main(){ for _, url := range os.Args[1:]{ resp, err := http.Get(url) if err != nil{ fmt.Fprintf(os.Stderr, "Fetch: %v\n", err) os.Exit(1) } b, err := ioutil.ReadAll(resp.Body) s:= resp.Status r...
package main import ( "chaos-galago/processor/Godeps/_workspace/src/chaos-galago/shared/utils" "chaos-galago/processor/Godeps/_workspace/src/github.com/cloudfoundry-community/go-cfclient" "chaos-galago/processor/utils" "database/sql" "fmt" "os" "strconv" "time" ) var ( dbConnectionString string err ...
// Copyright 2015 trivago GmbH // // 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 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Download remote packages. package main import ( "http" "os" "path/filepath" "regexp" "strings" ) const dashboardURL = "http://godashboard.appspot.co...
package http import ( "sort" "strconv" "strings" "time" "github.com/Cepave/open-falcon-backend/modules/query/g" log "github.com/Sirupsen/logrus" "github.com/astaxie/beego/orm" "github.com/jasonlvhit/gocron" ) type Contacts struct { Id int Name string Phone string Email string Updated string ...
package metalarchives import ( "reflect" "testing" "github.com/StalkR/goircbot/lib/metal" ) func TestSearch(t *testing.T) { for _, tt := range []struct { name string want []metal.Band }{ { name: "Convergence", want: []metal.Band{ metal.Band{Name: "Convergence", Genre: "Atmospheric/Industrial Dar...
package repository_test import ( "testing" "github.com/syou6162/go-active-learning/lib/example" "github.com/syou6162/go-active-learning/lib/model" "github.com/syou6162/go-active-learning/lib/repository" ) func TestUpdateUpdateRelatedExamples(t *testing.T) { repo, err := repository.New() if err != nil { t.Err...
package display import ( "fmt" "os" "strings" ) func MOTD() { os.Stderr.WriteString(fmt.Sprintf(` ** ******** *************** ********************* ***************...
package github import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" "net/url" "os" "os/exec" "path" "path/filepath" "sort" "strings" "time" "github.com/github/hub/version" ) const ( GitHubHost string = "github.com" OAuthAppURL string = "https://hub.github.com/" ) var UserAg...
package sous import ( "fmt" "net/url" "strings" "github.com/samsalisbury/semv" "golang.org/x/text/unicode/norm" ) type ( // SourceID identifies a specific snapshot of a body of source code, // including its location and version. SourceID struct { // Location is the repo/dir pair indicating the location of ...
// Copyright (c) 2012 The gocql 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 gocql import ( "errors" "fmt" "io" "io/ioutil" "net" "runtime" "strings" "time" ) type unsetColumn struct{} // UnsetValue represents a...
package yum import ( "compress/bzip2" "database/sql" "fmt" "io" "net/http" "os" "path/filepath" "sort" "strconv" "github.com/gonuts/logger" _ "github.com/mattn/go-sqlite3" ) // RepositorySQLiteBackend is Backend querying YUM SQLite repositories type RepositorySQLiteBackend struct { Name string P...
package cfs import ( "bytes" "errors" "fmt" "github.com/tiglabs/containerfs/logger" "github.com/tiglabs/containerfs/proto/dp" "github.com/tiglabs/containerfs/proto/mp" "github.com/tiglabs/containerfs/proto/vp" "github.com/tiglabs/containerfs/utils" "golang.org/x/net/context" "google.golang.org/grpc" "io" "...
package cfs import ( "bazil.org/fuse" "bufio" "bytes" "errors" "fmt" "github.com/ipdcode/containerfs/logger" dp "github.com/ipdcode/containerfs/proto/dp" mp "github.com/ipdcode/containerfs/proto/mp" vp "github.com/ipdcode/containerfs/proto/vp" "github.com/ipdcode/containerfs/utils" "golang.org/x/net/context...
package main import ( "fmt" "io" "io/ioutil" "os" "os/exec" "regexp" "strings" "github.com/gin-gonic/gin" ) const VERSION = "0.1.0" type Response struct { Success bool `json:"success"` Message string `json:"message"` } type FileEntry struct { Filename string `json:"filename"` IsDir bool `json:"d...
package main import ( "github.com/jessevdk/go-operators/types" "fmt" "github.com/jessevdk/go-flags" "go/ast" "go/build" "go/format" "go/parser" "go/token" "os" "path" "strings" ) type TypeCheck struct { Path string ImportPath string Package *types.Package FileSet *token.FileSet ParseFiles []string ...
package cmd import ( "fmt" "net/http" "strings" "github.com/freneticmonkey/migrate/go/config" "github.com/freneticmonkey/migrate/go/management" "github.com/freneticmonkey/migrate/go/util" "github.com/freneticmonkey/migrate/go/yaml" "github.com/urfave/cli" ) // var conf config.Config var configURL string var ...
package main import ( "fmt" /* "os" "os/signal" */ "runtime" "errors" "time" "encoding/hex" "encoding/binary" "database/sql" "github.com/fuzxxl/nfc/2.0/nfc" "github.com/fuzxxl/freefare/0.3/freefare" _ "github.com/mattn/go-sqlite3" "github.com/davecheney/g...
package main import ( "fmt" /* "os" "os/signal" */ //"runtime" "errors" "time" "encoding/hex" "encoding/binary" "database/sql" "github.com/fuzxxl/nfc/2.0/nfc" "github.com/fuzxxl/freefare/0.3/freefare" _ "github.com/mattn/go-sqlite3" "github.com/davecheney...
package teams import ( "fmt" "sort" "sync" "golang.org/x/net/context" "golang.org/x/sync/errgroup" "golang.org/x/sync/semaphore" "github.com/keybase/client/go/engine" "github.com/keybase/client/go/libkb" "github.com/keybase/client/go/protocol/keybase1" ) type statusList struct { Teams []keybase1.MemberIn...
package basic // Instance of the current BASIC machine. type Instance struct { CurrentLine int } // Parse current code func (b *Instance) Parse() (err error) { return } add lex package basic import ( "fmt" "io" "strings" "github.com/crgimenes/lex" ) // TokenParsers array var TokenParsers = []lex.TokenFunct...
package main import "testing" func TestGetBitsFromPacket(t *testing.T) { var bytePos int var bitPos int tests := []struct { name string packet []byte bpP uint ret uint8 }{ {"24 Bits", []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 24, 255}, {"21 Bits", []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 21, 254}, ...
// Copyright 2016 The Go 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 godash import ( "net/http" "sort" "time" "github.com/google/go-github/github" "golang.org/x/oauth2" ) const project = "golang/go" const project...
// Copyright 2012, The gohg Authors. All rights reserved. // Use of this source code is governed by a BSD style license // that can be found in the LICENSE.txt file. // Package gohg is a Go client library for using the Mercurial dvcs // via it's Command Server. // // For Mercurial see: http://mercurial/selenic.com/wik...
package main import "github.com/gin-gonic/gin" func main() { r := gin.Default() r.GET("/ping", func(c *gin.Context) { c.JSON(200, gin.H{ "message": "pong", }) }) r.Run() // listen and server on 0.0.0.0:8080 } Add preliminary left padding functionality package main import ( "github.com/gin-gonic/gin" "...
package main import ( "github.com/coreos/go-etcd/etcd" "github.com/miekg/dns" "testing" "strings" ) var ( client = etcd.NewClient([]string{"127.0.0.1:4001"}) resolver = &Resolver{etcd: client} ) func TestEtcd(t *testing.T) { // Enable debug logging log_debug = true if !client.Syn...
package resource import ( "errors" "fmt" "github.com/jinzhu/gorm" "github.com/qor/qor" "github.com/qor/roles" "github.com/qor/qor/utils" ) func (res *Resource) findOneHandler(result interface{}, metaValues *MetaValues, context *qor.Context) error { if res.HasPermission(roles.Read, context) { primaryField :=...
package main import ( "bufio" "bytes" "fmt" "go/build" "go/format" "io" "log" "os" "path/filepath" "strconv" "strings" "unicode/utf8" "github.com/valyala/fasttemplate" ) const boxFilename = "rice-box.go" const lowerhex = "0123456789abcdef" func writeBoxesGo(pkg *build.Package, out io.Writer) error { ...
package yuicompressor import ( "os" "testing" ) func fixture_css() string { return( `div.warning { display: none; } div.error { background: red; color: white; } @media screen and (max-device-width: 640px) { body { font-size: 90%; } }`) } func fixture_js() string { return( `// here's a ...
package main import ( "fmt" "log" "os" ) const ( v = "0.1" ) func main() { command := "" args := os.Args[1:] // remove app path from args // We expect a subcommand and a set of files in args if len(args) > 0 { command = args[1] args = args[1:] } var err error switch command { case "encrypt", "e": ...
package rocker import ( "fmt" "io" "log" "os" "os/exec" "path/filepath" "github.com/cloudcredo/cloudrocker/buildpack" "github.com/cloudcredo/cloudrocker/config" "github.com/cloudcredo/cloudrocker/docker" "github.com/cloudcredo/cloudrocker/godocker" "github.com/cloudcredo/cloudrocker/stager" "github.com/cl...
// Copyright 2018 Frédéric Guillot. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package client // import "miniflux.app/client" import ( "encoding/json" "fmt" "io" "io/ioutil" "net/url" "strconv" ) // Client holds API procedure ...
/* Package client implements the class of a network client which can interact with a mix network. */ package client import ( "anonymous-messaging/clientCore" "anonymous-messaging/config" "anonymous-messaging/helpers" "anonymous-messaging/logging" "anonymous-messaging/networker" "github.com/protobuf/proto" "...
package client import ( "crypto/tls" "io" "net" "strings" "sync" "time" log "github.com/Sirupsen/logrus" "github.com/eclipse/paho.mqtt.golang/packets" "github.com/iotalking/mqtt-broker/config" "github.com/iotalking/mqtt-broker/safe-runtine" "github.com/iotalking/mqtt-broker/session" _ "github.com/iotalki...
package client import ( "context" "crypto/tls" "crypto/x509" "io/ioutil" "net" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client/connhelper" "github...
// Package client is an IRC client library. package client import ( "bufio" "crypto/tls" "fmt" "log" "net" "strings" "time" "github.com/horgh/irc" ) // Conn holds an IRC connection. type Conn struct { // conn: The connection if we are actively connected. conn net.Conn // rw: Read/write handle to the conn...
package client import ( "errors" "fmt" "io/ioutil" "net" "net/rpc" "os" "path/filepath" "sort" "strconv" "strings" "sync" "time" "github.com/armon/go-metrics" consulapi "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib" "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-multier...
// Copyright 2016 The Upspin 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 client implements a simple client service talking to services // running anywhere (GCP, InProcess, etc). package client import ( "upspin.io/acc...
package vectors import "github.com/hAWKdv/go-gravity/vectors/utils" // MoverDefMass keeps the default mass of the Mover const MoverDefMass = 1 // Mover describes a basic moveable object/particle type Mover struct { Obj interface{} acceleration *Vector velocity *Vector location *Vector conta...
/* Copyright 2019 The Kubeflow 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, so...
// Copyright 2010 The Go 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 cmath import ( "math" "testing" ) var vc26 = []complex128{ (4.97901192488367350108546816 + 7.73887247457810456552351752i), (7.73887247457810456552...
// Copyright 2009 The Go 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 x509 parses X.509-encoded keys and certificates. package x509 import ( "bytes" "crypto" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" "crypto/...
// Copyright 2011 The Go 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 sql provides a generic interface around SQL (or SQL-like) // databases. package sql import ( "database/sql/driver" "errors" "fmt" "io" "sync" )...
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // A parser for Go source text. The input is a stream of lexical tokens // provided via the Scanner interface. The output is an abstract syntax // tree (AST) re...
package bothandlers import ( "github.com/djosephsen/hal" "net/http" "encoding/json" "fmt" ) type gifyout struct{ Meta interface{} Data struct{ Tags []string Caption string Username string Image_width string Image_frames string Image_mp4_url string Image_url string Image_original_url...
// Copyright (c) 2018 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package psbt import ( "bytes" "encoding/base64" "encoding/binary" "encoding/hex" "testing" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/tx...
package goble import ( "bytes" "encoding/binary" "fmt" "log" "time" "github.com/dim13/goble/xpc" ) // "github.com/dim13/goble/xpc" // // BLE support // //go:generate stringer -type State type State int const ( unknown State = iota resetting unsupported unauthorized poweredOff poweredOn ) type Propert...
package gps import ( "errors" "go/build" "go/parser" "go/token" "path/filepath" "sort" "strconv" "strings" "unicode" ) var ( gorootSrc = filepath.Join(build.Default.GOROOT, "src") ignoreTags = []string{} //[]string{"appengine", "ignore"} //TODO: appengine is a special case for now: https://github.com/tool...
package godbg import ( "bufio" "bytes" "fmt" "io" "os" "regexp" "runtime/debug" "strings" ) // http://stackoverflow.com/a/23554672/6309 https://vividcortex.com/blog/2013/12/03/go-idiom-package-and-object/ // you design a type with methods as usual, and then you also place matching functions at the package lev...
//Package gogtm enables access to gt.m database package gogtm /* #cgo CFLAGS: -I/opt/fis-gtm/6.3-000A #cgo LDFLAGS: -L/opt/fis-gtm/6.3-000A -lgtmshr #include <gtmxc_types.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #define maxstr 1048576 #ifndef NULL #define NULL ((void *) 0) #endif #define CALLGT...
package gohex import ( "bufio" "encoding/hex" "sort" "strings" ) // Constants definitions of IntelHex record types const ( DATA_RECORD byte = 0 EOF_RECORD byte = 1 ADDRESS_RECORD byte = 4 START_RECORD byte = 5 ) // Structure with binary data segment fields type DataSegment struct { Address int Dat...
package pigae import ( "fmt" "os" "sort" "strings" "github.com/Deleplace/programming-idioms/pig" ) // // Language names exist in 3 forms : nice, standard, lowercase // Ex : "C++", "Cpp", "cpp" // var mainStreamLangs = [...]string{"C", "Cpp", "Csharp", "Go", "Java", "JS", "Obj-C", "PHP", "Python", "Ruby"} // R...
package gopdf import ( "bytes" "errors" ioutil "io/ioutil" "log" "os" //"container/list" "fmt" "strconv" "strings" ) type GoPdf struct { //page Margin leftMargin float64 topMargin float64 pdfObjs []IObj config Config /*---index ของ obj สำคัญๆ เก็บเพื่อลด loop ตอนค้นหา---*/ //index ของ obj pages ...
// Copyright 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 in wri...
/* * Copyright (c) 2017 AlexRuzin (stan.ruzin@gmail.com) * * 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, m...
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build appengine package build // TODO(adg): test authentication import ( "appengine" "appengine/datastore" "bytes" "encoding/json" "errors" "fmt" ...
// SPDX-License-Identifier: MIT // Package result 提供对自定义错误代码的支持 package result import "github.com/issue9/validation" type ( // Fields 表示字段的错误信息列表 // // 类型为 map[string][]string Fields = validation.Messages // BuildFunc 用于生成 Result 接口对象的函数 BuildFunc func(status, code int, message string) Result // Result 自定义错...
package main import ( "encoding/json" "html/template" "net/http" "github.com/gorilla/mux" ) type getTorrentData struct { pageData Torrent torrent } var torrentTemplate = template.Must(template.New("template").Funcs(templateFunctions).ParseFiles("templates/layout.html", "templates/page_torrent.html")) func (a...
package facebook import ( "encoding/json" "fmt" "net/http" "net/url" "regexp" "strings" "time" "github.com/gorilla/feeds" scraper "github.com/mono0x/my-scraper/lib" "github.com/pkg/errors" ) const ( serviceURL = "https://www.facebook.com/" baseURL = "https://graph.facebook.com" ) type posts struct { ...
package router import ( "bytes" "encoding/json" "errors" "io" "io/ioutil" "net/http" log "github.com/Sirupsen/logrus" "github.com/oursky/ourd/oderr" ) // pipeline encapsulates a transformation which a request will come throught // from preprocessors to the actual handler. (and postprocessor later) type pipel...
package dalton import "time" const ( AnnouncementGrade_All = 0 // everyone AnnouncementGrade_MiddleSchool = 14 // 4th grade through 8th grade AnnouncementGrade_HighSchool = 15 // 9th grade through 12th grade AnnouncementGrade_MiddleSchool_456 = 16 // 4th, 5th, and 6th grade AnnouncementGr...
// Copyright 2012-2014, Rolf Veen and contributors. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ogdl import ( "bytes" "reflect" "strconv" "strings" ) // Graph is a node with outgoing pointers to other Graph objects. // It is implemented as a nam...
// Package osthrpool provides a pool of locked OS threads. package osthrpool import ( "container/heap" "runtime" "sync" "time" ) // Task represents a task that requires to be run on a locked OS thread. type Task func() // Pool represents a pool of locked OS threads. type Pool struct { maxSize int timeout time....
package otto import ( "encoding/json" "fmt" "log" "os" "path/filepath" "strings" "sync" "sync/atomic" "time" "github.com/hashicorp/otto/app" "github.com/hashicorp/otto/appfile" "github.com/hashicorp/otto/context" "github.com/hashicorp/otto/directory" "github.com/hashicorp/otto/foundation" "github.com/h...
package rbac import ( "context" "strings" "time" g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" kuser "k8s.io/apiserver/pkg/authentication/user" "k8s.io/client-g...
/* Copyright 2022 The cert-manager 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...
// (c) Copyright 2015 JONNALAGADDA Srinivas // // 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...
package main import ( "fmt" "github.com/alexandrebodin/gilibot" "github.com/alexandrebodin/gilibot/listener" ) func main() { bot := gilibot.New("slack") bot.ListenFunc(".*", func(c *gilibot.Context) { c.Reply([]string{"coucou match everything"}) }) bot.RegisterListener(listener.NewTestListener()) err :=...
/* 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, ...
//go:build linux // +build linux /* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applic...
package main /* www.rtve.es/api/clan/series/spanish/todas (follow redirect) http://www.rtve.es/api/programas/80170/videos */ import ( "bytes" "crypto/aes" "crypto/cipher" "crypto/sha256" "encoding/base64" "encoding/json" "flag" "fmt" "io" "io/ioutil" "log" "net/http" "os" "path" "strings" "time" ) fu...
Cosmetic improvements
package air import ( "net" "testing" "time" "github.com/stretchr/testify/assert" ) func TestNewListener(t *testing.T) { a := New() a.PROXYEnabled = true l := newListener(a) assert.NotNil(t, l) assert.Nil(t, l.TCPListener) assert.NotNil(t, l.a) assert.Nil(t, l.allowedPROXYRelayerIPNets) a = New() a.PR...
package main import ( "encoding/json" "net/http" "time" ) type plugStats struct { Path string Functions []string } type cacheStats struct { Enabled bool GetCount uint64 GetHits uint64 HitPercent float64 SetCount uint64 } func (cs *cacheStats) setHitPercent() { cs.HitPercent = float64(cs.Ge...
package loader import ( "encoding/csv" "io" "io/ioutil" "log" "os" "os/exec" "path" "strconv" "strings" "time" "github.com/brnstz/bus/common" "github.com/brnstz/bus/models" "github.com/jmoiron/sqlx" ) var days = []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"} var ...
package loader import ( "encoding/csv" "fmt" "io" "io/ioutil" "log" "os" "os/exec" "path" "strconv" "strings" "time" "github.com/brnstz/bus/internal/conf" "github.com/brnstz/bus/internal/etc" "github.com/brnstz/bus/internal/models" ) var ( days = []string{"monday", "tuesday", "wednesday", "thur...
package loader import ( "errors" "fmt" "go/ast" "go/parser" "go/scanner" "go/token" "go/types" "log" "os" "golang.org/x/tools/go/gcexportdata" "golang.org/x/tools/go/packages" ) // Graph resolves patterns and returns packages with all the // information required to later load type information, and optiona...
// Copyright 2011 The Go 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 gc import ( "fmt" "strconv" "strings" "unicode/utf8" ) // A FmtFlag value is a set of flags (or 0). // They control how the Xconv functions format...
// +build local /* Copyright 2020 Docker Compose CLI 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 ap...
package udata //--------------------------------------------------------------------------- // CoreOS master user data: //--------------------------------------------------------------------------- const templMaster = `#cloud-config hostname: "master-{{.HostID}}.{{.Domain}}" write_files: - path: "/etc/hosts" c...
/* * Copyright 2011 Nan Deng * * 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 mpb import ( "bytes" "fmt" "io" "strings" "sync" "time" "unicode/utf8" "github.com/vbauerster/mpb/decor" ) const ( rLeft = iota rFill rTip rEmpty rRight ) const ( formatLen = 5 etaAlpha = 0.25 ) type barRunes [formatLen]rune // Bar represents a progress Bar type Bar struct { priority int ...
// Copyright 2013 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...
// Copyright 2013 bee 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 ...
// Copyright 2016 tsuru 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 router provides interfaces that need to be satisfied in order to // implement a new router on tsuru. package router import ( "fmt" "net/url" "sort...
package main import ( "fmt" "io" "sync" "container/ring" "github.com/Shopify/exabgp-util/types" "github.com/Shopify/exabgp-util/util" ) const ( NotificationsBufSize = 10 StatesBufSize = 10 ) type BGP struct { reader io.Reader notifications *ring.Ring states *ring.Ring updates ...
package main import ( "fmt" "net/url" "os" "github.com/ajm188/slack" "github.com/ajm188/slack/plugins/github" ) const ( version = "0.4.0" ) func setRealNameFields(bot *slack.Bot, event map[string]interface{}) (*slack.Message, slack.Status) { channel := event["channel"].(string) if channel != bot.Channels["g...
package proto import ( pb "code.google.com/p/goprotobuf/proto" "errors" "fmt" "io/ioutil" "os" "path/filepath" "strings" ) type FileList struct { RootDirectory string Files []*File } func (fl *FileList) VisitDir(path string, f os.FileInfo) bool { return true } func (fl *FileList) VisitFile(path st...
package seabird import ( "crypto/tls" "errors" "fmt" "io" "net" "strings" "time" "github.com/BurntSushi/toml" "github.com/Sirupsen/logrus" "github.com/codegangsta/inject" "github.com/belak/go-plugin" "github.com/go-irc/irc" ) type coreConfig struct { Nick string User string Name string Pass string ...
package routes import ( "fmt" "net/http" "github.com/DVI-GI-2017/Jira__backend/handlers" "github.com/DVI-GI-2017/Jira__backend/auth" ) func NewRouter() (http.Handler, error) { const apiRoot = "/api/v1" mux := http.NewServeMux() mux.HandleFunc(fmt.Sprintf("%s%s", apiRoot, "/login/"), login.Login) return han...
package unison import ( "fmt" "strings" "github.com/Sirupsen/logrus" "github.com/bwmarrin/discordgo" "github.com/s1kx/unison/events" ) // BotSettings contains the definition of bot behavior. // It is used for creating the actual bot. type BotSettings struct { Token string Commands []*Command EventHooks [...
package routes import ( "context" "fmt" "net/http" "net/url" "regexp" "strings" "github.com/DVI-GI-2017/Jira__backend/params" ) func NewRouter(rootPath string) (*router, error) { r := &router{} r.routes = make(map[string]map[*regexp.Regexp]Route) r.routes[http.MethodGet] = make(map[*regexp.Regexp]Route) ...
package main import ( "flag" "fmt" "log" "os" "sync" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/fatih/color" "gopkg.in/cheggaaa/pb.v1" ) // attrs store user-defined parameter...
package main /* www.rtve.es/api/clan/series/spanish/todas (follow redirect) http://www.rtve.es/api/programas/80170/videos */ import ( "bytes" "crypto/aes" "crypto/cipher" "crypto/sha256" "encoding/base64" "encoding/json" "flag" "fmt" "io" "io/ioutil" "log" "net/http" "os" "path" "strings" "time" ) va...