Documentation ¶
Index ¶
- type Tagger
- func (t *Tagger) Init() error
- func (t *Tagger) List(cardinality collectors.TagCardinality) response.TaggerListResponse
- func (t *Tagger) Standard(entityID string) ([]string, error)
- func (t *Tagger) Stop() error
- func (t *Tagger) Subscribe(cardinality collectors.TagCardinality) chan []types.EntityEvent
- func (t *Tagger) Tag(entityID string, cardinality collectors.TagCardinality) ([]string, error)
- func (t *Tagger) TagBuilder(entityID string, cardinality collectors.TagCardinality, tb *util.TagsBuilder) error
- func (t *Tagger) Unsubscribe(ch chan []types.EntityEvent)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tagger ¶
type Tagger struct {
// contains filtered or unexported fields
}
Tagger holds a connection to a remote tagger, processes incoming events from it, and manages the storage of entities to allow querying.
func NewTagger ¶
func NewTagger() *Tagger
NewTagger returns an allocated tagger. You still have to run Init() once the config package is ready.
func (*Tagger) Init ¶
Init initializes the connection to the remote tagger and starts watching for events.
func (*Tagger) List ¶
func (t *Tagger) List(cardinality collectors.TagCardinality) response.TaggerListResponse
List returns all the entities currently stored by the tagger.
func (*Tagger) Subscribe ¶
func (t *Tagger) Subscribe(cardinality collectors.TagCardinality) chan []types.EntityEvent
Subscribe returns a list of existing entities in the store, alongside a channel that receives events whenever an entity is added, modified or deleted.
func (*Tagger) Tag ¶
func (t *Tagger) Tag(entityID string, cardinality collectors.TagCardinality) ([]string, error)
Tag returns tags for a given entity at the desired cardinality.
func (*Tagger) TagBuilder ¶
func (t *Tagger) TagBuilder(entityID string, cardinality collectors.TagCardinality, tb *util.TagsBuilder) error
TagBuilder returns tags for a given entity at the desired cardinality.
func (*Tagger) Unsubscribe ¶
func (t *Tagger) Unsubscribe(ch chan []types.EntityEvent)
Unsubscribe ends a subscription to entity events and closes its channel.