CombinedText stringlengths 4 3.42M |
|---|
package main
import (
"encoding/json"
"io/ioutil"
"log"
"strconv"
"github.com/spf13/cobra"
"github.com/bobinette/papernet"
"github.com/bobinette/papernet/errors"
)
func init() {
PaperCommand.PersistentFlags().String("store", "data/papernet.db", "address of the bolt db file")
PaperCommand.PersistentFlags().... |
package main
import (
"os"
"github.com/remind101/empire/pkg/heroku"
)
var cmdCertAttach = &Command{
Run: runCertAttach,
Usage: "cert-attach <aws_cert_name>",
NeedsApp: true,
Category: "certs",
Short: "attach a certificate to an app",
Long: `
Attaches an SSL certificate to an applications web proce... |
/*
Copyright The Helm 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, software
di... |
package main
import (
"errors"
"fmt"
"os"
"runtime/pprof"
flag "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
commander "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
c... |
package main
import (
"errors"
"fmt"
"io"
"math/rand"
"os"
"os/signal"
"runtime"
"runtime/pprof"
"strings"
"syscall"
"time"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
cont... |
package main
import (
"fmt"
"net/http"
"os"
"path/filepath"
"regexp"
"runtime/debug"
"github.com/coryb/figtree"
"github.com/coryb/kingpeon"
"github.com/coryb/oreo"
jira "gopkg.in/Netflix-Skunkworks/go-jira.v1"
"gopkg.in/Netflix-Skunkworks/go-jira.v1/jiracli"
kingpin "gopkg.in/alecthomas/kingpin.v2"
"gop... |
// Copyright (C) 2015,2016 Nippon Telegraph and Telephone 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 req... |
/*
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, ... |
// +build linux darwin freebsd
package mount
import (
"os"
"time"
"bazil.org/fuse"
fusefs "bazil.org/fuse/fs"
"github.com/ncw/rclone/cmd/mountlib"
"github.com/ncw/rclone/fs/log"
"github.com/ncw/rclone/vfs"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
// Dir represents a directory entry
type Dir str... |
//
// Last.Backend LLC CONFIDENTIAL
// __________________
//
// [2014] - [2019] Last.Backend LLC
// All Rights Reserved.
//
// NOTICE: All information contained herein is, and remains
// the property of Last.Backend LLC and its suppliers,
// if any. The intellectual and technical concepts contained
// herein are prop... |
// Copyright © 2017 uMov.me Team <devteam-umovme@googlegroups.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 no... |
package cmd
import (
"log"
"math/rand"
"os"
"os/exec"
"path"
"path/filepath"
"strconv"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/zaquestion/lab/internal/git"
)
func TestMain(m *testing.M) {
wd, err := git.WorkingDir()
if err != nil {
log.Fatal(err)
}
os.Chdir(wd)
err = exec... |
package main
import (
"fmt"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/oli-g/chuper"
)
var (
delay = 2 * time.Second
seeds = []string{
"http://www.repubblica.it",
"http://www.corriere.it",
"http://www.repubblica.it",
"http://www.corriere.it",
}
criteria = &chuper.ResponseCriteria{
Method... |
package main
import (
"flag"
"fmt"
"hash"
"io"
"os"
"golang.org/x/crypto/sha3"
)
func main() {
size := flag.Int("n", 256, "size in bits of the desired hash: 224, 256 (default), 384, or 512")
flag.Parse()
var h hash.Hash
switch *size {
case 224:
h = sha3.New224()
case 256:
h = sha3.New256()
case 38... |
package main
import (
"flag"
"fmt"
"github.com/Symantec/Dominator/lib/constants"
"github.com/Symantec/Dominator/lib/filter"
"github.com/Symantec/Dominator/lib/flagutil"
"github.com/Symantec/Dominator/lib/fsbench"
"github.com/Symantec/Dominator/lib/fsrateio"
"github.com/Symantec/Dominator/lib/html"
"github.com... |
package main
import (
"fmt"
"io"
"net/http"
"os"
log "github.com/Sirupsen/logrus"
"github.com/cheggaaa/pb"
"github.com/codegangsta/cli"
"github.com/mattn/go-isatty"
"github.com/otium/ytdl"
)
type options struct {
noProgress bool
outputFile string
infoOnly bool
silent bool
debug bool
ap... |
package quic
import (
"bytes"
"context"
"crypto/tls"
"errors"
"net"
"reflect"
"time"
"github.com/lucas-clemente/quic-go/internal/crypto"
"github.com/lucas-clemente/quic-go/internal/handshake"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/testdata"
"githu... |
// Copyright 2012 SocialCode. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package gelf
import (
"bytes"
"compress/flate"
"compress/gzip"
"compress/zlib"
"crypto/rand"
"encoding/json"
"fmt"
"io"
"net"
"os"
"path"
"runtime"
"strin... |
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"encoding/json"
"github.com/realglobe-Inc/edo/util"
"github.com/realglobe-Inc/go-lib-rg/erro"
"github.com/realglobe-Inc/go-lib-rg/rglog/level"
"io/ioutil"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"testin... |
package neurgo
import (
"testing"
"github.com/couchbaselabs/go.assert"
)
// create netwwork with topology capable of solving XNOR, but which
// has not been trained yet
func xnorNetworkUntrained() *NeuralNetwork {
hidden_neuron1 := &Neuron{Bias: 0, ActivationFunction: sigmoid}
hidden_neuron2 := &Neuron{Bias... |
package main
import (
"testing"
"io/ioutil"
)
// TestValidPayload tests if we can create a proper object from
// a valid JSON payload.
func TestValidPayload(t *testing.T) {
json := `[{
"message" : {
"reqHost" : "www.example.com",
"respLen" : "276248",
"cliIP" : "123.123.123.123",
"status" : "... |
package gexec
import (
"errors"
"fmt"
"go/build"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"sync"
)
var (
mu sync.Mutex
tmpDir string
)
/*
Build uses go build to compile the package at packagePath. The resulting binary is saved off in a temporary directory.
A path pointing t... |
package main
import (
"archive/zip"
"os"
"path"
"github.com/MJKWoolnough/byteio"
)
func (t Transfer) maps(name string, r *byteio.StickyReader, w *byteio.StickyWriter, f *os.File, size int64) error {
zr, err := zip.NewReader(f, size)
if err != nil {
return err
}
m := t.c.NewMap()
done := false
go func() {... |
package git
import (
"regexp"
"strconv"
"sync"
"github.com/git-lfs/git-lfs/subprocess"
"github.com/rubyist/tracerx"
)
var (
gitVersion *string
gitVersionMu sync.Mutex
)
func Version() (string, error) {
gitVersionMu.Lock()
defer gitVersionMu.Unlock()
if gitVersion == nil {
v, err := subprocess.SimpleE... |
/*
* Copyright (c) 2013 Matt Jibson <matt.jibson@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" A... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"regexp"
"strconv"
"strings"
"github.com/shifr/imgwizard/cache"
"github.com/shifr/vips"
)
type Route struct {
pattern *regexp.Regexp
handler http.Handler
}
type RegexpHandler struct {
routes []*Route
}
func (h *RegexpHandler... |
// Copyright 2015 Kevin Yeh. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gohunt
import (
"fmt"
)
type User struct {
ID int `json:"id"`
Name string `json:"name"`
Username string ... |
// The following enables go generate to generate the doc.go file.
//go:generate go run $VEYRON_ROOT/veyron/go/src/veyron.io/lib/cmdline/testdata/gendoc.go . -help
package main
import (
"fmt"
"regexp"
"strings"
"code.google.com/p/go.tools/go/loader"
"code.google.com/p/go.tools/go/types"
"veyron.io/lib/cmdline"
)... |
package goroon
import (
"strings"
"testing"
"time"
"gopkg.in/h2non/gock.v1"
)
func TestScheduleGetEventsByTarget(t *testing.T) {
defer gock.Off()
gock.New("https://garoon.com").
Post("/cbpapi/schedule/api").
Reply(200).File("./test/fixtures/schedule/get_events_by_target.xml")
client := NewClient("https:... |
// Copyright 2012 Andreas Louca. All rights reserved.
// Use of this source code is goverend by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/alouca/gosnmp"
)
func main() {
const cmdTimeout = 10
const cmdOid = ".1.3.6.1.4.1.12356.101.4.1.1" // Device Versio... |
// Copyright 2015 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.
// Command gover manages saved versions of the Go tree.
//
// gover saves builds of the Go source tree and runs commands using
// saved Go versions. For example... |
package graph
add structs for graph
package graph
type Graph struct {
vertices []int
edges []Edge
}
type Edge struct {
v1, v2 *int;
} |
// Copyright 2014 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 kubernetes
import (
"strings"
"time"
jose "gopkg.in/square/go-jose.v2"
"github.com/dexidp/dex/storage"
"github.com/dexidp/dex/storage/kubernetes/k8sapi"
)
var crdMeta = k8sapi.TypeMeta{
APIVersion: "apiextensions.k8s.io/v1beta1",
Kind: "CustomResourceDefinition",
}
const apiGroup = "dex.coreos... |
// Copyright 2019 PingCAP, 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 i... |
// Copyright 2016 PingCAP, 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 i... |
// 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... |
// Copyright 2017-2019, Square, Inc.
// Package request provides an interface for managing requests.
package request
import (
"context"
"database/sql"
"encoding/json"
"fmt"
"net/url"
"sort"
"strings"
"sync"
"time"
"github.com/go-sql-driver/mysql"
"github.com/rs/xid"
log "github.com/sirupsen/logrus"
ser... |
package graphdriver
import "sync"
type minfo struct {
check bool
count int
}
// RefCounter is a generic counter for use by graphdriver Get/Put calls
type RefCounter struct {
counts map[string]*minfo
mu sync.Mutex
checker Checker
}
// NewRefCounter returns a new RefCounter
func NewRefCounter(c Checker) *R... |
/*
Copyright 2014 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 wr... |
// 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 ... |
// Copyright 2020 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... |
package command
import (
"net"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
"github.com/src-d/gitbase"
"github.com/src-d/gitbase/internal/function"
"github.com/src-d/gitbase/internal/rule"
"github.com/opentracing/opentracing-go"
"github.com/sirupsen/logrus"
"github.com/uber/jaeger-client-go... |
package command
import (
"fmt"
"net"
"os"
"path/filepath"
"strconv"
"github.com/src-d/gitbase"
"github.com/src-d/gitbase/internal/function"
"github.com/src-d/gitbase/internal/rule"
"github.com/opentracing/opentracing-go"
gopilosa "github.com/pilosa/go-pilosa"
"github.com/sirupsen/logrus"
jaeger "github.c... |
package main
import (
"encoding/gob"
"errors"
imgclient "github.com/Symantec/Dominator/imageserver/client"
"github.com/Symantec/Dominator/imageserver/scanner"
"github.com/Symantec/Dominator/lib/filesystem"
"github.com/Symantec/Dominator/lib/hash"
objectclient "github.com/Symantec/Dominator/lib/objectserver/clie... |
package manager
import (
"errors"
)
var (
ErrEmptyParam = errors.New("empty params")
ErrPermDenied = errors.New("permission denied")
ErrAuthenticationFail = errors.New("authentication fails")
ErrAuthorizationFial = errors.New("authorization fails")
)
more clear err msg
package manager
import ... |
/*
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 applicable law or agreed to in writing, ... |
package quic
import (
"context"
"crypto/rand"
"crypto/tls"
"errors"
"fmt"
"net"
"sync"
"time"
"github.com/lucas-clemente/quic-go/internal/ackhandler"
"github.com/lucas-clemente/quic-go/internal/congestion"
"github.com/lucas-clemente/quic-go/internal/crypto"
"github.com/lucas-clemente/quic-go/internal/flow... |
package main
import (
"context"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"fmt"
"io"
"strconv"
"strings"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwallet/chanfunding"
"github.com/lightningnet... |
// Package gmrtest provides a sample application to experiment with gangliamr.
package main
import (
"flag"
"fmt"
"math/rand"
"net/http"
"os"
"runtime"
"time"
"github.com/4eek/gofaker/lorem"
"github.com/daaku/go.ganglia/gmetric"
"github.com/daaku/go.gangliamr"
"github.com/daaku/go.metrics"
)
type Server s... |
// Copyright (C) 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 t... |
// Copyright (C) 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 t... |
package libkb
//
// Code for encoding and decoding SKB-formatted keys. Also works for decoding
// general Keybase Packet types, but we only have SKB at present.
//
// SKB = "Secret Key Bundle", which contains an unencrypted public key and
// and encrypted secret key.
//
import (
"bytes"
"encoding/base64"
"fmt"
"i... |
package ui
import (
"fmt"
"github.com/pkg/errors"
"strconv"
"strings"
"github.com/lunixbochs/usercorn/go/models"
"github.com/lunixbochs/usercorn/go/models/trace"
)
func pad(s string, to int) string {
if len(s) >= to {
return ""
}
return strings.Repeat(" ", to-len(s))
}
type StreamUI struct {
replay *tra... |
package main
import (
"encoding/json"
"flag"
"fmt"
"github.com/sebkl/flagconf"
"image"
"image/color"
"image/png"
"log"
"os"
"strconv"
"text/template"
)
const (
DEFAULT_COUNTRYMAP_IMAGE_FN = "atlas/countrymap.png"
DEFAULT_OUTPUT_FN = "lookup.js"
DEFAULT_COUNTRYNAME_FN = "countrydata/countr... |
package sync
import (
"fmt"
"io"
"os"
"path/filepath"
"github.com/cmars/replican-sync/replican/fs"
"github.com/cmars/replican-sync/replican/treegen"
"strings"
"testing"
"github.com/bmizerany/assert"
)
// Print a description of the steps that the patch plan will follow.
func printPlan(plan *PatchPlan) {
for... |
// Copyright 2015 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 pack
import (
"github.com/git-lfs/git-lfs/errors"
)
// ChainDelta represents a "delta" component of a delta-base chain.
type ChainDelta struct {
// Base is the base delta-base chain that this delta should be applied
// to. It can be a ChainBase in the simple case, or it can itself be a
// ChainDelta, whic... |
// +build selinux,linux
package selinux
import (
"bufio"
"bytes"
"crypto/rand"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
"github.com/opencontainers/selinux/pkg/pwalk"
"github.com/pkg/errors"
"github.com/willf/bitset"
"golang.org/x/sys/u... |
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// vt tablet server: Serves queries and performs housekeeping jobs.
package main
import (
"compress/gzip"
"expvar"
"flag"
"fmt"
"io"
"log"
"net/http"
_ "n... |
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// vt tablet server: Serves queries and performs housekeeping jobs.
package main
import (
"compress/gzip"
"expvar"
"flag"
"fmt"
"io"
"log"
"net/http"
_ "n... |
// vttestserver is a native Go implementation of `run_local_server.py`.
// It allows users to spawn a self-contained Vitess server for local testing/CI
package main
import (
"encoding/json"
"flag"
"fmt"
"os"
"strconv"
"strings"
"github.com/golang/protobuf/proto"
"vitess.io/vitess/go/vt/log"
vttestpb "vitess.... |
// Copyright 2017 The Bazel 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 appl... |
package impl
import (
m "../"
"database/sql"
"errors"
"fmt"
"github.com/go-sql-driver/mysql"
)
const (
select_trading = "SELECT id,company_id,title_type,subject," +
"work_from,work_to,total," +
"quotation_date,quotation_number," +
"bill_date,bill_number," +
"tax_rate,assignee,product," +
"created_time... |
package main
import (
"bufio"
"fmt"
"net"
"os"
"syscall"
)
func handleClient(conn net.Conn) error {
r := bufio.NewReader(conn)
_, err := r.ReadByte()
if err != nil {
return err
}
w := bufio.NewWriter(conn)
_, err = w.WriteString("HTTP/1.0 200 OK\n")
if err != nil {
return err
}
w.Flush()
return ni... |
package loader
import (
"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", "thursday", "friday",... |
/*
golem - lightweight Go WebSocket-framework
Copyright (C) 2013 Niklas Voss
This program is free software: 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 your option... |
// Copyright 2016 by caixw, All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Package locale 提供了一个本地化翻译服务。
package locale
import (
"errors"
"io"
"golang.org/x/text/language"
"golang.org/x/text/message"
"github.com/caixw/apidoc/locale/syslo... |
package gocassos
import (
"bytes"
"time"
"github.com/gocql/gocql"
)
func (o *Object) Remove() {
o.cfg.in_progress.Add(1)
NVM.Printf("REMOVE: Removing %s", o.id)
go o.async_remove()
return
}
func (o *Object) async_remove() {
defer o.cfg.in_progress.Done()
if err := o.cfg.Conn.Query(`DELETE FROM objects WHE... |
// 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.
// Enhanced Logging
//
// This is inspired by the logging functionality in Java. Essentially, you create a Logger
// object and create output filters for it. ... |
package logger
import (
"runtime"
"strings"
"github.com/fatih/color"
)
// ColorMap - Used to map a particular color to a cf status phrase - returns lowercase strings in color.
func (l *Logger) ColorMap(s string) string {
// If Windows, disable colorS
if runtime.GOOS == "windows" || *l.Colors {
return strings... |
package main
import (
"bufio"
"database/sql"
"flag"
"fmt"
_ "github.com/mattn/go-sqlite3"
"io"
"net"
"os"
"os/signal"
"regexp"
"strconv"
"strings"
"syscall"
"time"
)
type logEntry struct {
Node string
Time int64
Msg string
}
type clientEntry struct {
Addr string
Time int64
Online int
}
var ... |
/*
* Copyright 2013 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 chunker
import (
"fmt"
"io"
"log"
"time"
"github.com/thijzert/speeldoos/lib/wavreader"
)
type mp3Chunker struct {
audioIn wavreader.Writer
mp3out *io.PipeReader
embargo time.Time
chcont *chunkContainer
}
func NewMP3() (Chunker, error) {
r, w := io.Pipe()
wavin, err := wavreader.ToMP3(w, wavrea... |
/*
* This file is part of the KubeVirt project
*
* 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 la... |
/*
Copyright 2020 Docker, 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 wr... |
package influxdb
import (
"errors"
"fmt"
"path/filepath"
)
var (
// ErrAuthorizerNotSupported notes that the provided authorizer is not supported for the action you are trying to perform.
ErrAuthorizerNotSupported = errors.New("your authorizer is not supported, please use *platform.Authorization as authorizer")
... |
package storage
import (
"io"
"time"
"github.com/lxc/lxd/lxd/backup"
"github.com/lxc/lxd/lxd/cluster/request"
"github.com/lxc/lxd/lxd/instance"
"github.com/lxc/lxd/lxd/migration"
"github.com/lxc/lxd/lxd/operations"
"github.com/lxc/lxd/lxd/revert"
"github.com/lxc/lxd/lxd/storage/drivers"
"github.com/lxc/lxd/... |
// Copyright (c) 2014-2015 Solano Labs Inc. All Rights Reserved.
package main
import (
"bytes"
"crypto/sha1"
"encoding/hex"
"fmt"
"go/parser"
"go/token"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"syscall"
"gopkg.in/yaml.v2"
)
const (
BEGOTTEN = "Begotten"
BEGOTTEN_LOCK = "B... |
/*
Copyright 2018 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 ©2014 The gonum 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 goblas
import (
"fmt"
"runtime"
"github.com/gonum/blas"
)
const (
blockSize = 64 // b x b matrix
minParBlock = 4 // minimum number of blo... |
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package gofetch
import (
"crypto/sha512"
"fmt"
"io"
"net/http"
"net/http/httptest"
"os"
"path"
"path/fi... |
package main
import (
"io/ioutil"
"log"
"net/http"
"path/filepath"
"text/template"
"github.com/olebedev/go-duktape"
)
func readFile(file string) string {
js, err := ioutil.ReadFile(file)
if err != nil {
log.Fatal(err)
}
return string(js)
}
func Index(w http.ResponseWriter, r *http.Request) {
t, err :... |
package openapi_test
import (
"testing"
openapi "github.com/nasa9084/go-openapi"
)
func TestInfoValidate(t *testing.T) {
candidates := []candidate{
{"empty", openapi.Info{}, true},
{"withTitle", openapi.Info{Title: "foo"}, true},
{"withTitleAndVersion", openapi.Info{Title: "foo", Version: "1.0"}, false},
... |
package main
import (
"bitmm/bitfinex"
"fmt"
"github.com/grd/stat"
"log"
"math"
"os"
"os/exec"
"path/filepath"
"strconv"
"time"
)
// Trade inputs
const (
SYMBOL = "ltcusd" // Instrument to trade
MINCHANGE = 0.0025 // Minumum change required to update prices
TRADENUM = 25 // Number of trades t... |
package gorillamux
import (
"bytes"
"encoding/json"
"encoding/xml"
"fmt"
"net/http"
"reflect"
command "github.com/ungerik/go-command"
)
type ResultsWriter interface {
WriteResults(args command.Args, vars map[string]string, resultVals []reflect.Value, resultErr error, writer http.ResponseWriter, request *http... |
// Copyright (c) 2012 Guillermo Estrada. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Package image implements blending mode functions bewteen images.
//
// The fundamental part of the library is the type BlendFunc,
// the function is applied... |
package gui
import (
"fmt"
"glop/gin"
"glop/sprite"
"os"
"image"
"image/draw"
_ "image/png"
_ "image/jpeg"
"gl"
"gl/glu"
"math"
"github.com/arbaal/mathgl"
)
func init() {
fmt.Printf("")
}
type staticCellData struct {
// Number of AP required to move into this square, move_cost < 0 is impa... |
/****************************************************************************\
`colorize` is a simple package which returns an ascii colorized
string version of an input string
\****************************************************************************/
package colorize
import "testing"
func TestColorizeWithStrin... |
package command
import (
"fmt"
"strconv"
"strings"
"github.com/dustin/go-humanize"
"github.com/hashicorp/nomad/api"
)
type StatsCommand struct {
Meta
}
func (f *StatsCommand) Help() string {
return "Dispalys stats of an allocation or a task running on a nomad client"
}
func (f *StatsCommand) Synopsis() str... |
package bloom
import (
"github.com/pmylund/go-bitset"
"encoding/binary"
"fmt"
"hash"
"hash/fnv"
"math"
)
type filter struct {
m uint32
k uint32
h hash.Hash64
}
func (f *filter) bits(data []byte) []uint32 {
f.h.Reset()
f.h.Write(data)
d := f.h.Sum(nil)
a := binary.BigEndian.Uint32(d[4:8])
b := binary.B... |
package command
import (
"strings"
pb "gopkg.in/cheggaaa/pb.v1"
"github.com/Sirupsen/logrus"
"github.com/mitchellh/cli"
"github.com/nerdalize/nerd/nerd/client"
"github.com/nerdalize/nerd/nerd/client/credentials"
"github.com/nerdalize/nerd/nerd/client/credentials/provider"
"github.com/nerdalize/nerd/nerd/conf... |
package commands
import (
"fmt"
"os"
"reflect"
"github.com/github/hub/github"
"github.com/github/hub/utils"
)
var cmdFork = &Command{
Run: fork,
Usage: "fork [--no-remote]",
Short: "Make a fork of a remote repository on GitHub and add as remote",
Long: `Forks the original project (referenced by "origin" r... |
package main_test
import (
"database/sql"
"flag"
"github.com/adrianmacneil/dbmate"
"github.com/codegangsta/cli"
"github.com/stretchr/testify/require"
"io"
"net/url"
"os"
"path/filepath"
"testing"
)
var stubsDir string
func testContext(t *testing.T) *cli.Context {
var err error
if stubsDir == "" {
stubs... |
package common
import (
"bytes"
"encoding/gob"
"fmt"
"reflect"
"strconv"
"strings"
"github.com/xitongsys/parquet-go/parquet"
)
// `parquet:"name=Name, type=FIXED_LEN_BYTE_ARRAY, length=12"`
type Tag struct {
InName string
ExName string
Type string
KeyType string
ValueType string
BaseType s... |
package common
import "log"
const (
TEXT = 1
BINARY = 2
)
type DataType int
type Message struct {
from *User
to *User
// Possible values:
// control
// message
// file
messageType string
dataType DataType
data []byte
}
func NewMessage(from *User, to *User, messag... |
package common
import (
"os"
"strconv"
"time"
)
// Default service addresses and URLS of Argo CD internal services
const (
// DefaultRepoServerAddr is the gRPC address of the Argo CD repo server
DefaultRepoServerAddr = "argocd-repo-server:8081"
// DefaultDexServerAddr is the HTTP address of the Dex OIDC server,... |
package common
import (
log "github.com/Sirupsen/logrus"
"gopkg.in/gcfg.v1"
)
type Config struct {
// configuration for the logging
Logging struct {
// whether or not log outputs in JSON
UseJSON bool
Level *string
}
// server configuration
Server struct {
Port int
// if true, listens on 0.0.0.0
... |
package main
import (
"flag"
"fmt"
"github.com/jroimartin/gocui"
"github.com/jzelinskie/geddit"
"github.com/toqueteos/webbrowser"
"html"
"log"
"os"
"strings"
)
type pagetype int
const (
List pagetype = iota
Comments
Empty
Help
)
var submissions []*geddit.Submission
var views []*gocui.View
var votes []*... |
package lex
import (
"encoding/json"
"testing"
u "github.com/araddon/gou"
"github.com/bmizerany/assert"
)
func verifyJsonTokenTypes(t *testing.T, expString string, tokens []TokenType) {
l := NewJsonLexer(expString)
for _, goodToken := range tokens {
tok := l.NextToken()
//u.Debugf("%#v %#v", tok, goodToke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.