Documentation ¶
Index ¶
- func Module() fx.Option
- func RegisterEntitiesService(server *grpc.Server, cache *Entities, registry *rpc.HandlerRegistry) error
- type Entities
- func (c *Entities) Clear()
- func (c *Entities) GetByIP(entityIP string) (*entitiesv1.Entity, error)
- func (c *Entities) GetByName(entityName string) (*entitiesv1.Entity, error)
- func (c *Entities) GetEntities() *entitiesv1.Entities
- func (c *Entities) Put(entity *entitiesv1.Entity)
- func (c *Entities) Remove(entity *entitiesv1.Entity) bool
- type EntitiesService
- func (c *EntitiesService) GetEntities(ctx context.Context, _ *emptypb.Empty) (*entitiesv1.Entities, error)
- func (c *EntitiesService) GetEntityByIPAddress(ctx context.Context, req *entitiesv1.GetEntityByIPAddressRequest) (*entitiesv1.Entity, error)
- func (c *EntitiesService) GetEntityByName(ctx context.Context, req *entitiesv1.GetEntityByNameRequest) (*entitiesv1.Entity, error)
- func (c *EntitiesService) ListDiscoveryEntities(ctx context.Context, _ *cmdv1.ListDiscoveryEntitiesRequest) (*cmdv1.ListDiscoveryEntitiesAgentResponse, error)
- func (c *EntitiesService) ListDiscoveryEntity(ctx context.Context, req *cmdv1.ListDiscoveryEntityRequest) (*cmdv1.ListDiscoveryEntityAgentResponse, error)
- type EntityTrackers
- type FxIn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterEntitiesService ¶
func RegisterEntitiesService(server *grpc.Server, cache *Entities, registry *rpc.HandlerRegistry) error
RegisterEntitiesService registers a service for entity cache.
Types ¶
type Entities ¶
Entities maps IP addresses and Entity names to entities.
func (*Entities) GetByIP ¶
func (c *Entities) GetByIP(entityIP string) (*entitiesv1.Entity, error)
GetByIP retrieves entity with a given IP address.
func (*Entities) GetByName ¶
func (c *Entities) GetByName(entityName string) (*entitiesv1.Entity, error)
GetByName retrieves entity with a given name.
func (*Entities) GetEntities ¶
func (c *Entities) GetEntities() *entitiesv1.Entities
GetEntities returns *entitiesv1.EntitiyCache entities.
func (*Entities) Put ¶
func (c *Entities) Put(entity *entitiesv1.Entity)
Put maps given IP address and name to the entity it currently represents.
type EntitiesService ¶
type EntitiesService struct { entitiesv1.UnimplementedEntitiesServiceServer // contains filtered or unexported fields }
EntitiesService is the implementation of entitiesv1.EntitiesService interface.
func (*EntitiesService) GetEntities ¶
func (c *EntitiesService) GetEntities(ctx context.Context, _ *emptypb.Empty) (*entitiesv1.Entities, error)
GetEntities returns *entitiesv1.Entities which contains mappings of ip address to entity and entity name to entity.
func (*EntitiesService) GetEntityByIPAddress ¶
func (c *EntitiesService) GetEntityByIPAddress(ctx context.Context, req *entitiesv1.GetEntityByIPAddressRequest) (*entitiesv1.Entity, error)
GetEntityByIPAddress returns an entity by IP address.
func (*EntitiesService) GetEntityByName ¶
func (c *EntitiesService) GetEntityByName(ctx context.Context, req *entitiesv1.GetEntityByNameRequest) (*entitiesv1.Entity, error)
GetEntityByName returns an entity by name.
func (*EntitiesService) ListDiscoveryEntities ¶ added in v0.27.0
func (c *EntitiesService) ListDiscoveryEntities(ctx context.Context, _ *cmdv1.ListDiscoveryEntitiesRequest) (*cmdv1.ListDiscoveryEntitiesAgentResponse, error)
ListDiscoveryEntities lists currently discovered entities by IP address.
func (*EntitiesService) ListDiscoveryEntity ¶ added in v0.27.0
func (c *EntitiesService) ListDiscoveryEntity(ctx context.Context, req *cmdv1.ListDiscoveryEntityRequest) (*cmdv1.ListDiscoveryEntityAgentResponse, error)
ListDiscoveryEntity returns an entity by IP address or name.
type EntityTrackers ¶
type EntityTrackers struct {
// contains filtered or unexported fields
}
EntityTrackers allows to register a service discovery for entity cache
Intended to be used during FX initialization.
func (*EntityTrackers) HasDiscovery ¶
func (et *EntityTrackers) HasDiscovery() bool
HasDiscovery returns whether RegisterServiceDiscovery was called before.
func (*EntityTrackers) RegisterServiceDiscovery ¶
func (et *EntityTrackers) RegisterServiceDiscovery(name string) notifiers.EventWriter
RegisterServiceDiscovery registers service discovery for entity cache and returns an EventWriter to push discovery events into.
Keys passed to EventWriter should not be prefixed.
Should be called at FX provide/invoke stage.
func (*EntityTrackers) Watcher ¶
func (et *EntityTrackers) Watcher() notifiers.Watcher
Watcher returns watcher that watches all events from registered service discoveries.