Documentation
¶
Index ¶
- Constants
- Variables
- func BuildConcurrentLookupConfig(notFoundBehavior lookup_concurrent.NotFoundBehavior) lookup.Config
- func BuildDefaultLookupConfig() lookup.Config
- 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(other config.Config) bool
- func (c *Config) GetConfigID() string
- func (x *Config) GetDefaultLookup() *proto.ControllerConfig
- func (x *Config) GetDisableDefaultLookup() bool
- func (x *Config) GetDisableLookup() bool
- 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
Constants ¶
const ConfigID = ControllerID
ConfigID is the identifier for the config type.
const ControllerID = "hydra/node"
ControllerID is the ID of the controller.
Variables ¶
var Version = semver.MustParse("0.0.1")
Version is the version of the controller implementation.
Functions ¶
func BuildConcurrentLookupConfig ¶
func BuildConcurrentLookupConfig(notFoundBehavior lookup_concurrent.NotFoundBehavior) lookup.Config
BuildConcurrentLookupConfig builds a new concurrent lookup config.
func BuildDefaultLookupConfig ¶
BuildDefaultLookupConfig builds a new default lookup config.
Types ¶
type Config ¶
type Config struct {
// DisableLookup disables lookup processing entirely.
DisableLookup bool `protobuf:"varint,1,opt,name=disable_lookup,json=disableLookup,proto3" json:"disableLookup,omitempty"`
// DisableDefaultLookup disables the default lookup controller.
// If a controller is defined in a bucket config this has no effect.
DisableDefaultLookup bool `protobuf:"varint,2,opt,name=disable_default_lookup,json=disableDefaultLookup,proto3" json:"disableDefaultLookup,omitempty"`
// DefaultLookup overrides the default lookup controller.
// If this is empty, uses the hard-coded default controller.
// If DisableDefaultLookup is set, this has no effect.
// If a controller is defined in a bucket config this has no effect.
DefaultLookup *proto.ControllerConfig `protobuf:"bytes,3,opt,name=default_lookup,json=defaultLookup,proto3" json:"defaultLookup,omitempty"`
// contains filtered or unexported fields
}
Config is the node controller config.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks equality between two configs.
func (*Config) GetConfigID ¶
GetConfigID returns the config identifier.
func (*Config) GetDefaultLookup ¶
func (x *Config) GetDefaultLookup() *proto.ControllerConfig
func (*Config) GetDisableDefaultLookup ¶
func (*Config) GetDisableLookup ¶
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the Node controller.
func NewController ¶
NewController constructs a new node controller.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close releases any resources used by the controller. Error indicates any issue encountered releasing.
func (*Controller) Execute ¶
func (c *Controller) Execute(ctx context.Context) error
Execute executes the controller goroutine. Returning nil ends execution. Returning an error triggers a retry with backoff.
func (*Controller) GetControllerInfo ¶
func (c *Controller) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*Controller) HandleDirective ¶
func (c *Controller) 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 Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a node controller.
func NewFactory ¶
NewFactory builds a websocket transport 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.