Documentation ¶
Index ¶
- Constants
- Variables
- func GetControllerInfo() *controller.Info
- func NewLinkEntityRef(linkUUID uint64) entity.Ref
- func NewPeerEntityRef(peerID peer.ID) entity.Ref
- func NewReporter(le *logrus.Entry, bus bus.Bus, store *store.Store) (reporter.Reporter, error)
- func NewTransportEntity(tptUUID uint64, peerID peer.ID) (*TransportEntity, *TransportAssocEntity)
- func NewTransportEntityRef(transportID uint64) entity.Ref
- type Config
- func (m *Config) CloneGenericVT() proto.Message
- func (m *Config) CloneVT() *Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(c2 config.Config) bool
- func (c *Config) GetConfigID() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Controller
- type Factory
- type LinkEntity
- type PeerEntity
- type Reporter
- type TransportAssocEntity
- type TransportEntity
Constants ¶
const ConfigID = ControllerID
ConfigID is the identifier for the config type.
const ControllerID = "bifrost/entitygraph/reporter"
ControllerID is the ID of the controller.
const LinkEntityTypeName = "bifrost/link"
LinkEntityTypeName is the entitygraph type name for a Bifrost link
const PeerEntityTypeName = "bifrost/peer"
PeerEntityTypeName is the entitygraph type name for a Bifrost peer
const TransportAssocEntityTypeName = "bifrost/transport/assoc"
TransportAssocEntityTypeName is the entitygraph type name for a Bifrost transport
const TransportEntityTypeName = "bifrost/transport"
TransportEntityTypeName is the entitygraph type name for a Bifrost transport
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var File_github_com_aperturerobotics_bifrost_entitygraph_config_proto protoreflect.FileDescriptor
var Version = semver.MustParse("0.0.1")
Version is the version of the controller implementation.
Functions ¶
func GetControllerInfo ¶
func GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func NewLinkEntityRef ¶
NewLinkEntityRef constructs a new entity ref to a link.
func NewPeerEntityRef ¶
NewPeerEntityRef constructs a new entity ref to a node.
func NewReporter ¶
NewReporter constructs a new Bifrost entitygraph reporter. emits two node Entity objects per EstablishLink interest (node objects) emits one Entity<Link> object per EstablishLink interest (not value, just interest) emits one Entity<Link> object per known Link yielded by EstablishLink emits one Transport object per known remote transport (from Link objects) emits one Transport object per known local transport (from LookupTransport directives)
func NewTransportEntity ¶
func NewTransportEntity(tptUUID uint64, peerID peer.ID) (*TransportEntity, *TransportAssocEntity)
NewTransportEntity constructs a new TransportEntity and TransportAssocEntity.
func NewTransportEntityRef ¶
NewTransportEntityRef constructs a new entity ref to a transport.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the config object for the entitygraph repoter.
func (*Config) CloneGenericVT ¶ added in v0.8.3
func (*Config) Descriptor
deprecated
func (*Config) EqualsConfig ¶
EqualsConfig checks equality between two configs.
func (*Config) GetConfigID ¶
GetConfigID returns the config identifier.
func (*Config) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v0.2.0
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) UnmarshalVT ¶ added in v0.2.0
type Controller ¶
type Controller = reporter.Controller
Controller manages exposing Bifrost resources to the Entity Graph. It handles CollectEntityGraph directives.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a EntityGraph reporter controller.
func NewFactory ¶
NewFactory builds a entitygraph controller factory.
func (*Factory) Construct ¶
func (t *Factory) Construct( conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the configuration ID for the controller.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
GetVersion returns the version of this controller.
type LinkEntity ¶
type LinkEntity struct {
// contains filtered or unexported fields
}
LinkEntity is a entity implementation backed by a link.
func NewLinkEntity ¶
func NewLinkEntity(lnk link.Link) *LinkEntity
NewLinkEntity constructs a new LinkEntity
func (*LinkEntity) GetEdgeFrom ¶
func (l *LinkEntity) GetEdgeFrom() entity.Ref
GetEdgeFrom returns the reference to the entity this link starts at.
func (*LinkEntity) GetEdgeTo ¶
func (l *LinkEntity) GetEdgeTo() entity.Ref
GetEdgeTo returns the reference to the entity this link ends at.
func (*LinkEntity) GetEntityID ¶
func (l *LinkEntity) GetEntityID() string
GetEntityID returns the entity identifier.
func (*LinkEntity) GetEntityTypeName ¶
func (l *LinkEntity) GetEntityTypeName() string
GetEntityTypeName returns the entity type name.
type PeerEntity ¶
type PeerEntity struct {
// contains filtered or unexported fields
}
PeerEntity is a entity implementation backed by a node.
func NewPeerEntity ¶
func NewPeerEntity(peerID peer.ID) *PeerEntity
NewPeerEntity constructs a new PeerEntity.
func (*PeerEntity) GetEntityID ¶
func (e *PeerEntity) GetEntityID() string
GetEntityID returns the entity identifier.
func (*PeerEntity) GetEntityTypeName ¶
func (e *PeerEntity) GetEntityTypeName() string
GetEntityTypeName returns the entity type name.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter creates and handles directives, exposing entities to the graph. It handles EstablishLink directives to observe running and pending links.
func (*Reporter) Execute ¶
Execute executes the given controller. Returning nil ends execution. Returning an error triggers a retry with backoff.
func (*Reporter) HandleDirective ¶
func (c *Reporter) HandleDirective( ctx context.Context, di directive.Instance, ) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive. If it can, it returns a resolver. If not, returns nil. Any exceptional errors are returned for logging. It is safe to add a reference to the directive during this call.
type TransportAssocEntity ¶
type TransportAssocEntity struct {
// contains filtered or unexported fields
}
TransportAssocEntity is a entity implementation backed by a transport.
func (*TransportAssocEntity) GetEdgeFrom ¶
func (l *TransportAssocEntity) GetEdgeFrom() entity.Ref
GetEdgeFrom returns the reference to the entity this link starts at.
func (*TransportAssocEntity) GetEdgeTo ¶
func (l *TransportAssocEntity) GetEdgeTo() entity.Ref
GetEdgeTo returns the reference to the entity this link ends at.
func (*TransportAssocEntity) GetEntityID ¶
func (l *TransportAssocEntity) GetEntityID() string
GetEntityID returns the entity identifier.
func (*TransportAssocEntity) GetEntityTypeName ¶
func (l *TransportAssocEntity) GetEntityTypeName() string
GetEntityTypeName returns the entity type name.
type TransportEntity ¶
type TransportEntity struct {
// contains filtered or unexported fields
}
TransportEntity is a entity implementation backed by a transport.
func (*TransportEntity) GetEntityID ¶
func (l *TransportEntity) GetEntityID() string
GetEntityID returns the entity identifier.
func (*TransportEntity) GetEntityTypeName ¶
func (l *TransportEntity) GetEntityTypeName() string
GetEntityTypeName returns the entity type name.