Versions in this module Expand all Collapse all v0 v0.0.6 Mar 16, 2016 v0.0.5 Mar 8, 2016 v0.0.4 Mar 8, 2016 v0.0.3 Feb 22, 2016 Changes in this version + var ErrorHandlers = []func(error) + var ForeverTestTimeout = time.Second * 30 + var NeverStop <-chan struct{} = make(chan struct{}) + var PanicHandlers = []func(interface{}) + var ReallyCrash bool + func AllPtrFieldsNil(obj interface{}) bool + func ApplyRLimitForSelf(maxOpenFiles uint64) — linux/amd64 + func ApplyRLimitForSelf(maxOpenFiles uint64) error — darwin/amd64, js/wasm, windows/amd64 + func CertPoolFromFile(filename string) (*x509.CertPool, error) + func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error) + func ChooseHostInterface() (net.IP, error) + func CompileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) + func DeadlockWatchdog(lock Lockable, name string, maxLockPeriod time.Duration) + func DeadlockWatchdogReadLock(lock *sync.RWMutex, name string, maxLockPeriod time.Duration) + func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) + func EncodePrivateKey(private *rsa.PrivateKey) []byte + func EncodePublicKey(public *rsa.PublicKey) ([]byte, error) + func EncodeSSHKey(public *rsa.PublicKey) ([]byte, error) + func EscapeQualifiedNameForDisk(in string) string + func ExecuteTemplate(w io.Writer, templateText string, data interface{}) error + func ExecuteTemplateToString(templateText string, data interface{}) (string, error) + func FileExists(filename string) (bool, error) + func FlushLogs() + func Forever(f func(), period time.Duration) + func GenerateKey(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error) + func GenerateSelfSignedCert(host, certPath, keyPath string, alternateIPs []net.IP, alternateDNS []string) error + func GetClient(req *http.Request) string + func GetIntOrPercentValue(intStr *IntOrString) (int, bool, error) + func GetValueFromPercent(percent int, value int) int + func HandleCrash(additionalHandlers ...func(interface{})) + func HandleError(err error) + func InitFlags() + func InitLogs() + func IsProbableEOF(err error) bool + func JoinQualifiedName(namespace, name string) string + func JoinSchemeNamePort(scheme, name, port string) string + func MakePrivateKeySignerFromBytes(buffer []byte) (ssh.Signer, error) + func MakePrivateKeySignerFromFile(key string) (ssh.Signer, error) + func NewLogger(prefix string) *log.Logger + func NewUUID() types.UID + func ObjectDiff(a, b interface{}) string + func ObjectGoPrintDiff(a, b interface{}) string + func ObjectGoPrintSideBySide(a, b interface{}) string + func ParsePublicKeyFromFile(keyFile string) (*rsa.PublicKey, error) + func ReadDirNoExit(dirname string) ([]os.FileInfo, []error, error) + func RunInResourceContainer(containerName string) error + func RunSSHCommand(cmd, user, host string, signer ssh.Signer) (string, string, int, error) + func SetTransportDefaults(t *http.Transport) *http.Transport + func ShortenString(str string, n int) string + func SplitQualifiedName(str string) (string, string) + func SplitSchemeNamePort(id string) (scheme, name, port string, valid bool) + func StringDiff(a, b string) string + func TLSClientConfig(transport http.RoundTripper) (*tls.Config, error) + func Umask(mask int) (old int, err error) + func UnescapeQualifiedNameForDisk(in string) string + func Until(f func(), period time.Duration, stopCh <-chan struct{}) + func UsingSystemdInitSystem() bool + func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName + func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName + type AtomicValue struct + func (at *AtomicValue) Load() interface{} + func (at *AtomicValue) Store(val interface{}) + type Backoff struct + Clock Clock + func NewBackOff(initial, max time.Duration) *Backoff + func (p *Backoff) GC() + func (p *Backoff) Get(id string) time.Duration + func (p *Backoff) IsInBackOffSince(id string, eventTime time.Time) bool + func (p *Backoff) Next(id string, eventTime time.Time) + type BoolFlag struct + func (f *BoolFlag) Default(value bool) + func (f *BoolFlag) Set(value string) error + func (f *BoolFlag) Type() string + func (f BoolFlag) Provided() bool + func (f BoolFlag) String() string + func (f BoolFlag) Value() bool + type Cache []*cacheShard + func NewCache(maxSize int) Cache + func (c *Cache) Add(index uint64, obj interface{}) bool + func (c *Cache) Get(index uint64) (obj interface{}, found bool) + type Clock interface + Now func() time.Time + Since func(time.Time) time.Duration + type ConfigurationMap map[string]string + func (*ConfigurationMap) Type() string + func (m *ConfigurationMap) Set(value string) error + func (m *ConfigurationMap) String() string + type DialFunc func(net, addr string) (net.Conn, error) + func Dialer(transport http.RoundTripper) (DialFunc, error) + type FakeClock struct + Time time.Time + func (f *FakeClock) Now() time.Time + func (f *FakeClock) Since(ts time.Time) time.Duration + func (f *FakeClock) Step(d time.Duration) + type FakeHandler struct + RequestBody string + RequestReceived *http.Request + ResponseBody string + StatusCode int + T LogInterface + func (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) + func (f *FakeHandler) ValidateRequest(t TestInterface, expectedPath, expectedMethod string, body *string) + func (f *FakeHandler) ValidateRequestCount(t TestInterface, count int) bool + type GlogWriter struct + func (writer GlogWriter) Write(data []byte) (n int, err error) + type HighWaterMark int64 + func (hwm *HighWaterMark) Check(current int64) bool + type IntOrString struct + IntVal int + Kind IntstrKind + StrVal string + func NewIntOrStringFromInt(val int) IntOrString + func NewIntOrStringFromString(val string) IntOrString + func (intstr *IntOrString) Fuzz(c fuzz.Continue) + func (intstr *IntOrString) String() string + func (intstr *IntOrString) UnmarshalJSON(value []byte) error + func (intstr IntOrString) MarshalJSON() ([]byte, error) + type IntstrKind int + const IntstrInt + const IntstrString + type LineDelimiter struct + func NewLineDelimiter(output io.Writer, delimiter string) *LineDelimiter + func (ld *LineDelimiter) Flush() (err error) + func (ld *LineDelimiter) Write(buf []byte) (n int, err error) + type Lockable interface + Lock func() + Unlock func() + type LogInterface interface + Logf func(format string, args ...interface{}) + type PortRange struct + Base int + Size int + func ParsePortRange(value string) (*PortRange, error) + func (*PortRange) Type() string + func (pr *PortRange) Contains(p int) bool + func (pr *PortRange) Set(value string) error + func (pr PortRange) String() string + type RateLimiter interface + Accept func() + CanAccept func() bool + Stop func() + func NewFakeRateLimiter() RateLimiter + func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter + type RealClock struct + func (r RealClock) Now() time.Time + func (r RealClock) Since(ts time.Time) time.Duration + type RoundTripperWrapper interface + WrappedRoundTripper func() http.RoundTripper + type Route struct + Destination net.IP + Gateway net.IP + Interface string + type Runner struct + func NewRunner(f ...func(stop chan struct{})) *Runner + func (r *Runner) Start() + func (r *Runner) Stop() + type SSHTunnel struct + Config *ssh.ClientConfig + Host string + SSHPort string + func NewSSHTunnel(user, keyfile, host string) (*SSHTunnel, error) + func NewSSHTunnelFromBytes(user string, privateKey []byte, host string) (*SSHTunnel, error) + func (s *SSHTunnel) Close() error + func (s *SSHTunnel) Dial(network, address string) (net.Conn, error) + func (s *SSHTunnel) Open() error + type SSHTunnelEntry struct + Address string + Tunnel *SSHTunnel + type SSHTunnelList struct + func MakeSSHTunnels(user, keyfile string, addresses []string) *SSHTunnelList + func (l *SSHTunnelList) Close() + func (l *SSHTunnelList) Has(addr string) bool + func (l *SSHTunnelList) Len() int + func (l *SSHTunnelList) Open() error + func (l *SSHTunnelList) PickRandomTunnel() (SSHTunnelEntry, error) + type StringFlag struct + func NewStringFlag(defaultVal string) StringFlag + func (f *StringFlag) Default(value string) + func (f *StringFlag) Set(value string) error + func (f *StringFlag) Type() string + func (f StringFlag) Provided() bool + func (f StringFlag) String() string + func (f StringFlag) Value() string + type TestInterface interface + Errorf func(format string, args ...interface{}) + Logf func(format string, args ...interface{}) + type Trace struct + func NewTrace(name string) *Trace + func (t *Trace) Log() + func (t *Trace) LogIfLong(threshold time.Duration) + func (t *Trace) Step(msg string) + func (t *Trace) TotalTime() time.Duration