# Packages
Package config provides utility objects for decoupling sources of configuration and the actual configuration state.
Package exec provides an injectable interface and implementations for running commands.
Package iptables provides an interface and implementations for running iptables commands.
TODO(thockin): This whole pkg is pretty linux-centric.
Package wait provides tools for polling or listening for changes to a condition.
# Functions
Tests whether all pointer fields in a struct are nil.
Writes 'value' to /proc/self/oom_score_adj.
Takes a list of strings and compiles them into a list of regular expressions.
No description provided by the author
Date returns the Time corresponding to the supplied parameters by wrapping time.Date.
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
FlushLogs flushes logs immediately.
Forever loops forever running f every period.
GenerateSelfSignedCert creates a self-signed certificate and key for the given host.
Get a docker endpoint, either from the string passed in, or $DOCKER_HOST environment variables.
No description provided by the author
HandleCrash simply catches a crash and logs an error.
InitLogs initializes logs the way we want for kubernetes.
IsCIdentifier tests for a string that conforms the definition of an identifier in C.
IsDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123).
IsDNS1123Subdomain tests for a string that conforms to the definition of a subdomain in DNS (RFC 1123).
IsDNS952Label tests for a string that conforms to the definition of a label in DNS (RFC 952).
IsDNSLabel tests for a string that conforms to the definition of a label in DNS (RFC 1123).
IsDNSSubdomain tests for a string that conforms to the definition of a subdomain in DNS (RFC 1123).
IsQualifiedName tests whether a string fits the "optionally-namespaced name" pattern: [ DNS_SUBDOMAIN "/" ] DNS_LABEL.
IsValidPortNum tests that the argument is a valid, non-zero port number.
NewIntOrStringFromInt creates an IntOrString object with an int value.
NewIntOrStringFromString creates an IntOrString object with a string value.
NewLogger creates a new log.Logger which sends logs to glog.Info.
NewRunner makes a runner for the given function(s).
NewStringSet creates a StringSet from a list of values.
NewTime returns a wrapped instance of the provided time.
NewTokenBucketRateLimiter creates a rate limiter which implements a token bucket approach.
*
* The UUID package is naive and can generate identical UUIDs if the time interval is quick enough.
Now returns the current local time.
ObjectDiff writes the two objects out as JSON and prints out the identical part of the objects followed by the remaining part of 'a' and finally the remaining part of 'b'.
ObjectGoPrintDiff is like ObjectDiff, but uses go-spew to print the objects, which shows absolutely everything by recursing into every single pointer (go's %#v formatters OTOH stop at a certain point).
ObjectGoPrintSideBySide prints a and b as textual dumps side by side, enabling easy visual scanning for mismatches.
SliceToError converts an []error into a "normal" error, or nil if the slice is empty.
StringDiff diffs a and b and returns a human readable diff.
Unix returns the local time corresponding to the given Unix time by wrapping time.Unix.
Until loops until stop channel is closed, running f every period.
# Variables
For testing, bypass HandleCrash.
# Structs
FakeClock implements Clock, but returns an arbitary time.
FakeHandler is to assist in testing HTTP requests.
GlogWriter serves as a bridge between the standard log package and the glog package.
IntOrString is a type that can hold an int or a string.
RealClock really calls time.Now().
Runner is an abstraction to make it easy to start and stop groups of things that can be described by a single function which waits on a channel close to exit.
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
# Interfaces
Clock allows for injecting fake or real clocks into code that needs to do arbitrary things based on time.
LogInterface is a simple interface to allow injection of Logf to report serving errors.
No description provided by the author
TestInterface is a simple interface providing Errorf, to make injection for testing easier (insert 'yo dawg' meme here).
No description provided by the author
# Type aliases
IntstrKind represents the stored type of IntOrString.
IP adapts net.IP for use as a flag.
IPNet adapts net.IPNet for use as a flag.
No description provided by the author
StringSet is a set of strings, implemented via map[string]struct{} for minimal memory consumption.