bifrost_entitygraph

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the identifier for the config type.

View Source
const ControllerID = "bifrost/entitygraph/reporter"

ControllerID is the ID of the controller.

View Source
const LinkEntityTypeName = "bifrost/link"

LinkEntityTypeName is the entitygraph type name for a Bifrost link

View Source
const PeerEntityTypeName = "bifrost/peer"

PeerEntityTypeName is the entitygraph type name for a Bifrost peer

View Source
const TransportAssocEntityTypeName = "bifrost/transport/assoc"

TransportAssocEntityTypeName is the entitygraph type name for a Bifrost transport

View Source
const TransportEntityTypeName = "bifrost/transport"

TransportEntityTypeName is the entitygraph type name for a Bifrost transport

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_github_com_aperturerobotics_bifrost_entitygraph_config_proto protoreflect.FileDescriptor
View Source
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

func NewLinkEntityRef(linkUUID uint64) entity.Ref

NewLinkEntityRef constructs a new entity ref to a link.

func NewPeerEntityRef

func NewPeerEntityRef(peerID peer.ID) entity.Ref

NewPeerEntityRef constructs a new entity ref to a node.

func NewReporter

func NewReporter(
	le *logrus.Entry,
	bus bus.Bus,
	store *store.Store,
) (reporter.Reporter, error)

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

func NewTransportEntityRef(transportID uint64) entity.Ref

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 (m *Config) CloneGenericVT() proto.Message

func (*Config) CloneVT added in v0.8.3

func (m *Config) CloneVT() *Config

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) EqualVT added in v0.3.0

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(c2 config.Config) bool

EqualsConfig checks equality between two configs.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the config identifier.

func (*Config) MarshalToSizedBufferVT added in v0.2.0

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT added in v0.2.0

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT added in v0.2.0

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect added in v0.2.0

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT added in v0.2.0

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalVT added in v0.2.0

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

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

func NewFactory(bus bus.Bus) *Factory

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

func (t *Factory) ConstructConfig() config.Config

ConstructConfig constructs an instance of the controller configuration.

func (*Factory) GetConfigID

func (t *Factory) GetConfigID() string

GetConfigID returns the configuration ID for the controller.

func (*Factory) GetControllerID

func (t *Factory) GetControllerID() string

GetControllerID returns the unique ID for the controller.

func (*Factory) GetVersion

func (t *Factory) GetVersion() semver.Version

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

func (c *Reporter) Execute(ctx context.Context) error

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.

Jump to

Keyboard shortcuts

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