Documentation ¶
Overview ¶
Package util provides general utility functions for the CT personality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedBackendResolver ¶
type FixedBackendResolver struct{}
FixedBackendResolver implements the naming.Resolver interface by just returning a fixedBackends object for the comma-separated names in the target.
type FixedTimeSource ¶
type FixedTimeSource struct {
// contains filtered or unexported fields
}
FixedTimeSource provides a fixed time for use in tests. It should not be used in production code.
func NewFixedTimeSource ¶
func NewFixedTimeSource(t time.Time) *FixedTimeSource
NewFixedTimeSource creates a FixedTimeSource instance
func (*FixedTimeSource) Now ¶
func (f *FixedTimeSource) Now() time.Time
Now returns the time value this instance contains
type SystemTimeSource ¶
type SystemTimeSource struct{}
SystemTimeSource provides the current system local time
func (SystemTimeSource) Now ¶
func (s SystemTimeSource) Now() time.Time
Now returns the true current local time.
type TimeSource ¶
type TimeSource interface { // Now returns the current time in real implementations or a suitable value in others Now() time.Time }
TimeSource can provide the current time, or be replaced by a mock in tests to return specific values.
Click to show internal directories.
Click to hide internal directories.