bifrost_entitygraph

package
v0.30.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 22 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 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) CloneMessageVT added in v0.15.6

func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Config) CloneVT added in v0.8.3

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT added in v0.15.6

func (this *Config) EqualMessageVT(thatMsg any) bool

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) MarshalJSON added in v0.29.0

func (x *Config) MarshalJSON() ([]byte, error)

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 (x *Config) MarshalProtoText() string

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) 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) UnmarshalJSON added in v0.29.0

func (x *Config) UnmarshalJSON(b []byte) error

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

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(
	ctx context.Context,
	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 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.

Jump to

Keyboard shortcuts

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