code
stringlengths
10
1.34M
language
stringclasses
1 value
/* * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) * * 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" AND TH...
Go
/* * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) * * 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" AND TH...
Go
/* * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) * * 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" AND TH...
Go
package main import ( "code.google.com/p/gofpdf" "flag" "fmt" "os" ) func errPrintf(fmtStr string, args ...interface{}) { fmt.Fprintf(os.Stderr, fmtStr, args...) } func showHelp() { errPrintf("Usage: %s [options] font_file [font_file...]\n", os.Args[0]) flag.PrintDefaults() errPrintf("Example: %s --embed --e...
Go
/* * Copyright (c) 2013 Kurt Jung * * 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" AND THE AUTHOR DISCLAIMS AL...
Go
/* * Copyright (c) 2013-2014 Kurt Jung (Gmail: kurt.w.jung) * * 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...
Go
package gofpdf import ( "fmt" "math" ) // Routines in this file are translated from the work of Moritz Wagner and // Andreas Würmser. // TransformMatrix is used for generalized transformations of text, drawings // and images. type TransformMatrix struct { A, B, C, D, E, F float64 } // TransformBegin sets up a tr...
Go
/* * Copyright (c) 2013-2014 Kurt Jung (Gmail: kurt.w.jung) * * 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...
Go
/* * Copyright (c) 2013-2014 Kurt Jung (Gmail: kurt.w.jung) * * 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...
Go
/* * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) * * 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" AND TH...
Go
/* * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) * * 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" AND TH...
Go
// 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. package main import ( "flag" "fmt" "math/rand" "os" "sync" "time" "code.google.com/p/vitess/go/vt/client2/tablet" ) func main() { goroutines := flag.Int...
Go
// 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. package cgzip /* #cgo pkg-config: zlib #include "zlib.h" */ import "C" import ( "hash" "unsafe" ) type crc32Hash struct { crc C.uLong } // an empty buffer ...
Go
// 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. package cgzip // See http://www.zlib.net/zlib_how.html for more information on this /* #cgo pkg-config: zlib #include "zlib.h" // deflateInit2 is a macro, so u...
Go
// 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. package cgzip /* #cgo pkg-config: zlib #include "zlib.h" */ import "C" import ( "hash" "unsafe" ) type adler32Hash struct { adler C.uLong } // an empty buf...
Go
// 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. package cgzip /* #cgo pkg-config: zlib #include "zlib.h" // inflateInit2 is a macro, so using a wrapper function int cgzipInflateInit(z_stream *strm) { strm...
Go
// 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. // Package bytes2 gives you alternate implementations of functionality // similar to go's bytes package package bytes2 import ( "code.google.com/p/vitess/go/hac...
Go
// 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. // Package db defines an alternate (and simplified) // db api compared to go's database/sql. package db import ( "fmt" ) // Driver is the interface that must b...
Go
// 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. package proto import ( "bytes" "code.google.com/p/vitess/go/bson" "code.google.com/p/vitess/go/bytes2" "code.google.com/p/vitess/go/sqltypes" ) func Marshal...
Go
// 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. package proto import ( "code.google.com/p/vitess/go/sqltypes" ) type Field struct { Name string Type int64 } type QueryResult struct { Fields []Field ...
Go
// 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. package mysql /* #cgo pkg-config: gomysql #include <stdlib.h> #include "vtmysql.h" */ import "C" import ( "fmt" "unsafe" "code.google.com/p/vitess/go/hack" ...
Go
// 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. package snitch import ( "code.google.com/p/vitess/go/relog" "fmt" "net/http" "runtime" ) const ( BaseUrl = "/debug/snitch" ) type SnitchCmd struct { url ...
Go
// 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. package stats import ( "encoding/json" "expvar" "sync" "time" ) type CountTracker interface { Counts() map[string]int64 } type Rates struct { mu ...
Go
// 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. package stats // Ring of int64 values // Not thread safe type RingInt64 struct { position int values []int64 } func NewRingInt64(capacity int) *RingInt64 { ...
Go
// 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. package stats import ( "encoding/json" "expvar" "fmt" "sync" "time" ) type Timings struct { mu sync.Mutex TotalCount int64 TotalTime int64 Hist...
Go
// 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. package stats import ( "bytes" "expvar" "fmt" "sync" "time" ) // The States structure keeps historical data about a state machine // state, and exports them...
Go
// 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. package stats import ( "bytes" "expvar" "fmt" "sync" ) type Counters struct { mu sync.Mutex counts map[string]int64 } func NewCounters(name string) *C...
Go
// 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. package stats import ( "bytes" "expvar" "fmt" "sync" ) type Histogram struct { cutoffs []int64 labels []string countLabel string totalLabel string...
Go
// 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. package stats // StrFunc converts any function that returns a JSON string into // an expvar.Var compatible object. type StrFunc func() string func (f StrFunc) St...
Go
// 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. package bson import ( "io" "math" "reflect" "strconv" "time" "code.google.com/p/vitess/go/bytes2" ) var ( TimeType = reflect.TypeOf(time.Time{}) BytesT...
Go
// 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. package bson import ( "bytes" "encoding/binary" "errors" "fmt" "io" "math" "reflect" "strconv" "time" ) // BSON documents are lttle endian var Pack = b...
Go
// 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. // Utility functions for custom encoders package bson import ( "code.google.com/p/vitess/go/bytes2" ) func EncodeStringArray(buf *bytes2.ChunkedWriter, name st...
Go
// 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. // Utility functions for custom decoders package bson import ( "bytes" "math" "strconv" "time" "code.google.com/p/vitess/go/hack" ) var ( emptybytes = []...
Go
// 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. package terminal import ( "syscall" "unsafe" ) // IsTerminal returns true if the given file descriptor is a terminal. func IsTerminal(fd uintptr) bool { var t...
Go
// 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. /* Package timer provides timer functionality that can be controlled by the user. You start the timer by providing it a callback function, which it will call at...
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 bufio implements buffered I/O. It wraps an io.Reader or io.Writer // object, creating another object (Reader or AsyncWriter) that also implements //...
Go
// 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. package logfile import ( "fmt" "io" "os" "path" "path/filepath" "sync" "time" ) type Logfile struct { mu sync.Mutex handle *os.File curName strin...
Go
// 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. package memcache import ( "bufio" "fmt" "io" "net" "strconv" "strings" ) type Connection struct { conn net.Conn buffered bufio.ReadWriter } type Res...
Go
// Copyright 2013, 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. package sync2 import ( "sync" ) // Cond is an alternate implementation of sync.Cond type Cond struct { L sync.Locker sema chan struct{} waiters Atom...
Go
// Copyright 2013, 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. package sync2 import ( "sync/atomic" "time" ) type AtomicInt32 int32 func (i *AtomicInt32) Add(n int32) int32 { return atomic.AddInt32((*int32)(i), n) } fun...
Go
package sync2 // What's in a name? Channels have all you need to emulate a counting // semaphore with a boatload of extra functionality. However, in some // cases, you just want a familiar API. // // Additionally there is great debate on how to do this correctly: // // https://groups.google.com/forum/#!msg/golang-dev/...
Go
package streamlog import ( "expvar" "io" "net/http" "net/url" "sync" "code.google.com/p/vitess/go/relog" "code.google.com/p/vitess/go/sync2" ) var droppedMessages = expvar.NewMap("streamlog-dropped-messages") // A StreamLogger makes messages sent to it available through HTTP. type StreamLogger struct { data...
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 rpcplus /* Some HTML presented at http://machine:port/debug/rpc Lists services, their methods, and some statistics, still rudimentary. */ import ( ...
Go
// 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 jsonrpc import ( "encoding/json" "errors" "io" "sync" rpc "code.google.com/p/vitess/go/rpcplus" ) type serverCodec struct { dec *json.Decoder ...
Go
// 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 jsonrpc implements a JSON-RPC ClientCodec and ServerCodec // for the rpc package. package jsonrpc import ( "encoding/json" "fmt" "io" "net" "s...
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 rpc provides access to the exported methods of an object across a network or other I/O connection. A server registers an object, making it visible...
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 rpcplus import ( "bufio" "encoding/gob" "errors" "io" "log" "net" "net/http" "reflect" "sync" ) // ServerError represents an error that has b...
Go
// 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. package tb import ( "bytes" "fmt" "io/ioutil" "runtime" ) var ( dunno = []byte("???") centerDot = []byte("·") dot = []byte(".") ) // This packa...
Go
// 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. // Package hack gives you some efficient functionality at the cost // breaking some go rules package hack import ( "reflect" "unsafe" ) // StringArena lets yo...
Go
// 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. package umgmt import ( "fmt" "net" "os" "syscall" ) func SendFd(conn *net.UnixConn, file *os.File) error { rights := syscall.UnixRights(int(file.Fd())) dum...
Go
// 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. package umgmt import ( "crypto/tls" "crypto/x509" "expvar" "net" "net/http" "os" "strings" "sync" "code.google.com/p/vitess/go/relog" ) var connectionC...
Go
// 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. // The micromanagment module provides a tiny server running on a unix // domain socket. // // It is meant as an alternative to signals for handling graceful // ser...
Go
package main import ( "code.google.com/p/vitess/go/umgmt" "flag" ) var sockPath = flag.String("sock-path", "", "") func main() { flag.Parse() println("sock path: ", *sockPath) uc, err := umgmt.Dial(*sockPath) if err != nil { panic(err) } msg, err := uc.Ping() if err != nil { panic(err) } println("msg:...
Go
// 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. package umgmt import ( "io" "net" "net/rpc" "code.google.com/p/vitess/go/relog" ) type Client struct { *rpc.Client conn io.ReadWriteCloser } func Dial(ad...
Go
// 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. package pools import ( "fmt" "sync" "time" ) // RoundRobin is deprecated. Use ResourcePool instead. // RoundRobin allows you to use a pool of resources in a r...
Go
// 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. package pools import ( "errors" "fmt" "sync" "time" ) // Numbered allows you to manage resources by tracking them with numbers. // There are no interface res...
Go
// 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. // Package pools provides functionality to manage and reuse resources // like connections. package pools import ( "fmt" "time" "code.google.com/p/vitess/go/sy...
Go
// 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. package ioutil2 import ( "io" "io/ioutil" "os" "path" ) // Write file to temp and atomically move when everything else succeeds. func WriteFileAtomic(filenam...
Go
// 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. /* The vt_binlog_player reads data from the a remote host via vt_binlog_server. This is mostly intended for online data migrations. */ package main import ( "buf...
Go
// 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. package main import ( "flag" "fmt" _ "net/http/pprof" "os" "code.google.com/p/vitess/go/relog" rpc "code.google.com/p/vitess/go/rpcplus" "code.google.com/...
Go
// 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 binlog server: Serves binlog for out of band replication. package main import ( "bufio" "bytes" "flag" "fmt" "io" _ "net/http/pprof" "os" "os/signal...
Go
// 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. package main import ( "flag" "fmt" "net/url" "os" "strings" "code.google.com/p/vitess/go/relog" "code.google.com/p/vitess/go/vt/dbconfigs" "code.google.c...
Go
package main // To be used with PowerDNS (pdns) as a "pipe backend" CoProcess. // // Protocol description: // http://downloads.powerdns.com/documentation/html/backends-detail.html#PIPEBACKEND. // // Mainly the resolver has to interpret zkns addresses in a way that // is helpful for DNS. This involves approximating CN...
Go
// 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. package main import ( "bufio" "flag" "fmt" "log" "os" "strings" "code.google.com/p/vitess/go/relog" "code.google.com/p/vitess/go/zk/zkctl" ) var usage =...
Go
// 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 ( "encoding/json" "flag" "fmt" "io" "io/ioutil" "net/http" _ "net/h...
Go
// Copyright 2013, 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. package main // Imports and register the Zookeeper TopologyServer import ( _ "code.google.com/p/vitess/go/vt/zktopo" )
Go
// Copyright 2013, 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. package main // Imports and register the Zookeeper topo.Server // Adds the Zookeeper specific commands import ( "flag" "fmt" "path" "sort" "sync" "time" ...
Go
// 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. package main import ( "bufio" "flag" "fmt" "io" "io/ioutil" "log/syslog" "os" "os/signal" "sort" "strings" "syscall" "time" "code.google.com/p/vites...
Go
// 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. package main import ( "expvar" "flag" "fmt" "net/http" _ "net/http/pprof" "os" "code.google.com/p/vitess/go/jscfg" "code.google.com/p/vitess/go/relog" r...
Go
// Copyright 2013, 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. package main // Imports and register the Zookeeper TopologyServer import ( _ "code.google.com/p/vitess/go/vt/zktopo" )
Go
// 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. package main import ( "flag" "fmt" "log" "os" "time" "code.google.com/p/vitess/go/rpcplus" "code.google.com/p/vitess/go/rpcwrap/bsonrpc" "code.google.com...
Go
// Copyright 2013, 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. package main // Imports and register the Zookeeper TopologyServer import ( _ "code.google.com/p/vitess/go/vt/zktopo" )
Go
// Copyright 2013, 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. package main import ( "flag" "os" "sync" "code.google.com/p/vitess/go/relog" "code.google.com/p/vitess/go/tb" "code.google.com/p/vitess/go/vt/concurrency" ...
Go
package main import ( "bytes" "encoding/json" "flag" "fmt" "html/template" "io" "net/http" "net/url" "path" "reflect" "strings" "time" "code.google.com/p/vitess/go/relog" "code.google.com/p/vitess/go/vt/topo" "code.google.com/p/vitess/go/vt/wrangler" "code.google.com/p/vitess/go/vt/zktopo" // FIXME(al...
Go
// Copyright 2013, 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. package main // Imports and register the Zookeeper TopologyServer import ( _ "code.google.com/p/vitess/go/vt/zktopo" )
Go
// 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. package main import ( "encoding/json" "flag" "fmt" "log" "os" "strings" "time" "code.google.com/p/vitess/go/db" _ "code.google.com/p/vitess/go/vt/client...
Go
// 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. // normalizer takes a file of sql statements as input and converts the // statements into normalized sql statements with bind variables. package main import ( "b...
Go
package main import ( "archive/zip" "fmt" "io/ioutil" "log" "os" "os/exec" "os/signal" "path" "sort" "strings" "sync" "syscall" "time" opts "code.google.com/p/opts-go" "code.google.com/p/vitess/go/terminal" "code.google.com/p/vitess/go/zk" "launchpad.net/gozk/zookeeper" ) var zkAddrs = opts.LongSin...
Go
// 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. package main import ( "encoding/json" "flag" "fmt" "io/ioutil" _ "net/http/pprof" "os" "os/signal" "syscall" "code.google.com/p/vitess/go/relog" rpc "c...
Go
// 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. // Package sqltypes implements interfaces and types that represent SQL values. package sqltypes import ( "encoding/base64" "encoding/gob" "encoding/json" "fmt...
Go
// 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. package bsonrpc import ( "bytes" "code.google.com/p/vitess/go/bson" "code.google.com/p/vitess/go/bytes2" rpc "code.google.com/p/vitess/go/rpcplus" ) type Req...
Go
// 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. package bsonrpc import ( "io" "time" "code.google.com/p/vitess/go/bson" "code.google.com/p/vitess/go/bytes2" rpc "code.google.com/p/vitess/go/rpcplus" "cod...
Go
// 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. package rpcwrap import ( "bufio" "errors" "io" "net" "net/http" "time" "code.google.com/p/vitess/go/relog" rpc "code.google.com/p/vitess/go/rpcplus" "co...
Go
package proto type Context struct { RemoteAddr string Username string }
Go
package auth import ( "crypto/hmac" "crypto/md5" "crypto/rand" "encoding/binary" "encoding/hex" "fmt" "os" "time" ) func CRAMMD5GetChallenge() (string, error) { var randDigits uint32 err := binary.Read(rand.Reader, binary.LittleEndian, &randDigits) if err != nil { return "", err } timestamp := time.No...
Go
package auth import ( "encoding/json" "errors" "fmt" "io/ioutil" "strings" "code.google.com/p/vitess/go/relog" rpc "code.google.com/p/vitess/go/rpcplus" "code.google.com/p/vitess/go/rpcwrap/proto" ) // UnusedArgument is a type used to indicate an argument that is // necessary because of net/rpc requirements....
Go
// 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. package jsonrpc import ( "time" rpc "code.google.com/p/vitess/go/rpcplus" oldjson "code.google.com/p/vitess/go/rpcplus/jsonrpc" "code.google.com/p/vitess/go/...
Go
// 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. package schema // Yes, this sucks. It's a tiny tiny package that needs to be on its own // It contains a data structure that's shared between sqlparser & tabletse...
Go
// 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. package hook import ( "bytes" "fmt" "os" "os/exec" "path" "strings" "syscall" "code.google.com/p/vitess/go/jscfg" "code.google.com/p/vitess/go/relog" v...
Go
// 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. // Package dbconfigs is reusable by vt tools to load // the db configs file. package dbconfigs import ( "encoding/json" "flag" "code.google.com/p/vitess/go/js...
Go
// 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. package mysqlctl import ( "crypto/md5" "encoding/hex" "fmt" "regexp" "sort" "strings" "code.google.com/p/vitess/go/jscfg" "code.google.com/p/vitess/go/re...
Go
// 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. package mysqlctl import ( "fmt" "time" "code.google.com/p/vitess/go/relog" ) // if the master is still alive, then we need to demote it gracefully // make it...
Go
// 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. /* Generate my.cnf files from templates. */ package mysqlctl import ( "bufio" "bytes" "fmt" "io" "os" "path/filepath" "strconv" ) type Mycnf struct { ...
Go
// 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. package mysqlctl // FIXME(msolomon) this actions were copy/pasted from replication.go because // they were conceptually quite similar. They should be reconciled a...
Go
// 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. /* Handle creating replicas and setting up the replication streams. */ package mysqlctl import ( "bytes" "errors" "fmt" "net" "os" "path" "strconv" "stri...
Go
package mysqlctl import ( "code.google.com/p/vitess/go/relog" ) type MapFunc func(index int) error // ConcurrentMap applies fun in a concurrent manner on integers from 0 // to n-1 (they are assumed to be indexes of some slice containing // items to be processed). The first error returned by a fun // application wil...
Go
// 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. package mysqlctl type BlPosition struct { Position ReplicationCoordinates Timestamp int64 Xid uint64 GroupId uint64 } type BinlogResponse struct { ...
Go
// 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. package mysqlctl import ( "fmt" "hash/crc64" "sort" "code.google.com/p/vitess/go/mysql/proto" "code.google.com/p/vitess/go/sqltypes" "code.google.com/p/vit...
Go
// 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. package mysqlctl import ( "bytes" "fmt" "io" "os" "path" "strconv" ) /* The code in this file helps to track the position metadata for binlogs. */ type Rep...
Go
// 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. package mysqlctl /* the binlogreader is intended to "tail -f" a binlog, but be smart enough to stop tailing it when mysql is done writing to that binlog. The sto...
Go