CombinedText stringlengths 4 3.42M |
|---|
package task
import (
"fmt"
"neon/build"
"neon/util"
"sync"
)
func init() {
build.TaskMap["threads"] = build.TaskDescriptor{
Constructor: Threads,
Help: `Run steps in threads.
Arguments:
- threads: the number of threads to run. You can set it to _NCPU for the number
of CPUs.
- data: a list filled with va... |
package spickspan
import (
"github.com/essentier/spickspan/config"
"github.com/essentier/spickspan/model"
"github.com/essentier/spickspan/probe"
"github.com/essentier/spickspan/provider/kube"
"github.com/essentier/spickspan/provider/local"
"github.com/essentier/spickspan/provider/nomock"
"github.com/es... |
package p2p
import (
"bytes"
"fmt"
"runtime"
"testing"
)
func TestClientIdentity(t *testing.T) {
clientIdentity := NewSimpleClientIdentity("Ethereum(G)", "0.5.16", "test", []byte("privkey"), []byte("pubkey"))
key := clientIdentity.Privkey()
if !bytes.Equal(key, []byte("privkey")) {
t.Errorf("Expected Privkey... |
// Copyright 2014 The Serviced 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 main
import (
"bytes"
"flag"
"fmt"
"io"
"io/ioutil"
"regexp"
"text/template"
"gopkg.in/yaml.v2"
)
const helpText = `mktpl is a tool to render Golang text/template with template and YAML data files.
Usage:
mktpl flags
Flags:
-d, --data string path to the YAML data file (*)
-t, --template... |
/*
Copyright IBM Corp. 2017 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
// List of mocks used for testing
package betwixt
import (
"errors"
"github.com/zubairhamed/canopus"
"github.com/zubairhamed/sugoi"
"time"
)
type TestDeviceObject struct {
Model ObjectDefinition
currentTime time.Time
utcOffset string
timeZone string
}
func (o *TestDeviceObject) OnExecute(instanceI... |
// 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 compress
const (
filterScale = 4096
filterShift = 5
cdfScale = 32768
cdfRate = 5
)
type CDF struct {
CDF []uint16
Mixin [][]uint16
}
f... |
// Package usl provides functionality to build Universal Scalability Law models
// from sets of observed measurements.
package usl
import (
"fmt"
"math"
"github.com/maorshutman/lm"
)
// Model is a Universal Scalability Law model.
type Model struct {
Sigma float64 // The model's coefficient of contention, σ.
Ka... |
// Package fate is a text generation library.
package fate
import (
cryptorand "crypto/rand"
"encoding/binary"
"log"
"math/rand"
"strings"
)
type token uint32
type bigram struct {
tok0, tok1 token
}
func (b bigram) reverse() bigram {
return bigram{b.tok1, b.tok0}
}
// Model is a trigram language model that ... |
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package network
import (
"strconv"
"github.com/juju/utils/set"
)
// PortSet is a set-like container of Port values.
type PortSet struct {
values map[string]set.Strings
}
// NewPortSet creates a map of protocols to sets ... |
// Copyright 2016 Koichi Shiraishi. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package nvim
import (
"fmt"
"strings"
"github.com/garyburd/neovim-go/vim"
)
var (
errorColor = "Identifier"
progress = "Identifier"
success = "F... |
//
// 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... |
package main
import (
"fmt"
"os"
"strings"
)
type Amount struct {
Currency string
Value float64
}
var indianUnits = map[string]uint64{"arab": 1000000000, "crore": 10000000, "lakh": 100000}
var usUnits = map[string]uint64{"trillion": 1000000000000, "billion": 1000000000, "million": 1000000}
var multipliersFo... |
/*
Copyright 2014 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, ... |
// Copyright 2015 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 main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"log"
"os"
"time"
)
type config struct {
TwitterAuth twitterAuth `json:"twitterAuth"`
}
type twitterAuth struct {
ConsumerKey string `json:"consumerKey"`
ConsumerSecret string `json:"consumerSecret"`
AccessToken string `json:"acces... |
package app
import (
"context"
"errors"
"fmt"
"io"
"sort"
"strings"
"time"
"github.com/karimra/gnmic/config"
"github.com/karimra/gnmic/formatters"
"github.com/karimra/gnmic/types"
"github.com/manifoldco/promptui"
"github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/grpctunnel/tunnel"
"github.c... |
// IronMQ (elastic message queue) client library
package mq
import (
"errors"
"time"
"github.com/iron-io/iron_go/api"
"github.com/iron-io/iron_go/config"
)
type Queue struct {
Settings config.Settings
Name string
}
type QueueSubscriber struct {
URL string `json:"url"`
Headers map[string]s... |
package mssql
import (
"database/sql"
"database/sql/driver"
"io"
// "math"
// "math/big"
// "time"
// "unsafe"
"strings"
)
func init() {
sql.Register("go-mssql", &MssqlDriver{})
}
type MssqlDriver struct {
}
type MssqlConn struct {
sess *TdsSession
}
type MssqlTx struct {
c *MssqlConn
}
/... |
// 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 daemon
import (
"context"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/miniflux/miniflux/config"
"github.com/miniflux/miniflux... |
package daemon
import (
"os"
"reflect"
"time"
"fmt"
"github.com/sevlyar/go-daemon"
"github.com/Sirupsen/logrus"
"github.com/BluePecker/JwtAuth/server"
"github.com/BluePecker/JwtAuth/storage"
"github.com/BluePecker/JwtAuth/server/router"
_ "github.com/BluePecker/JwtAuth/storage/r... |
// Copyright 2016-2019 Authors of Cilium
//
// 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 daemon
import (
log "github.com/Sirupsen/logrus"
"github.com/alecthomas/units"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"github.com/docker/go-plugins-helpers/volume"
"github.com/j-griffith/solidfire-docker-driver/sfapi"
)
type SolidFireDriver struct {
TenantID int64
DefaultVolSz int... |
package main
import (
"errors"
"strings"
"log/syslog"
log "code.google.com/p/log4go"
)
// This log writer sends output to a socket
type SysLogWriter chan *log.LogRecord
// This is the SocketLogWriter's output method
func (w SysLogWriter) LogWrite(rec *log.LogRecord) {
w <- rec
}
func (w SysLogWriter) Close() ... |
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"github.com/gorilla/mux"
)
func main() {
r := mux.NewRouter()
file := r.Path("/files/{id}").Subrouter()
file.Methods("GET").HandlerFunc(FileGetHandler)
file.Methods("POST").HandlerFunc(FileCreateHandler)
http.ListenAndServe(":"+os.Getenv("PORT"), r)... |
package main
import (
"bytes"
"fmt"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
)
type NinjaGenerator struct {
f *os.File
nodes []*DepNode
vars Vars
exports map[string]bool
ex *Executor
ruleId int
done map[string]bool
ccRe *regexp.Regexp
}
func NewNinjaGenerator(g *DepGrap... |
fix bug with infinite loop, move i.Next() out from len(word) >= b.nGramSize condition
|
// 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 (c) 2015, Ștefan Talpalaru <stefantalpalaru@yahoo.com>
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, ... |
// Package npyio provides read/write access to files following the NumPy data file format:
// http://docs.scipy.org/doc/numpy-1.10.1/neps/npy-format.html
//
// Example:
//
// f, err := os.Open("data.npz")
// r, err := npyio.NewReader(f)
// data, err := r.Read()
// nrows, ncols := data.Dims()
// for i := 0; i < nr... |
// Copyright 2010-2012 The W32 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 w32
import (
"errors"
"syscall"
"unsafe"
)
var (
modkernel32 = syscall.NewLazyDLL("ntdll.dll")
procNtAlpcCreatePort = modadvapi32.NewProc(... |
// OAuth 1.0 consumer implementation.
// See http://www.oauth.net and RFC 5849
//
// There are typically three parties involved in an OAuth exchange:
// (1) The "Service Provider" (e.g. Google, Twitter, NetFlix) who operates the
// service where the data resides.
// (2) The "End User" who owns that data, and wants ... |
package cache
import (
"bytes"
bin "encoding/binary"
"errors"
"github.com/jmhodges/levigo"
"goposm/binary"
"goposm/element"
"os"
"path/filepath"
"strconv"
)
var levelDbWriteBufferSize, levelDbWriteBlockSize int64
var deltaCacheBunchSize int64
func init() {
levelDbWriteBufferSize, _ = strconv.ParseInt(
os... |
package ogdat
import (
"code.google.com/p/go-uuid/uuid"
"encoding/json"
"net/url"
"time"
// "fmt"
)
const OGDTimeSpecifier = "2006-01-02T15:04:05" // RFC 3339 = ISO 8601 ohne Zeitzone
const (
OGDTime1 = time.RFC3339Nano
OGDTime2 = time.RFC3339
OGDTime3 = OGDTimeSpecifier
OGDTimeUnknow
)
type Beschreibung st... |
// +build linux
package net
import (
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"net"
"os"
"strconv"
"strings"
"syscall"
"github.com/shirou/gopsutil/internal/common"
)
// NetIOCounters returnes network I/O statistics for every network
// interface installed on the system. If pernic argument is false,
// r... |
// Copyright 2017 CoreOS, 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 sparta
import (
"bytes"
"errors"
"fmt"
"strings"
"text/template"
// Also included in lambda_permissions.go, but doubly included
// here as the package's init() function handles registering
// the resources we look up in this package.
_ "github.com/mweagle/cloudformationresources"
"github.com/Sirups... |
package paypalsdk
import "fmt"
// GetOrder retrieves order by ID
// Endpoint: GET /v2/checkout/orders/ID
func (c *Client) GetOrder(orderID string) (*Order, error) {
order := &Order{}
req, err := c.NewRequest("GET", fmt.Sprintf("%s%s%s", c.APIBase, "/v2/checkout/orders/", orderID), nil)
if err != nil {
return or... |
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
package store
import (
"github.com/mattermost/platform/model"
"testing"
)
func TestTeamStoreSave(t *testing.T) {
Setup()
o1 := model.Team{}
o1.Name = "Name"
o1.Domain = "a" + model.NewId() + "b"
o1.Email = ... |
package oleutil
import "ole"
import "os"
func CreateDispatch(progId string) (dispatch *ole.IDispatch, err os.Error) {
var clsid *ole.GUID
clsid, err = ole.CLSIDFromProgID(progId)
if err != nil {
return
}
var unknown *ole.IUnknown
unknown, err = ole.CreateInstance(clsid)
if err != nil {
return
}
dispatc... |
package openvpn
import (
"bufio"
"fmt"
"net"
"os"
"os/exec"
"os/user"
"path"
"regexp"
"strconv"
"syscall"
"github.com/subgraph/oz"
)
func StartOpenVPN(c *oz.Config, conf string, ip *net.IP, table, dev, auth, runtoken string) (cmd *exec.Cmd, err error) {
confFile := path.Join(c.OpenVPNConfDir, conf)
cmd... |
// Package panos interacts with Palo Alto and Panorama devices using the XML API.
package panos
import (
"crypto/tls"
"encoding/xml"
"errors"
"fmt"
"io/ioutil"
"net/url"
"regexp"
"strconv"
"strings"
"github.com/parnurzeal/gorequest"
)
// PaloAlto is a container for our session state. It also holds informat... |
package sous
import (
"container/ring"
"sort"
"sync"
"github.com/pborman/uuid"
)
// MaxRefsPerR11nQueue is the maximum number of rectifications to cache in memory.
const MaxRefsPerR11nQueue = 100
// R11nQueue is a queue of rectifications.
type R11nQueue struct {
cap int
queue chan *QueuedR11... |
// Copyright (c) 2016, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
package sh
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"regexp"
"strconv"
"strings"
)
// Mode controls the parser behaviour via a set of flags.
type Mode uint
const (
ParseComments Mode = 1 << iota // add comments to t... |
// Copyright (c) 2016, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
package sh
import (
"bufio"
"bytes"
"fmt"
"io"
"regexp"
"strconv"
"strings"
)
// Parse reads and parses a shell program with an optional name. It
// returns the parsed program if no issues were encountered. Otherwise... |
// Copyright (C) 2016 Kohei YOSHIDA. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of The BSD 3-Clause License
// that can be found in the LICENSE file.
package uritemplate
import (
"fmt"
"unicode"
"unicode/utf8"
)
type parseOp int
const (
... |
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"text/template"
"github.com/go-xorm/core"
"github.com/go-xorm/xorm"
"github.com/go-xweb/log"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/ziutek/mymysql/godrv"
)
var CmdReverse = ... |
add test cases for MgoStore.
|
/* Copyright (c) 2014, Daniel Martí <mvdan@mvdan.cc> */
/* See LICENSE for licensing information */
package main
import (
"compress/zlib"
"errors"
"flag"
"fmt"
"html/template"
"io"
"log"
"math/rand"
"net/http"
"os"
"path"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
)
const (
idSize = 8 //... |
// Copyright (C) 2017 Damon Revoe. All rights reserved.
// Use of this source code is governed by the MIT
// license, which can be found in the LICENSE file.
package main
import (
"fmt"
"strings"
)
type templateParams map[string]interface{}
type fileParams struct {
filename string
params templateParams
}
typ... |
package perfm
import (
"fmt"
"math"
"sort"
"sync"
"sync/atomic"
"time"
hist "github.com/arthurkiller/perfm/histogram"
)
// Job give out a job for parallel call
// 1. start workers
// 1. workers call job.Copy()
// 2. for-loop do
// * job.Pre()
// * job.Do()
// 3. after for-loop call job.After()
// ... |
package pkcs7
import (
"bytes"
"crypto"
"crypto/cipher"
"crypto/des"
"crypto/hmac"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"errors"
"fmt"
"math/big"
_ "crypto/sha1" // for crypto.SHA1
)
// PKCS7 Represents a PKCS7 structure
type PKCS7 struct {
Content []byte
C... |
package interp
import (
"bytes"
"fmt"
"go/ast"
"go/parser"
"go/scanner"
"go/token"
"log"
"strings"
"code.google.com/p/go.tools/go/types"
"code.google.com/p/go.tools/go/types/typeutil"
)
type interp struct {
oldSrc string
topEnv *environ
pkgs map[string]*Package
checker *checker
typeMap *typeutil.... |
package identify
import (
"context"
"fmt"
"io"
"runtime/debug"
"sync"
"time"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-l... |
package main
import (
"fmt"
"github.com/hashicorp/terraform/helper/schema"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/types"
)
func resourceVm() *schema.Resource {
return &schema.Resource{
Create: resourceVmCreate,
Read: resourceVmRead,
Delete: reso... |
package main
import (
"fmt"
"log"
"github.com/hashicorp/terraform/helper/schema"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/types"
)
func resourceVm() *schema.Resource {
return &schema.Resource{
Create: resourceVmCreate,
Read: resourceVmRead,
Updat... |
// 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 expvar provides a standardized interface to public variables, such
// as operation counters in servers. It exposes these variables via HTTP at
// /de... |
// 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 net
import (
"flag"
"fmt"
"io"
"os"
"regexp"
"runtime"
"testing"
"time"
)
func newLocalListener(t *testing.T) Listener {
ln, err := Listen("t... |
// 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.
// +build ignore
package main
import (
"bytes"
"expvar"
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"strconv"
)
// hello world, the web server
var hello... |
// 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 os
import (
"os";
"syscall";
)
var Args []string; // provided by runtime
var Envs []string; // provided by runtime
// Exit causes the current prog... |
// 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 reflect
import (
"math"
"runtime"
"strconv"
"unsafe"
)
const bigEndian = false // can be smarter if we find a big-endian machine
const ptrSize = u... |
package brightbox
import (
"time"
)
// ServerGroup represents a server group
// https://api.gb1.brightbox.com/1.0/#server_group
type ServerGroup struct {
Id string
Name string
CreatedAt *time.Time `json:"created_at"`
Description string
Default bool
Account Account `j... |
// Copyright 2014, The Serviced Authors. All rights reserved.
// Use of this source code is governed by a
// license that can be found in the LICENSE file.
// Package agent implements a service that runs on a serviced node. It is
// responsible for ensuring that a particular node is running the correct services
// and... |
// Copyright (c) 2014, B3log
//
// 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 w... |
// Copyright 2013 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package set_test
import (
"github.com/juju/names"
"github.com/juju/testing"
gc "launchpad.net/gocheck"
"github.com/juju/utils/set"
)
type tagSetSuite struct {
testing.IsolationSuite
}
var _ = gc.Suite(tagSetSuite{})
... |
package zego
import (
"encoding/json"
)
type TicketArray struct {
Count int `json:"count"`
Created string `json:"created"`
Next_page string `json:"next_page"`
Previous_page string `json:"previous_page"`
Tickets []Ticket
}
type SingleTicket struct {
Ticket *Ticket `json:"ticket"`
}
... |
package zkill
import (
"encoding/json"
"errors"
"io/ioutil"
"log"
"net/http"
)
var (
running = false
redisQRecievers []RedisQReciever
redisQChannels []chan Kill
redisqErrors chan error
)
type RedisQReciever func(Kill)
// ZKillboardRedisQ default endpoint
const ZKillboardRedisQ = "https://redisq... |
package main
import (
"encoding/json"
"fmt"
"github.com/nutrun/lentil"
"testing"
"os"
)
func resetConfig() {
Config = NewConfig("", "", "")
Config.deps = make(map[string][]string)
}
func TestPriority(t *testing.T) {
q := connect(t)
resetConfig()
Config.deps["tube1"] = []string{"tube2"}
put(t, "job1", "tub... |
package benchlist
import (
"container/list"
"math/rand"
"sync"
"time"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/snow/validators"
"github.com/ava-labs/avalanchego/utils/timer"
safemath "github.com/ava-labs/avalanchego/utils/math"
)
// Query... |
// CookieJar - A contestant's algorithm toolbox
// Copyright 2014 Peter Szilagyi. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at ... |
// 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 ... |
// Enumerates USB devices, finds and identifies CrazyRadio USB dongle.
package main
import (
"fmt"
"log"
"os"
"time"
"github.com/kylelemons/gousb/usb"
)
const (
Vendor = 0x1915
Product = 0x7777
)
type Request uint8
const (
SET_RADIO_CHANNEL Request = 0x01
SET_RADIO_ADDRESS Request = 0x02
SET_DATA_RATE ... |
// Copyright (c) 2015-2022 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (... |
// Copyright 2015 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package commands
import (
"fmt"
"strings"
"github.com/juju/bundlechanges"
"github.com/juju/errors"
"gopkg.in/juju/charm.v6-unstable"
"gopkg.in/yaml.v1"
"github.com/juju/juju/api"
"github.com/juju/juju/constraints"
... |
// 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 test
import (
"fmt"
"strings"
"sync"
)
type lineWriter struct {
mu sync.Locker
buff string
WriteStringFunc func(line string)
}
func newLineWriter(writeStringFunc func(line string)) *lineWriter {
lw := &lineWriter{
buff: "",
WriteStringFunc: writeStringFunc,
}
r... |
package main
import (
"fmt"
"go/ast"
"go/token"
"reflect"
)
type varState int
const (
Nil varState = iota
Unused
Used
)
type varUsage struct {
state varState
position token.Pos
}
func copyVarMap(a map[string]varUsage) map[string]varUsage {
b := make(map[string]varUsage)
for k, v := range a {
b[k] ... |
package aggregated_logging
import (
"errors"
"testing"
kapi "k8s.io/kubernetes/pkg/api"
deployapi "github.com/openshift/origin/pkg/deploy/api"
"github.com/openshift/origin/pkg/diagnostics/log"
)
const (
testDcPodsKey = "pods"
testDcKey = "deploymentconfigs"
testSkipAnnotation = "skipAddAnnoati... |
package acceptance_test
import (
"encoding/json"
"fmt"
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
)
var _ = Describe("Common service tests", func() {
Context("Shareable services", func() {
shareableServices... |
package rest
import (
"sort"
"strings"
"github.com/lfq7413/tomato/auth"
)
// Query ...
type Query struct {
auth *auth.Auth
className string
where map[string]interface{}
findOptions map[string]interface{}
response map[string]interface{}
doCount bool
include [][]string
keys ... |
package goformkeeper
import (
"testing"
)
func TestResultRequired(t *testing.T) {
r := NewResult()
if r.HasFailure() {
t.Errorf("Result shouldn't have failure")
}
r.putRequiredFailure("Field01", "Field01 Is Empty")
if !r.HasFailure() {
t.Errorf("Result should have failure")
}
if !r.FailedOn("Field01"... |
/*
Copyright 2014 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 sofa
import (
"crypto/hmac"
"crypto/sha1"
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/cookiejar"
"strings"
// Authentication with certificates can break if this is not included even though no methods
// are called directly.
// TODO: See if this can be controlled with ta... |
package main
import (
"crypto/tls"
"fmt"
"io"
"io/ioutil"
"log"
"net/url"
"os"
"strings"
"sync"
"golang.org/x/net/context"
"github.com/codegangsta/cli"
pb "github.com/creiht/formic/proto"
mb "github.com/letterj/oohhc/proto/filesystem"
"bazil.org/fuse"
"github.com/satori/go.uuid"
"google.golang.org/g... |
// Copyright 2015 Square 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 writ... |
[ION-1218] Add CreatedAt and UpdatedAt to SBOMEntry
|
package apidef
import (
"encoding/base64"
"encoding/json"
"encoding/xml"
"text/template"
"github.com/clbanning/mxj"
"github.com/lonelycode/osin"
"gopkg.in/mgo.v2/bson"
"time"
"github.com/TykTechnologies/gojsonschema"
"github.com/TykTechnologies/tyk/regexp"
)
type AuthProviderCode string
type SessionProv... |
/*
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, ... |
package remote
import (
"code.google.com/p/go.net/context"
)
const key = "remote"
// Setter defines a context that enables setting values.
type Setter interface {
Set(string, interface{})
}
// FromContext returns the Remote associated with this context.
func FromContext(c context.Context) Remote {
return c.Value... |
// Copyright 2013 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 runtime_test
import (
"fmt"
"math"
"math/rand"
. "runtime"
"strings"
"testing"
"unsafe"
)
func TestMemHash32Equality(t *testing.T) {
if *UseAe... |
package report_test
import (
"testing"
"github.com/weaveworks/scope/report"
)
var (
clientHostID = "client.host.com"
clientHostName = clientHostID
clientHostNodeID = report.MakeHostNodeID(clientHostID)
clientAddress = "10.10.10.20"
serverHostID = "server.host.com"
serverHostName = serverHostID... |
// Copyright 2022 the u-root 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 kexec
import (
"bytes"
"debug/elf"
"encoding/binary"
"fmt"
"log"
"github.com/u-root/u-root/pkg/boot/align"
)
// PurgeLoad loads an elf file ... |
package cmd
import (
"bufio"
"fmt"
"io"
"os"
"strings"
"github.com/spf13/cobra"
kclientcmd "k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
kcmd "k8s.io/kubernetes/pkg/kubectl/cmd"
"k8s.io/kubernetes/pkg/kubectl/cmd/config"
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
kvalidation "k8s.io/kubernete... |
package command
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestParseOptions(t *testing.T) {
// Test default behavior
opts, err := ParseOptions([]string{})
assert.NoError(t, err)
assert.Equal(t, false, opts.Sessions)
assert.Equal(t, "", opts.Prefix)
assert.Equal(t, "", opts.ConnectToken)
... |
/*
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
// Copyright 2017 The OpenSDS 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 agre... |
package k8sutil
import (
"fmt"
"testing"
"github.com/upmc-enterprises/elasticsearch-operator/pkg/apis/elasticsearchoperator/v1"
)
func TestGetESURL(t *testing.T) {
for _, v := range []struct {
host string
expected string
useSSL bool
}{
{"es-ssl", "https://es-ssl:9200", true},
{"es-bla", "http:/... |
/*
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, ... |
/*
Copyright 2015 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 law or agreed to in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.