Documentation
¶
Index ¶
- func CallFactory(items ...FactoryType) ([]interface{}, error)
- func ExponentialBackoff(retries int, total time.Duration) ([]time.Duration, error)
- func FormatMetricName(str string) string
- func GetLocalIPv4() string
- func IsCanceledError(err error) bool
- func LifecycleStart(logger core.Logger, instances ...interface{}) error
- func LifecycleStop(logger core.Logger, instances ...interface{})
- func NewUUID() uuid.UUID
- func SetDefaultBreaker(dest *core.Breaker, defaultValue core.Breaker)
- func SetDefaultDuration(dest *time.Duration, defaultValue time.Duration)
- func SetDefaultInt(dest *int, defaultValue int)
- func SetDefaultRetrier(dest *core.Retrier, defaultValue core.Retrier)
- func SetDefaultString(dest *string, defaultValue string)
- func SetDefaultUint64(dest *uint64, defaultValue uint64)
- func Validate(instance interface{}) string
- type DelayEvent
- type FactoryType
- type SegmentHeap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallFactory ¶
func CallFactory(items ...FactoryType) ([]interface{}, error)
CallFactory invokes the list of factories and returns the obtained instances
func ExponentialBackoff ¶
ExponentialBackoff computes the exponential backoff intervals summing to provided total duration
func FormatMetricName ¶
FormatMetricName returns the metric name with reserved chars removed
func GetLocalIPv4 ¶
func GetLocalIPv4() string
GetLocalIPv4 will return this hosts IPv4 address. It will not return the loopback address and it will panic if no address is found.
func IsCanceledError ¶
IsCanceledError returns true if the provided value is a cancellation error
func LifecycleStart ¶
LifecycleStart executes startup procedure
func LifecycleStop ¶
LifecycleStop executes shutdown procedure
func SetDefaultBreaker ¶
SetDefaultBreaker sets the default value for provided location
func SetDefaultDuration ¶
SetDefaultDuration sets the default value for provided location
func SetDefaultInt ¶
SetDefaultInt sets the default value for provided location
func SetDefaultRetrier ¶
SetDefaultRetrier sets the default value for provided location
func SetDefaultString ¶
SetDefaultString sets the default value for provided location
func SetDefaultUint64 ¶
SetDefaultUint64 sets the default value for provided location
Types ¶
type DelayEvent ¶
DelayEvent is a helper Kafka event used during tests
func (DelayEvent) String ¶
func (d DelayEvent) String() string
type FactoryType ¶
FactoryType could have been avoided if Go had generics
type SegmentHeap ¶
type SegmentHeap binaryheap.Heap
SegmentHeap is the heap of segments ordered by offset
func NewSegmentHeap ¶
func NewSegmentHeap() *SegmentHeap
NewSegmentHeap returns a new SegmentHeap instance
func (*SegmentHeap) Empty ¶
func (h *SegmentHeap) Empty() bool
Empty returns true if heap does not contain any segments.
func (*SegmentHeap) Peek ¶
func (h *SegmentHeap) Peek() *core.SegmentInfo
Peek returns top segment without removing it, or nil if heap is empty.
func (*SegmentHeap) Pop ¶
func (h *SegmentHeap) Pop() core.SegmentInfo
Pop removes top segment and returns it. It panics if the heap is empty.
func (*SegmentHeap) Push ¶
func (h *SegmentHeap) Push(segment core.SegmentInfo)
Push adds a segment to the heap
func (*SegmentHeap) Size ¶
func (h *SegmentHeap) Size() int
Size returns number of segments in the heap.