Documentation
¶
Index ¶
- Constants
- Variables
- 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 (x *Config) GetCdnBaseUrl() string
- func (c *Config) GetConfigID() string
- func (x *Config) GetEngineId() string
- func (x *Config) GetPointerTtlDur() string
- func (x *Config) GetSpaceId() 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 (c *Config) ParsePointerTTLDur() (time.Duration, 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
- func (c *Controller) Close() error
- func (c *Controller) Execute(ctx context.Context) error
- func (c *Controller) GetControllerInfo() *controller.Info
- func (c *Controller) GetWorldEngine(ctx context.Context) (world.Engine, error)
- func (c *Controller) HandleDirective(_ context.Context, di directive.Instance) ([]directive.Resolver, error)
- type Factory
- func (f *Factory) Construct(_ context.Context, conf config.Config, opts controller.ConstructOpts) (controller.Controller, error)
- func (f *Factory) ConstructConfig() config.Config
- func (f *Factory) GetConfigID() string
- func (f *Factory) GetControllerID() string
- func (f *Factory) GetVersion() semver.Version
Constants ¶
const ConfigID = ControllerID
ConfigID is the string used to identify this config object.
const ControllerID = "spacewave/cdn/world"
ControllerID identifies the CDN world controller.
Variables ¶
var Version = semver.MustParse("0.0.1")
Version is the version of the world implementation.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// EngineId is the world engine id exposed on the bus.
EngineId string `protobuf:"bytes,1,opt,name=engine_id,json=engineId,proto3" json:"engineId,omitempty"`
// SpaceId is the public CDN Space id.
SpaceId string `protobuf:"bytes,2,opt,name=space_id,json=spaceId,proto3" json:"spaceId,omitempty"`
// CdnBaseUrl is the public CDN base URL.
CdnBaseUrl string `protobuf:"bytes,3,opt,name=cdn_base_url,json=cdnBaseUrl,proto3" json:"cdnBaseUrl,omitempty"`
// PointerTtlDur is the cached root pointer TTL.
// Empty uses the CDN block store default. Negative disables expiry.
PointerTtlDur string `protobuf:"bytes,4,opt,name=pointer_ttl_dur,json=pointerTtlDur,proto3" json:"pointerTtlDur,omitempty"`
// contains filtered or unexported fields
}
Config configures a read-only CDN-backed world engine controller.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetCdnBaseUrl ¶
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type.
func (*Config) GetEngineId ¶
func (*Config) GetPointerTtlDur ¶
func (*Config) GetSpaceId ¶
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) ParsePointerTTLDur ¶
ParsePointerTTLDur parses the root pointer TTL field.
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 exposes a read-only CDN-backed world engine.
func NewController ¶
NewController builds a new CDN world controller.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close releases any resources used by the controller.
func (*Controller) Execute ¶
func (c *Controller) Execute(ctx context.Context) error
Execute builds the read-only CDN world engine and holds it until shutdown.
func (*Controller) GetControllerInfo ¶
func (c *Controller) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*Controller) GetWorldEngine ¶
GetWorldEngine waits for the engine to be built.
func (*Controller) HandleDirective ¶
func (c *Controller) HandleDirective(_ context.Context, di directive.Instance) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs the CDN world controller.
func (*Factory) Construct ¶
func (f *Factory) Construct( _ 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.