Documentation ¶
Index ¶
- func Backoff(rfn func() error) error
- func ClearMap(m map[string]struct{})
- func Container(m map[string]string, k string) bool
- func GetBuf() *bytes.Buffer
- func Ipv4Family() *int64
- func IterMap(s *hashmap.Map, fn func(k, v interface{}) error)
- func PutBuf(b *bytes.Buffer)
- func Rand(n int) string
- func SetAddList(s *hashset.Set, l []string)
- func TimeBackoff(rfn func() error) error
- type CallbackFn
- type Event
- type Parameters
- type PrioList
- type Trigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ipv4Family ¶
func Ipv4Family() *int64
func SetAddList ¶
func TimeBackoff ¶
Types ¶
type CallbackFn ¶
type CallbackFn func(any)
type Parameters ¶
type Parameters struct { // MinInterval is the minimum required interval between invocations of // TriggerFunc MinInterval time.Duration // TriggerFunc is the function to be called when Trigger() is called // while respecting MinInterval and serialization TriggerFunc func() // ShutdownFunc is called when the trigger is shut down ShutdownFunc func() // Name is the unique name of the trigger. It must be provided in a // format compatible to be used as prometheus name string. Name string }
Parameters are the user specified parameters
type PrioList ¶
type PrioList struct { *binaryheap.Heap // contains filtered or unexported fields }
func NewPrioIntList ¶
func NewPrioIntList() *PrioList
func NewPrioStringList ¶
func NewPrioStringList() *PrioList
type Trigger ¶
type Trigger struct {
// contains filtered or unexported fields
}
Trigger represents an active trigger logic. Use NewTrigger() to create a trigger
func NewTrigger ¶
func NewTrigger(p Parameters) (*Trigger, error)
NewTrigger returns a new trigger based on the provided parameters
func (*Trigger) Trigger ¶
func (t *Trigger) Trigger()
Trigger triggers the call to TriggerFunc as specified in the parameters provided to NewTrigger(). It respects MinInterval and ensures that calls to TriggerFunc are serialized. This function is non-blocking and will return immediately before TriggerFunc is potentially triggered and has completed.
Click to show internal directories.
Click to hide internal directories.