package
1.2.0-alpha.4
Repository: https://github.com/ericchiang/kubernetes.git
Documentation: pkg.go.dev
# Packages
Package bandwidth provides utilities for bandwidth shaping.
Package chown provides an interface and implementations for things that run run the chmod system call.
Package chown provides utilities to chown a path.
Package config provides utility objects for decoupling sources of configuration and the actual configuration state.
Package dbus provides an injectable interface and implementations for D-Bus communication.
No description provided by the author
Package errors implements various utility functions and types around errors.
Package exec provides an injectable interface and implementations for running commands.
Package flushwriter implements a wrapper for a writer that flushes on every write if that writer implements the io.Flusher interface.
Package httpstream adds multiplexed streaming support to HTTP requests and responses via connection upgrades.
No description provided by the author
No description provided by the author
Package iptables provides an interface and implementations for running iptables commands.
package jsonpath is a template engine using jsonpath syntax, which can be seen at http://goessner.net/articles/JsonPath/.
No description provided by the author
Package limitwriter provides a writer that only allows a certain number of bytes to be written.
TODO(thockin): This whole pkg is pretty linux-centric.
No description provided by the author
Package oom implements utility functions relating to out of memory management.
Package procfs implements utility functions relating to the /proc mount.
Package proxy provides transport and upgrade support for proxies.
Package rand provides utilities related to randomization.
Package selinux contains selinux utility functions.
Package sets has auto-generated set types.
Package slice provides utility methods for common operations on slices.
No description provided by the author
No description provided by the author
No description provided by the author
Package wait provides tools for polling or listening for changes to a condition.
Package workqueue provides a simple queue that supports the following features: * Fair: items processed in the order in which they are added.
Package wsstream contains utilities for streaming content over WebSockets.
No description provided by the author
# Functions
Tests whether all pointer fields in a struct are nil.
No description provided by the author
CertPoolFromFile returns an x509.CertPool containing the certificates in the given PEM-encoded file.
CertsFromPEM returns the x509.Certificates contained in the given PEM-encoded byte array Returns an error if a certificate could not be parsed, or if the data does not contain any certificates.
ChooseHostInterface is a method used fetch an IP for a daemon.It uses data from /proc/net/route file.For a node with no internet connection ,it returns errorFor a multi n/w interface node it returns the IP of the interface with gateway on it.
Takes a list of strings and compiles them into a list of regular expressions.
No description provided by the author
DeadlockWatchdogReadLock creates a watchdog on read/write mutex.
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.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EscapeQualifiedNameForDisk converts a plugin name, which might contain a / into a string that is safe to use on-disk.
ExecuteTemplate executes templateText with data and output written to w.
No description provided by the author
No description provided by the author
FlushLogs flushes logs immediately.
Forever is syntactic sugar on top of Until.
No description provided by the author
GenerateSelfSignedCert creates a self-signed certificate and key for the given host.
No description provided by the author
No description provided by the author
No description provided by the author
HandleCrash simply catches a crash and logs an error.
HandlerError is a method to invoke when a non-user facing piece of code cannot return an error and needs to indicate it has been ignored.
InitFlags normalizes and parses the command line flags.
InitLogs initializes logs the way we want for kubernetes.
IsProbableEOF returns true if the given error resembles a connection termination scenario that would justify assuming that the watch is empty.
Joins 'namespace' and 'name' and returns a fully qualified name Assumes that the input is valid.
JoinSchemeNamePort returns a string that specifies the scheme, name, and port: * "<name>" * "<name>:<port>" * "<scheme>:<name>:<port>" None of the parameters may contain a ':' character Name is required Scheme must be "", "http", or "https".
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewCRLFWriter implements a CR/LF line ending writer used for normalizing text for Windows platforms.
No description provided by the author
NewLineDelimiter allocates a new io.Writer that will split input on lines and bracket each line with the delimiter string.
NewLogger creates a new log.Logger which sends logs to glog.Info.
NewRunner makes a runner for the given function(s).
No description provided by the author
No description provided by the author
No description provided by the author
NewTokenBucketRateLimiter creates a rate limiter which implements a token bucket approach.
No description provided by the author
*
* The UUID package is naive and can generate identical UUIDs if the time interval is quick enough.
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.
ParsePortRange parses a string of the form "min-max", inclusive at both ends, and initializs a new PortRange from it.
No description provided by the author
borrowed from ioutil.ReadDir ReadDir reads the directory named by dirname and returns a list of directory entries, minus those with lstat errors.
Creates resource-only containerName if it does not already exist and moves the current process to it.
RunSSHCommand returns the stdout, stderr, and exit code from running cmd on host as specific user, along with any SSH-level error.
SetTransportDefaults applies the defaults from http.DefaultTransport for the Proxy, Dial, and TLSHandshakeTimeout fields if unset.
No description provided by the author
Splits a fully qualified name and returns its namespace and name.
SplitSchemeNamePort takes a string of the following forms: * "<name>", returns "", "<name>","", true * "<name>:<port>", returns "", "<name>","<port>",true * "<scheme>:<name>:<port>", returns "<scheme>","<name>","<port>",true
Name must be non-empty or valid will be returned false.
StringDiff diffs a and b and returns a human readable diff.
No description provided by the author
No description provided by the author
UnescapeQualifiedNameForDisk converts an escaped plugin name (as per EscapeQualifiedNameForDisk) back to its normal form.
Until loops until stop channel is closed, running f every period.
Detects if using systemd as the init system Please note that simply reading /proc/1/cmdline can be misleading because some installation of various init programs can automatically make /sbin/init a symlink or even a renamed version of their main program.
WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators.
WordSepNormalizeFunc changes all flags that contain "_" separators.
# Variables
ErrorHandlers is a list of functions which will be invoked when an unreturnable error occurs.
For any test of the style: ..
NeverStop may be passed to Until to make it never stop.
PanicHandlers is a list of functions which will be invoked when a panic happens.
For testing, bypass HandleCrash.
# Structs
TODO(ArtfulCoder) sync/atomic/Value was added in golang 1.4 Once support is dropped for go 1.3, this type must be deprecated in favor of sync/atomic/Value.
No description provided by the author
BoolFlag is a boolean flag compatible with flags and pflags that keeps track of whether it had a value supplied or not.
FakeClock implements Clock, but returns an arbitrary time.
FakeHandler is to assist in testing HTTP requests.
GlogWriter serves as a bridge between the standard log package and the glog package.
IntervalClock implements Clock, but each invocation of Now steps the clock forward the specified duration.
A Line Delimiter is a filter that will.
PortRange represents a range of TCP/UDP ports.
RealClock really calls time.Now().
No description provided by the author
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.
TODO: Unit tests for this code, we can spin up a test SSH server with instructions here: https://godoc.org/golang.org/x/crypto/ssh#ServerConn.
Should be thread safe.
Not thread safe!.
StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not.
No description provided by the author
# 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
No description provided by the author
TestInterface is a simple interface providing Errorf, to make injection for testing easier (insert 'yo dawg' meme here).
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
HighWaterMark is a thread-safe object for tracking the maximum value seen for some quantity.