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) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(c2 config.Config) bool
- func (c *Config) GetConfigID() string
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() 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) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Controller
- type Factory
- func (t *Factory) Construct(ctx context.Context, conf config.Config, opts controller.ConstructOpts) (controller.Controller, error)
- func (t *Factory) ConstructConfig() config.Config
- func (t *Factory) GetConfigID() string
- func (t *Factory) GetControllerID() string
- func (t *Factory) GetVersion() semver.Version
- 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 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) CloneMessageVT ¶ added in v0.15.6
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶ added in v0.15.6
func (*Config) EqualsConfig ¶
EqualsConfig checks equality between two configs.
func (*Config) GetConfigID ¶
GetConfigID returns the config identifier.
func (*Config) MarshalJSON ¶ added in v0.29.0
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶ added in v0.29.0
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶ added in v0.29.2
func (*Config) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶ added in v0.29.0
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶ added in v0.29.0
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
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( ctx context.Context, 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 controller goroutine. 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 unexpected 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.