Documentation ¶
Index ¶
- type AnyTailerContainer
- type Tailer
- type TailerContainer
- func (t *TailerContainer[T]) Add(tailer T)
- func (t *TailerContainer[T]) All() []T
- func (t *TailerContainer[T]) Contains(id string) bool
- func (t *TailerContainer[T]) Count() int
- func (t *TailerContainer[T]) Get(id string) (T, bool)
- func (t *TailerContainer[T]) Remove(tailer T)
- func (t *TailerContainer[T]) Tailers() []Tailer
- type TailerTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyTailerContainer ¶
type AnyTailerContainer interface {
Tailers() []Tailer
}
AnyTailerContainer is a type erased tailer container. This is used as a proxy for typed tailer containers to mix and match collections of tailers of any underlying type.
type Tailer ¶
type Tailer interface { GetId() string GetType() string GetInfo() *status.InfoRegistry }
Tailer is the base interface for a tailer.
type TailerContainer ¶
TailerContainer is a container for a concrete tailer type.
func NewTailerContainer ¶
func NewTailerContainer[T Tailer]() *TailerContainer[T]
NewTailerContainer creates a new TailerContainer instance.
func (*TailerContainer[T]) Add ¶
func (t *TailerContainer[T]) Add(tailer T)
Add adds a new tailer to the container.
func (*TailerContainer[T]) All ¶
func (t *TailerContainer[T]) All() []T
All returns a slice of all tailers in the container.
func (*TailerContainer[T]) Contains ¶
func (t *TailerContainer[T]) Contains(id string) bool
Contains returns true if the key exists.
func (*TailerContainer[T]) Count ¶
func (t *TailerContainer[T]) Count() int
Count returns the number of tailers in the container.
func (*TailerContainer[T]) Get ¶
func (t *TailerContainer[T]) Get(id string) (T, bool)
Get returns a tailer with the provided id if it exists.
func (*TailerContainer[T]) Remove ¶
func (t *TailerContainer[T]) Remove(tailer T)
Remove removes a tailer from the container.
func (*TailerContainer[T]) Tailers ¶
func (t *TailerContainer[T]) Tailers() []Tailer
Tailers returns a slice of all tailers in the container without their concrete types.
type TailerTracker ¶
TailerTracker keeps track of all the active tailers in the agent.
func NewTailerTracker ¶
func NewTailerTracker() *TailerTracker
NewTailerTracker creates a new TailerTracker instance.
func (*TailerTracker) Add ¶
func (t *TailerTracker) Add(container AnyTailerContainer)
Add a tailer container to the tracker.