Documentation ¶
Index ¶
- func ExpBackoff(last time.Duration, max time.Duration) (next time.Duration)
- func NewThreadsafeSet(values ...string) *tsafeSet
- func NewUnsafeSet(values ...string) *unsafeSet
- func ParseFilepath(path string) string
- func TrimToDashes(args []string) []string
- type Clock
- type Event
- type EventStream
- type FakeClock
- type LoggingHTTPTransport
- type PeriodicReconciler
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpBackoff ¶ added in v0.5.3
func NewThreadsafeSet ¶ added in v0.6.0
func NewThreadsafeSet(values ...string) *tsafeSet
func NewUnsafeSet ¶ added in v0.6.0
func NewUnsafeSet(values ...string) *unsafeSet
func ParseFilepath ¶
ParseFilepath expands ~ and ~user constructions. If user or $HOME is unknown, do nothing.
func TrimToDashes ¶ added in v0.3.0
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 Clock ¶ added in v0.8.1
Clock provides an interface that packages can use instead of directly using the time module, so that chronology-related behavior can be tested
func NewFakeClock ¶ added in v0.8.1
func NewFakeClock() Clock
NewFakeClock returns a Clock which can be manually ticked through time for testing.
func NewRealClock ¶ added in v0.8.1
func NewRealClock() Clock
NewRealClock returns a Clock which simply delegates calls to the actual time package; it should be used by packages in production.
type EventStream ¶ added in v0.8.0
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 FakeClock ¶ added in v0.8.1
type FakeClock struct {
// contains filtered or unexported fields
}
func (*FakeClock) After ¶ added in v0.8.1
After mimics time.After; it waits for the given duration to elapse on the FakeClock, then sends the current time on the returned channel.
func (*FakeClock) Sleep ¶ added in v0.8.1
Sleep blocks until the given duration has passed on the FakeClock
type LoggingHTTPTransport ¶ added in v0.7.0
type PeriodicReconciler ¶ added in v0.8.0
type PeriodicReconciler interface {
Run(stop chan bool)
}
func NewPeriodicReconciler ¶ added in v0.8.0
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()