tagindex

package
v2.0.0-beta-rc1+incomp... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointKeyToProfileIDMap

type EndpointKeyToProfileIDMap struct {
	// contains filtered or unexported fields
}

func NewEndpointKeyToProfileIDMap

func NewEndpointKeyToProfileIDMap() *EndpointKeyToProfileIDMap

func (EndpointKeyToProfileIDMap) Update

func (idx EndpointKeyToProfileIDMap) Update(key model.Key, profileIDs []string) (
	removedIDs, addedIDs map[string]bool)

type MatchCallback

type MatchCallback func(key model.Key, tagID string)

type TagIndex

type TagIndex struct {
	// contains filtered or unexported fields
}

A TagIndex dynamically calculates the matching tags for a set of endpoints. It generates events when endpoints start and stop matching "active" tags. Tags are marked active by calling the SetTagActive/SetTagInactive methods.

func NewIndex

func NewIndex(onMatchStarted, onMatchStopped MatchCallback) *TagIndex

func (*TagIndex) OnUpdate

func (idx *TagIndex) OnUpdate(update api.Update) (filterOut bool)

OnUpdate is called when a datamodel update is received. It updates the index and fires the match-started/stopped callbacks as appropriate.

func (*TagIndex) RegisterWith

func (idx *TagIndex) RegisterWith(dispatcher *dispatcher.Dispatcher)

func (*TagIndex) SetTagActive

func (idx *TagIndex) SetTagActive(tag string)

SetTagActive marks the given tag as active if it isn't already. If the tag becomes active and it matches endpoints, synchronously invokes the match-started callback for each matching endpoint.

func (*TagIndex) SetTagInactive

func (idx *TagIndex) SetTagInactive(tag string)

SetTagInactive marks the given tag as inactive if it isn't already. If the tag becomes inactive and it matches endpoints, synchronously invokes the match-stopped callback for each matching endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL