identitymanager

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package identitymanager tracks which global identities are being used by the currently running cilium-agent

Index

Constants

This section is empty.

Variables

View Source
var (
	// GlobalIdentityManager is a singleton instance of an IdentityManager, used
	// for easy updating / tracking lifecycles of identities on the local node
	// without having to pass around a specific instance of an IdentityManager
	// throughout Cilium.
	GlobalIdentityManager = NewIdentityManager()
)

Functions

func Add

func Add(identity *identity.Identity)

Add inserts the identity into the GlobalIdentityManager.

func GetIdentityModels

func GetIdentityModels() []*models.IdentityEndpoints

GetIdentityModels returns the API model of all identities in the GlobalIdentityManager.

func Remove

func Remove(identity *identity.Identity)

Remove deletes the identity from the GlobalIdentityManager.

func RemoveOldAddNew

func RemoveOldAddNew(old, new *identity.Identity)

RemoveOldAddNew removes old from and inserts new into the GlobalIdentityManager.

func Subscribe

func Subscribe(o Observer)

Subscribe adds the specified Observer to the global identity manager, to be notified upon changes to local identity usage.

Types

type IdentitiesModel

type IdentitiesModel []*models.IdentityEndpoints

IdentitiesModel is a wrapper so that we can implement the sort.Interface to sort the slice by ID

func (IdentitiesModel) Less

func (s IdentitiesModel) Less(i, j int) bool

Less returns true if the element in index `i` is lower than the element in index `j`

type