Documentation ¶
Index ¶
- type FakeTagger
- func (f *FakeTagger) AccumulateTagsFor(entity string, cardinality collectors.TagCardinality, tb tagset.TagAccumulator) error
- func (f *FakeTagger) GetEntity(entityID string) (*types.Entity, error)
- func (f *FakeTagger) Init() error
- func (f *FakeTagger) List(cardinality collectors.TagCardinality) response.TaggerListResponse
- func (f *FakeTagger) SetError(entity string, cardinality collectors.TagCardinality, err error)
- func (f *FakeTagger) SetTags(entity, source string, low, orch, high, std []string)
- func (f *FakeTagger) SetTagsFromInfo(tags []*collectors.TagInfo)
- func (f *FakeTagger) Standard(entity string) ([]string, error)
- func (f *FakeTagger) Stop() error
- func (f *FakeTagger) Subscribe(cardinality collectors.TagCardinality) chan []types.EntityEvent
- func (f *FakeTagger) Tag(entity string, cardinality collectors.TagCardinality) ([]string, error)
- func (f *FakeTagger) Unsubscribe(ch chan []types.EntityEvent)
- type Tagger
- func (t *Tagger) AccumulateTagsFor(entity string, cardinality collectors.TagCardinality, tb tagset.TagAccumulator) error
- func (t *Tagger) GetEntity(entityID string) (*types.Entity, error)
- func (t *Tagger) Init() error
- func (t *Tagger) List(cardinality collectors.TagCardinality) response.TaggerListResponse
- func (t *Tagger) Standard(entity string) ([]string, error)
- func (t *Tagger) Stop() error
- func (t *Tagger) Subscribe(cardinality collectors.TagCardinality) chan []types.EntityEvent
- func (t *Tagger) Tag(entity string, cardinality collectors.TagCardinality) ([]string, 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 FakeTagger ¶
FakeTagger implements the Tagger interface
func (*FakeTagger) AccumulateTagsFor ¶
func (f *FakeTagger) AccumulateTagsFor(entity string, cardinality collectors.TagCardinality, tb tagset.TagAccumulator) error
AccumulateTagsFor fake implementation
func (*FakeTagger) GetEntity ¶
func (f *FakeTagger) GetEntity(entityID string) (*types.Entity, error)
GetEntity returns faked entity corresponding to the specified id and an error
func (*FakeTagger) List ¶
func (f *FakeTagger) List(cardinality collectors.TagCardinality) response.TaggerListResponse
List fake implementation
func (*FakeTagger) SetError ¶
func (f *FakeTagger) SetError(entity string, cardinality collectors.TagCardinality, err error)
SetError allows to set an error to be returned when `Tag` or `AccumulateTagsFor` is called for this entity and cardinality
func (*FakeTagger) SetTags ¶
func (f *FakeTagger) SetTags(entity, source string, low, orch, high, std []string)
SetTags allows to set tags in store for a given source, entity
func (*FakeTagger) SetTagsFromInfo ¶
func (f *FakeTagger) SetTagsFromInfo(tags []*collectors.TagInfo)
SetTagsFromInfo allows to set tags from list of TagInfo
func (*FakeTagger) Standard ¶
func (f *FakeTagger) Standard(entity string) ([]string, error)
Standard fake implementation
func (*FakeTagger) Subscribe ¶
func (f *FakeTagger) Subscribe(cardinality collectors.TagCardinality) chan []types.EntityEvent
Subscribe fake implementation
func (*FakeTagger) Tag ¶
func (f *FakeTagger) Tag(entity string, cardinality collectors.TagCardinality) ([]string, error)
Tag fake implementation
func (*FakeTagger) Unsubscribe ¶
func (f *FakeTagger) Unsubscribe(ch chan []types.EntityEvent)
Unsubscribe fake implementation
type Tagger ¶
Tagger is the entry class for entity tagging. It holds collectors, memory store and handles the query logic. One can use the package methods to use the default Tagger instead of instantiating one.
func NewTagger ¶
func NewTagger(catalog collectors.Catalog) *Tagger
NewTagger returns an allocated tagger. You still have to run Init() once the config package is ready. You are probably looking for tagger.Tag() using the global instance instead of creating your own.
func (*Tagger) AccumulateTagsFor ¶
func (t *Tagger) AccumulateTagsFor(entity string, cardinality collectors.TagCardinality, tb tagset.TagAccumulator) error
AccumulateTagsFor appends tags for a given entity from the tagger to the TagAccumulator
func (*Tagger) GetEntity ¶
GetEntity returns the entity corresponding to the specified id and an error
func (*Tagger) Init ¶
Init goes through a catalog and tries to detect which are relevant for this host. It then starts the collection logic and is ready for requests.
func (*Tagger) List ¶
func (t *Tagger) List(cardinality collectors.TagCardinality) response.TaggerListResponse
List the content of the tagger
func (*Tagger) Standard ¶
Standard returns standard tags for a given entity It triggers a tagger fetch if the no tags are found
func (*Tagger) Subscribe ¶
func (t *Tagger) Subscribe(cardinality collectors.TagCardinality) chan []types.EntityEvent
Subscribe returns a channel that receives a slice of events whenever an entity is added, modified or deleted. It can send an initial burst of events only to the new subscriber, without notifying all of the others.
func (*Tagger) Tag ¶
func (t *Tagger) Tag(entity string, cardinality collectors.TagCardinality) ([]string, error)
Tag returns a copy of the tags for a given entity
func (*Tagger) Unsubscribe ¶
func (t *Tagger) Unsubscribe(ch chan []types.EntityEvent)
Unsubscribe ends a subscription to entity events and closes its channel.