pkg

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpBackoff

func ExpBackoff(last time.Duration, max time.Duration) (next time.Duration)

func ListDirectory

func ListDirectory(dir string, filterFunc func(string) bool) ([]string, error)

ListDirectory generates a slice of all the file names that both exist in the provided directory and pass the filter. The returned file names are relative to the directory argument. filterFunc is called once for each file found in the directory. If filterFunc returns true, the given file will ignored.

func NewThreadsafeSet

func NewThreadsafeSet(values ...string) *tsafeSet

func NewUnsafeSet

func NewUnsafeSet(values ...string) *unsafeSet

func ParseFilepath

func ParseFilepath(path string) string

ParseFilepath expands ~ and ~user constructions. If user or $HOME is unknown, do nothing.

func ReadTLSConfigFiles

func ReadTLSConfigFiles(cafile, certfile, keyfile string) (cfg *tls.Config, err error)

func TrimToDashes

func TrimToDashes(args []string) []string

TrimToDashes takes a slice of strings (e.g. a command line) and returns everything after the first double dash (--), if any are present

Types

type Event

type Event string

type EventStream

type EventStream interface {
	Next(stop chan struct{}) chan Event
}

EventStream generates a channel which will emit an event as soon as one of interest occurs. Any background operation associated with the channel should be terminated when stop is closed.

type LoggingHTTPTransport

type LoggingHTTPTransport struct {
	http.Transport
}

func (*LoggingHTTPTransport) RoundTrip

func (lt *LoggingHTTPTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

type PeriodicReconciler

type PeriodicReconciler interface {
	Run(stop chan bool)
}

func NewPeriodicReconciler

func NewPeriodicReconciler(interval time.Duration, recFunc func(), eStream EventStream) PeriodicReconciler

NewPeriodicReconciler creates a PeriodicReconciler that will run recFunc at least every ival, or in response to anything emitted from EventStream.Next()

type Set

type Set interface {
	Add(string)
	Remove(string)
	Contains(string) bool
	Equals(Set) bool
	Length() int
	Values() []string
	Copy() Set
	Sub(Set) Set
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL