code stringlengths 10 1.34M | language stringclasses 1
value |
|---|---|
package gograph
import (
"path"
"strings"
)
// Split p on /
func split(p string) []string {
return strings.Split(p, "/")
}
// Returns the depth or number of / in a given path
func PathDepth(p string) int {
parts := split(p)
if len(parts) == 2 && parts[1] == "" {
return 1
}
return len(parts)
}
func splitPat... | Go |
package gograph
import (
"database/sql"
"fmt"
"path"
"sync"
)
const (
createEntityTable = `
CREATE TABLE IF NOT EXISTS entity (
id text NOT NULL PRIMARY KEY
);`
createEdgeTable = `
CREATE TABLE IF NOT EXISTS edge (
"entity_id" text NOT NULL,
"parent_id" text NULL,
"n... | Go |
package gograph
import "sort"
type pathSorter struct {
paths []string
by func(i, j string) bool
}
func sortByDepth(paths []string) {
s := &pathSorter{paths, func(i, j string) bool {
return PathDepth(i) > PathDepth(j)
}}
sort.Sort(s)
}
func (s *pathSorter) Len() int {
return len(s.paths)
}
func (s *pathS... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/namesgenerator"
"circuit/yank/github.com/dotcloud/docker/utils"
"fmt"
"io/ioutil"
"strconv"
"strings"
)
// Compare two Config struct. Do not compare the "Image" nor "Hostname" fields
// If OpenStdin is set, then it differs
func CompareConfig(a, b ... | Go |
package netlink
import (
"encoding/binary"
"fmt"
"net"
"syscall"
"unsafe"
)
var nextSeqNr int
func nativeEndian() binary.ByteOrder {
var x uint32 = 0x01020304
if *(*byte)(unsafe.Pointer(&x)) == 0x01 {
return binary.BigEndian
}
return binary.LittleEndian
}
func getSeq() int {
nextSeqNr = nextSeqNr + 1
r... | Go |
package netlink
import (
"fmt"
"net"
)
func NetworkGetRoutes() ([]*net.IPNet, error) {
return nil, fmt.Errorf("Not implemented")
}
func NetworkLinkAdd(name string, linkType string) error {
return fmt.Errorf("Not implemented")
}
func NetworkLinkUp(iface *net.Interface) error {
return fmt.Errorf("Not implemented... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/engine"
"net"
)
// FIXME: separate runtime configuration from http api configuration
type DaemonConfig struct {
Pidfile string
Root string
AutoRestart bool
EnableCors bool... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/utils"
"fmt"
"sync"
"time"
)
type State struct {
sync.RWMutex
Running bool
Pid int
ExitCode int
StartedAt time.Time
FinishedAt time.Time
Ghost bool
}
// String returns a human-readable description of the state
func (s *Stat... | Go |
package main
import (
"circuit/yank/github.com/dotcloud/docker"
"circuit/yank/github.com/dotcloud/docker/engine"
"circuit/yank/github.com/dotcloud/docker/sysinit"
"circuit/yank/github.com/dotcloud/docker/utils"
"flag"
"fmt"
"log"
"os"
"strings"
)
var (
GITCOMMIT string
VERSION string
)
func main() {
if... | Go |
package namesgenerator
import (
"fmt"
"math/rand"
"time"
)
type NameChecker interface {
Exists(name string) bool
}
var (
colors = [...]string{"white", "silver", "gray", "black", "blue", "green", "cyan", "yellow", "gold", "orange", "brown", "red", "violet", "pink", "magenta", "purple", "maroon", "crimson", "plu... | Go |
package term
import (
"syscall"
"unsafe"
)
const (
getTermios = syscall.TCGETS
setTermios = syscall.TCSETS
)
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Cc [20]byte
Ispeed uint32
Ospeed uint32
}
// MakeRaw put the terminal connected to the given file descriptor into ... | Go |
package term
import (
"syscall"
"unsafe"
)
const (
getTermios = syscall.TIOCGETA
setTermios = syscall.TIOCSETA
ECHO = 0x00000008
ONLCR = 0x2
ISTRIP = 0x20
INLCR = 0x40
ISIG = 0x80
IGNCR = 0x80
ICANON = 0x100
ICRNL = 0x100
IXOFF = 0x400
IXON = 0x200
)
type Termios struct {
Iflag uint64
Of... | Go |
package term
import (
"os"
"os/signal"
"syscall"
"unsafe"
)
type State struct {
termios Termios
}
type Winsize struct {
Height uint16
Width uint16
x uint16
y uint16
}
func GetWinsize(fd uintptr) (*Winsize, error) {
ws := &Winsize{}
_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(sy... | Go |
package utils
import (
"os"
"os/signal"
)
func StopCatch(sigc chan os.Signal) {
signal.Stop(sigc)
close(sigc)
}
| Go |
package utils
import (
"bytes"
"crypto/sha1"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"index/suffixarray"
"io"
"io/ioutil"
"net/http"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"sync"
"time"
)
var (
IAMSTATIC bool // whether or not Docker itself w... | Go |
package utils
import (
"os"
"os/signal"
"syscall"
)
func CatchAll(sigc chan os.Signal) {
signal.Notify(sigc,
syscall.SIGABRT,
syscall.SIGALRM,
syscall.SIGBUS,
syscall.SIGCHLD,
syscall.SIGCLD,
syscall.SIGCONT,
syscall.SIGFPE,
syscall.SIGHUP,
syscall.SIGILL,
syscall.SIGINT,
syscall.SIGIO,
sy... | Go |
package utils
import (
"bytes"
"circuit/yank/github.com/dotcloud/tar"
"compress/gzip"
"crypto/sha256"
"encoding/hex"
"hash"
"io"
"sort"
"strconv"
)
type verboseHash struct {
hash.Hash
}
func (h verboseHash) Write(buf []byte) (int, error) {
Debugf("--->%s<---", buf)
return h.Hash.Write(buf)
}
type TarSum... | Go |
package utils
import (
"syscall"
)
type Utsname syscall.Utsname
func uname() (*syscall.Utsname, error) {
uts := &syscall.Utsname{}
if err := syscall.Uname(uts); err != nil {
return nil, err
}
return uts, nil
}
| Go |
package utils
import (
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
)
func CreatePidFile(pidfile string) error {
if pidString, err := ioutil.ReadFile(pidfile); err == nil {
pid, err := strconv.Atoi(string(pidString))
if err == nil {
if _, err := os.Stat(fmt.Sprintf("/proc/%d/", pid)); err == nil {
return f... | Go |
package utils
import (
"crypto/rand"
"encoding/hex"
"io"
)
func RandomString() string {
id := make([]byte, 32)
_, err := io.ReadFull(rand.Reader, id)
if err != nil {
panic(err) // This shouldn't happen
}
return hex.EncodeToString(id)
}
| Go |
package utils
import (
"os"
"os/signal"
"syscall"
)
func CatchAll(sigc chan os.Signal) {
signal.Notify(sigc,
syscall.SIGABRT,
syscall.SIGALRM,
syscall.SIGBUS,
syscall.SIGCHLD,
syscall.SIGCONT,
syscall.SIGEMT,
syscall.SIGFPE,
syscall.SIGHUP,
syscall.SIGILL,
syscall.SIGINFO,
syscall.SIGINT,
... | Go |
package utils
import (
"errors"
)
type Utsname struct {
Release [65]byte
}
func uname() (*Utsname, error) {
return nil, errors.New("Kernel version detection is not available on darwin")
}
| Go |
package utils
import (
"encoding/binary"
"errors"
"io"
)
const (
StdWriterPrefixLen = 8
StdWriterFdIndex = 0
StdWriterSizeIndex = 4
)
type StdType [StdWriterPrefixLen]byte
var (
Stdin StdType = StdType{0: 0}
Stdout StdType = StdType{0: 1}
Stderr StdType = StdType{0: 2}
)
type StdWriter struct {
io.Wri... | Go |
package utils
import (
"bytes"
"io"
"net/http"
"strings"
)
// VersionInfo is used to model entities which has a version.
// It is basically a tupple with name and version.
type VersionInfo interface {
Name() string
Version() string
}
func validVersion(version VersionInfo) bool {
stopChars := " \t\r\n/"
if st... | Go |
package docker
import (
_ "circuit/yank/code.google.com/p/gosqlite/sqlite3" // registers sqlite
"circuit/yank/github.com/dotcloud/docker/gograph"
"circuit/yank/github.com/dotcloud/docker/utils"
"container/list"
"database/sql"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"path"
"sort"
"strings"
"sync"
"t... | Go |
package main
import (
"fmt"
"io"
"log"
"net"
"os"
"os/exec"
"path"
"time"
)
var DOCKERPATH = path.Join(os.Getenv("DOCKERPATH"), "docker")
// WARNING: this crashTest will 1) crash your host, 2) remove all containers
func runDaemon() (*exec.Cmd, error) {
os.Remove("/var/run/docker.pid")
exec.Command("rm", "-... | Go |
package main
import (
"bytes"
"circuit/yank/github.com/dotcloud/docker"
"encoding/json"
"flag"
"fmt"
"os"
"strings"
"text/template"
)
var templates = map[string]string{
"upstart": `description "{{.description}}"
author "{{.author}}"
start on filesystem and started lxc-net and started docker
stop on runlevel... | Go |
package auth
import (
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
"strings"
)
// Where we store the config file
const CONFIGFILE = ".dockercfg"
// Only used for user auth + account creation
const INDEXSERVER = "https://... | Go |
package iptables
import (
"errors"
"fmt"
"net"
"os"
"os/exec"
"strconv"
"strings"
)
type Action string
const (
Add Action = "-A"
Delete Action = "-D"
)
var (
ErrIptablesNotFound = errors.New("Iptables not found")
nat = []string{"-t", "nat"}
)
type Chain struct {
Name string
Bridge... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"path"
"reflect"
"regexp"
"strings"
)
type BuildFile interface {
Build(io.Reader) (string, error)
CmdFrom(string) error
CmdRun(... | Go |
package docker
import "syscall"
func mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
return syscall.Mount(source, target, fstype, flags, data)
}
| Go |
package main
import (
"circuit/yank/github.com/dotcloud/docker/sysinit"
)
var (
GITCOMMIT string
VERSION string
)
func main() {
// Running in init mode
sysinit.SysInit()
return
}
| Go |
package proxy
import (
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/binary"
"log"
"net"
"sync"
"syscall"
"time"
)
const (
UDPConnTrackTimeout = 90 * time.Second
UDPBufSize = 2048
)
// A net.Addr where the IP is split into two fields so you can use it as a key
// in a map:
type connTrac... | Go |
package proxy
import (
"fmt"
"net"
)
type Proxy interface {
// Start forwarding traffic back and forth the front and back-end
// addresses.
Run()
// Stop forwarding traffic and close both ends of the Proxy.
Close()
// Return the address on which the proxy is listening.
FrontendAddr() net.Addr
// Return the ... | Go |
package proxy
import (
"circuit/yank/github.com/dotcloud/docker/utils"
"io"
"log"
"net"
"syscall"
)
type TCPProxy struct {
listener *net.TCPListener
frontendAddr *net.TCPAddr
backendAddr *net.TCPAddr
}
func NewTCPProxy(frontendAddr, backendAddr *net.TCPAddr) (*TCPProxy, error) {
listener, err := net.Li... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/iptables"
"fmt"
"path"
"strings"
)
type Link struct {
ParentIP string
ChildIP string
Name string
BridgeInterface string
ChildEnvironment []string
Ports []Port
IsEnabled bool
}
func NewLink(pare... | Go |
package docker
import (
"bufio"
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/auth"
"circuit/yank/github.com/dotcloud/docker/engine"
"circuit/yank/github.com/dotcloud/docker/gograph"
"circuit/yank/github.com/dotcloud/docker/registry"
"circuit/yank/github.com/dotcloud... | Go |
package sysinit
import (
"circuit/yank/github.com/dotcloud/docker/netlink"
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
"strconv"
"strings"
"syscall"
)
// Setup networking
func setupNetworking(gw string) {
if gw == "" {
return
}
... | Go |
package docker
import (
"archive/tar"
"bufio"
"bytes"
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/auth"
"circuit/yank/github.com/dotcloud/docker/registry"
"circuit/yank/github.com/dotcloud/docker/term"
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/bas... | Go |
package docker
import "strings"
type (
APIHistory struct {
ID string `json:"Id"`
Tags []string `json:",omitempty"`
Created int64
CreatedBy string `json:",omitempty"`
Size int64
}
APIImages struct {
ID string `json:"Id"`
RepoTags []string `json:",omitempty"`
Creat... | Go |
package docker
import (
"fmt"
"os"
"path/filepath"
"strings"
)
type ChangeType int
const (
ChangeModify = iota
ChangeAdd
ChangeDelete
)
type Change struct {
Path string
Kind ChangeType
}
func (change *Change) String() string {
var kind string
switch change.Kind {
case ChangeModify:
kind = "C"
case C... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/utils"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"time"
)
// A Graph is a store for versioned filesystem images and the relationship between them.
type Graph struct {
Root ... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/utils"
"fmt"
"os"
"os/exec"
"path/filepath"
"syscall"
"time"
)
func Unmount(target string) error {
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
utils.Errorf("[warning]: couldn't run auplink before unmount: %s", err)
... | Go |
package docker
import (
"text/template"
)
const LxcTemplate = `
# hostname
{{if .Config.Hostname}}
lxc.utsname = {{.Config.Hostname}}
{{else}}
lxc.utsname = {{.Id}}
{{end}}
{{if .Config.NetworkDisabled}}
# network is disabled (-n=false)
lxc.network.type = empty
{{else}}
# network configuration
lxc.network.type = ve... | Go |
package registry
import (
"bytes"
"circuit/yank/github.com/dotcloud/docker/auth"
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/http/cookiejar"
"net/url"
"regexp"
"strconv"
"strings"
"time"
)
var (
ErrAlreadyExists = error... | Go |
package docker
import (
"bytes"
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/term"
"circuit/yank/github.com/dotcloud/docker/utils"
"circuit/yank/github.com/kr/pty"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
"path"
"path/filep... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/utils"
"crypto/rand"
"encoding/hex"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"path"
"path/filepath"
"strconv"
"strings"
"syscall"
"time"
)
type Image struct {
ID ... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/iptables"
"circuit/yank/github.com/dotcloud/docker/netlink"
"circuit/yank/github.com/dotcloud/docker/proxy"
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/binary"
"errors"
"fmt"
"log"
"net"
"strconv"
"sync"
)
const (
DefaultNetwor... | Go |
package docker
import (
"circuit/yank/github.com/dotcloud/docker/utils"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
)
const DEFAULTTAG = "latest"
type TagStore struct {
path string
graph *Graph
Repositories map[string]Repository
}
type Repository map[string]stri... | Go |
package docker
import (
"circuit/yank/code.google.com/p/go.net/websocket"
"circuit/yank/github.com/dotcloud/docker/archive"
"circuit/yank/github.com/dotcloud/docker/auth"
"circuit/yank/github.com/dotcloud/docker/utils"
"circuit/yank/github.com/gorilla/mux"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/iou... | Go |
package docker
import "sort"
type imageSorter struct {
images []APIImages
by func(i1, i2 *APIImages) bool // Closure used in the Less method.
}
// Len is part of sort.Interface.
func (s *imageSorter) Len() int {
return len(s.images)
}
// Swap is part of sort.Interface.
func (s *imageSorter) Swap(i, j int) {
... | Go |
package docker
import "errors"
func mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
return errors.New("mount is not implemented on darwin")
}
| Go |
// Copyright 2012 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 linux darwin freebsd openbsd netbsd
package tar
import (
"os"
"syscall"
)
func init() {
sysStat = statUnix
}
func statUnix(fi os.FileInfo, h *H... | Go |
// 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 tar implements access to tar archives.
// It aims to cover most of the variations, including those produced
// by GNU and BSD tars.
//
// References:... | Go |
// 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 tar
// TODO(dsymonds):
// - catch more errors (no first header, etc.)
import (
"bytes"
"errors"
"fmt"
"io"
"os"
"path"
"strconv"
"strings"
"t... | Go |
// Copyright 2012 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 darwin freebsd netbsd
package tar
import (
"syscall"
"time"
)
func statAtime(st *syscall.Stat_t) time.Time {
return time.Unix(st.Atimespec.Unix(... | Go |
// Copyright 2012 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 linux openbsd
package tar
import (
"syscall"
"time"
)
func statAtime(st *syscall.Stat_t) time.Time {
return time.Unix(st.Atim.Unix())
}
func st... | Go |
// 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 tar
// TODO(dsymonds):
// - pax extensions
import (
"bytes"
"errors"
"io"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
)
var (
ErrHeader = ... | Go |
// Copyright 2012 The Gorilla 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 mux
import (
"bytes"
"fmt"
"net/http"
"net/url"
"regexp"
"strings"
)
// newRouteRegexp parses a route template and returns a routeRegexp,
/... | Go |
// Copyright 2012 The Gorilla 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 mux
import (
"errors"
"fmt"
"net/http"
"net/url"
"strings"
)
// Route stores information to match a request and build URLs.
type Route struc... | Go |
// Copyright 2012 The Gorilla 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 mux
import (
"fmt"
"net/http"
"path"
"circuit/yank/github.com/gorilla/context"
)
// NewRouter returns a new router instance.
func NewRouter(... | Go |
// Copyright 2012 The Gorilla 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 gorilla/mux implements a request router and dispatcher.
The name mux stands for "HTTP request multiplexer". Like the standard
http.ServeMux, mu... | Go |
// Copyright 2012 The Gorilla 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 context
import (
"net/http"
"sync"
"time"
)
var (
mutex sync.Mutex
data = make(map[*http.Request]map[interface{}]interface{})
datat = make... | Go |
// Copyright 2012 The Gorilla 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 gorilla/context stores values shared during a request lifetime.
For example, a router can set variables extracted from the URL and later
applic... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package config
// BuildConfig holds configuration parameters for the automated circuit app build system
type BuildC... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package config provides access to the circuit configuration of this worker process
package config
import (
"cir... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package config
import (
"path"
)
// InstallConfig holds configuration parameters regarding circuit installation o... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package config
// AnchorConfig holds configuration parameters regarding the anchor file system server
type AnchorCo... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package config
import "circuit/use/n"
// SparkConfig captures a few worker startup parameters that can be configur... | Go |
// Copyright 2013 The Go Circuit Project
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package load encloses subpackages cmd and worker which are to be included in the respective types of Go... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package cmd has the side effect of linking the circuit runtime into the importing application
package cmd
import... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Importing package worker has the side effect of turning your program into a circuit worker executable
package wor... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package sumr implements a distributed persistent key-value store
package sumr
import "fmt"
// Key is the type o... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package client implements a circuit client for the sumr database
package client
import (
"circuit/app/sumr"
"c... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package block implements the core database functionality of a sumr shard
package block
import (
"circuit/app/su... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package block
import (
"circuit/kit/fs"
"errors"
"hash/crc32"
"math"
"os"
"sync"
)
// File is an interface t... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package block
import (
"bytes"
"circuit/app/sumr"
"encoding/binary"
"time"
)
type add struct {
UTime time.Tim... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package block
import (
"circuit/kit/fs"
"errors"
"math/rand"
"strconv"
"strings"
"sync"
"time"
)
// Disk im... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package block
import (
"circuit/app/sumr"
"time"
)
// Sketch is the type of the value stored within the key-valu... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package server
import (
"bytes"
"encoding/gob"
"fmt"
"time"
"circuit/app/sumr"
"circuit/kit/xor"
"circuit/u... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package server
// In its lifetime (across failures and restarts), a service is only booted
// once. Reviving servi... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package server
import (
"circuit/use/circuit"
"time"
)
// Main wraps the worker function that starts a sumr shar... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package server implements a cross-type for the functionality of a sumr shard
package server
import (
"os"
"tim... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// mkcfg prints out an empty sumr shard servers configuration
package main
import (
"circuit/app/sumr/server"
"en... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package api
import (
"path"
"strconv"
"sync"
"circuit/kit/sched/limiter"
"circuit/use/anchorfs"
"circuit/use... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package api
import (
"circuit/app/sumr"
"encoding/json"
"io"
)
// Response is the common response object
type r... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package api
import "encoding/gob"
func init() {
gob.Register(&Config{})
gob.Register(&WorkerConfig{})
}
// Conf... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package api
import (
"circuit/app/sumr"
"encoding/json"
"hash/fnv"
"math"
"time"
)
// Feature is a dictionary... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// mkcfg prints out an empty sumr api configuration
package main
import (
"circuit/app/sumr/api"
"encoding/json"
... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package api
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"math"
"net"
"net/http"
"strconv"
"time"
)
... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package API implements aa REST HTTP API proxy for a sumr database
package api
import (
"circuit/app/sumr/client... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Miscellaneous circuit applications
package app
| Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package sys encloses the implementations of circuit modules
package sys
| Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package acid implements a built-in API that exposes debugging, profiling, monitoring, and other worker facilities... | Go |
// Copyright 2013 Tumblr, Inc.
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package acid
import (
"circuit/use/circuit"
"fmt"
"reflect"
)
type Stringer interface {
String() string
}
fun... | Go |
// Copyright 2013 The Go Circuit Project
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package anchor
import (
"runtime"
"time"
use "circuit/use/anchorfs"
)
// Dir is a directory handle.
... | Go |
// Copyright 2013 The Go Circuit Project
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package anchor
import (
"bytes"
"container/list"
"path"
"sort"
"sync"
use "circuit/use/anchorfs"
)... | Go |
// Copyright 2013 The Go Circuit Project
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package load supplies an implementation of the anchorfs circuit module
package load
import (
"circuit... | Go |
// Copyright 2013 The Go Circuit Project
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
package anchor
type File struct {
path string
anchor Payload
}
func newFile(h *Handle) *File {
// F... | Go |
// Copyright 2013 The Go Circuit Project
// Use of this source code is governed by the license for
// The Go Circuit Project, found in the LICENSE file.
//
// Authors:
// 2013 Petar Maymounkov <p@gocircuit.org>
// Package circuit-anchor is an Anchor/Graveyard File System server
package main
import (
"flag"
"log"
... | Go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.