Documentation
¶
Index ¶
- Constants
- Variables
- func NewSRPCWorldRefreshHandler(impl SRPCWorldRefreshServer, serviceID string) srpc.Handler
- func SRPCRegisterWorldRefresh(mux srpc.Mux, impl SRPCWorldRefreshServer) error
- func WorldRefreshServiceID(engineID string) string
- 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) GetCacheBlockStoreId() string
- func (x *Config) GetCdnBaseUrl() string
- func (c *Config) GetConfigID() string
- func (x *Config) GetEngineId() string
- func (x *Config) GetPointerTtlDur() string
- func (x *Config) GetRootPointerBaseUrl() string
- func (x *Config) GetSpaceId() string
- func (x *Config) GetSuppliedBlockStoreId() string
- func (x *Config) GetWritebackWindowBytes() int64
- 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)
- func (c *Controller) InvokeMethod(serviceID, methodID string, stream srpc.Stream) (bool, error)
- func (c *Controller) Refresh(ctx context.Context, req *RefreshRequest) (*RefreshResponse, 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() controller.Version
- type RefreshRequest
- func (m *RefreshRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *RefreshRequest) CloneVT() *RefreshRequest
- func (this *RefreshRequest) EqualMessageVT(thatMsg any) bool
- func (this *RefreshRequest) EqualVT(that *RefreshRequest) bool
- func (x *RefreshRequest) GetSpaceId() string
- func (x *RefreshRequest) MarshalJSON() ([]byte, error)
- func (x *RefreshRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *RefreshRequest) MarshalProtoText() string
- func (m *RefreshRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RefreshRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *RefreshRequest) MarshalVT() (dAtA []byte, err error)
- func (*RefreshRequest) ProtoMessage()
- func (x *RefreshRequest) Reset()
- func (m *RefreshRequest) SizeVT() (n int)
- func (x *RefreshRequest) String() string
- func (x *RefreshRequest) UnmarshalJSON(b []byte) error
- func (x *RefreshRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *RefreshRequest) UnmarshalVT(dAtA []byte) error
- type RefreshResponse
- func (m *RefreshResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *RefreshResponse) CloneVT() *RefreshResponse
- func (this *RefreshResponse) EqualMessageVT(thatMsg any) bool
- func (this *RefreshResponse) EqualVT(that *RefreshResponse) bool
- func (x *RefreshResponse) GetAccepted() bool
- func (x *RefreshResponse) MarshalJSON() ([]byte, error)
- func (x *RefreshResponse) MarshalProtoJSON(s *json.MarshalState)
- func (x *RefreshResponse) MarshalProtoText() string
- func (m *RefreshResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RefreshResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *RefreshResponse) MarshalVT() (dAtA []byte, err error)
- func (*RefreshResponse) ProtoMessage()
- func (x *RefreshResponse) Reset()
- func (m *RefreshResponse) SizeVT() (n int)
- func (x *RefreshResponse) String() string
- func (x *RefreshResponse) UnmarshalJSON(b []byte) error
- func (x *RefreshResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *RefreshResponse) UnmarshalVT(dAtA []byte) error
- type SRPCWorldRefreshClient
- type SRPCWorldRefreshHandler
- func (SRPCWorldRefreshHandler) GetMethodIDs() []string
- func (d *SRPCWorldRefreshHandler) GetServiceID() string
- func (d *SRPCWorldRefreshHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCWorldRefreshHandler) InvokeMethod_Refresh(impl SRPCWorldRefreshServer, strm srpc.Stream) error
- type SRPCWorldRefreshServer
- type SRPCWorldRefresh_RefreshStream
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.
const ReleaseBlockStoreID = "spacewave-release-cdn"
ReleaseBlockStoreID identifies the block store shared by Release World metadata reads and release-manifest bucket reads.
const SRPCWorldRefreshServiceID = "cdn.world.controller.WorldRefresh"
Variables ¶
var Version = controller.MustParseVersion("0.0.1")
Version is the version of the world implementation.
Functions ¶
func NewSRPCWorldRefreshHandler ¶
func NewSRPCWorldRefreshHandler(impl SRPCWorldRefreshServer, serviceID string) srpc.Handler
NewSRPCWorldRefreshHandler constructs a new RPC handler. serviceID: if empty, uses default: cdn.world.controller.WorldRefresh
func SRPCRegisterWorldRefresh ¶
func SRPCRegisterWorldRefresh(mux srpc.Mux, impl SRPCWorldRefreshServer) error
SRPCRegisterWorldRefresh registers the implementation with the mux. Uses the default serviceID: cdn.world.controller.WorldRefresh
func WorldRefreshServiceID ¶
WorldRefreshServiceID addresses the refresh owner for one mounted engine.
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"`
// CacheBlockStoreId optionally resolves the lifecycle-owned local block store
// used for durable writeback while reading remote pack ranges.
CacheBlockStoreId string `protobuf:"bytes,5,opt,name=cache_block_store_id,json=cacheBlockStoreId,proto3" json:"cacheBlockStoreId,omitempty"`
// WritebackWindowBytes sets the semantic co-block writeback window.
WritebackWindowBytes int64 `protobuf:"varint,6,opt,name=writeback_window_bytes,json=writebackWindowBytes,proto3" json:"writebackWindowBytes,omitempty"`
// SuppliedBlockStoreId reads every block from that block store on the bus
// instead of opening a CDN transport for this mount. Set it where another
// process already owns the CDN transport, pack readers, index cache, and
// durable writeback for this Space and supplies that store over the block
// store RPC. The controller fetches the root pointer independently to build
// its world head. It resolves no LookupBlockStore because it owns no store.
// Mutually exclusive with cache_block_store_id.
SuppliedBlockStoreId string `protobuf:"bytes,7,opt,name=supplied_block_store_id,json=suppliedBlockStoreId,proto3" json:"suppliedBlockStoreId,omitempty"`
// RootPointerBaseUrl optionally serves root.packedmsg from another base URL,
// so an owner can serve the mutable pointer from its own server and keep the
// CDN hostname immutable. Empty reads the pointer from cdn_base_url.
RootPointerBaseUrl string `protobuf:"bytes,8,opt,name=root_pointer_base_url,json=rootPointerBaseUrl,proto3" json:"rootPointerBaseUrl,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) GetCacheBlockStoreId ¶ added in v0.56.1
func (*Config) GetCdnBaseUrl ¶
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type.
func (*Config) GetEngineId ¶
func (*Config) GetPointerTtlDur ¶
func (*Config) GetRootPointerBaseUrl ¶
func (*Config) GetSpaceId ¶
func (*Config) GetSuppliedBlockStoreId ¶ added in v0.57.2
func (*Config) GetWritebackWindowBytes ¶ added in v0.56.1
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 CDN world engine and holds it until shutdown. A failed mount is published so lookups stop waiting on an unreachable Space.
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.
func (*Controller) InvokeMethod ¶
InvokeMethod serves refresh requests on this mount's RPC service.
func (*Controller) Refresh ¶
func (c *Controller) Refresh(ctx context.Context, req *RefreshRequest) (*RefreshResponse, error)
Refresh queues a fetch after the mount has reported a first outcome: a mounted engine, a missing head, or an unreachable Space. A mount waiting for its first head fetches only when asked, so this is what wakes it. The controller retains the current engine on fetch failure and retries within its own lifetime.
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 ¶
func (f *Factory) GetVersion() controller.Version
GetVersion returns the version of this controller.
type RefreshRequest ¶
type RefreshRequest struct {
// SpaceId is empty for an explicit refresh of the configured mount.
SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"spaceId,omitempty"`
// contains filtered or unexported fields
}
RefreshRequest optionally limits an invalidation to its published Space.
func (*RefreshRequest) CloneMessageVT ¶
func (m *RefreshRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*RefreshRequest) CloneVT ¶
func (m *RefreshRequest) CloneVT() *RefreshRequest
func (*RefreshRequest) EqualMessageVT ¶
func (this *RefreshRequest) EqualMessageVT(thatMsg any) bool
func (*RefreshRequest) EqualVT ¶
func (this *RefreshRequest) EqualVT(that *RefreshRequest) bool
func (*RefreshRequest) GetSpaceId ¶
func (x *RefreshRequest) GetSpaceId() string
func (*RefreshRequest) MarshalJSON ¶
func (x *RefreshRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the RefreshRequest to JSON.
func (*RefreshRequest) MarshalProtoJSON ¶
func (x *RefreshRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the RefreshRequest message to JSON.
func (*RefreshRequest) MarshalProtoText ¶
func (x *RefreshRequest) MarshalProtoText() string
func (*RefreshRequest) MarshalToSizedBufferVT ¶
func (m *RefreshRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RefreshRequest) MarshalToVT ¶
func (m *RefreshRequest) MarshalToVT(dAtA []byte) (int, error)
func (*RefreshRequest) MarshalVT ¶
func (m *RefreshRequest) MarshalVT() (dAtA []byte, err error)
func (*RefreshRequest) ProtoMessage ¶
func (*RefreshRequest) ProtoMessage()
func (*RefreshRequest) Reset ¶
func (x *RefreshRequest) Reset()
func (*RefreshRequest) SizeVT ¶
func (m *RefreshRequest) SizeVT() (n int)
func (*RefreshRequest) String ¶
func (x *RefreshRequest) String() string
func (*RefreshRequest) UnmarshalJSON ¶
func (x *RefreshRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the RefreshRequest from JSON.
func (*RefreshRequest) UnmarshalProtoJSON ¶
func (x *RefreshRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the RefreshRequest message from JSON.
func (*RefreshRequest) UnmarshalVT ¶
func (m *RefreshRequest) UnmarshalVT(dAtA []byte) error
type RefreshResponse ¶
type RefreshResponse struct {
// Accepted is true when the mount queued the requested refresh.
Accepted bool `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
// contains filtered or unexported fields
}
RefreshResponse confirms that a matching mount accepted the invalidation.
func (*RefreshResponse) CloneMessageVT ¶
func (m *RefreshResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*RefreshResponse) CloneVT ¶
func (m *RefreshResponse) CloneVT() *RefreshResponse
func (*RefreshResponse) EqualMessageVT ¶
func (this *RefreshResponse) EqualMessageVT(thatMsg any) bool
func (*RefreshResponse) EqualVT ¶
func (this *RefreshResponse) EqualVT(that *RefreshResponse) bool
func (*RefreshResponse) GetAccepted ¶
func (x *RefreshResponse) GetAccepted() bool
func (*RefreshResponse) MarshalJSON ¶
func (x *RefreshResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals the RefreshResponse to JSON.
func (*RefreshResponse) MarshalProtoJSON ¶
func (x *RefreshResponse) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the RefreshResponse message to JSON.
func (*RefreshResponse) MarshalProtoText ¶
func (x *RefreshResponse) MarshalProtoText() string
func (*RefreshResponse) MarshalToSizedBufferVT ¶
func (m *RefreshResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RefreshResponse) MarshalToVT ¶
func (m *RefreshResponse) MarshalToVT(dAtA []byte) (int, error)
func (*RefreshResponse) MarshalVT ¶
func (m *RefreshResponse) MarshalVT() (dAtA []byte, err error)
func (*RefreshResponse) ProtoMessage ¶
func (*RefreshResponse) ProtoMessage()
func (*RefreshResponse) Reset ¶
func (x *RefreshResponse) Reset()
func (*RefreshResponse) SizeVT ¶
func (m *RefreshResponse) SizeVT() (n int)
func (*RefreshResponse) String ¶
func (x *RefreshResponse) String() string
func (*RefreshResponse) UnmarshalJSON ¶
func (x *RefreshResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the RefreshResponse from JSON.
func (*RefreshResponse) UnmarshalProtoJSON ¶
func (x *RefreshResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the RefreshResponse message from JSON.
func (*RefreshResponse) UnmarshalVT ¶
func (m *RefreshResponse) UnmarshalVT(dAtA []byte) error
type SRPCWorldRefreshClient ¶
type SRPCWorldRefreshClient interface {
// SRPCClient returns the underlying SRPC client.
SRPCClient() srpc.Client
// Refresh queues a root fetch under the mount's lifetime.
Refresh(ctx context.Context, in *RefreshRequest) (*RefreshResponse, error)
}
func NewSRPCWorldRefreshClient ¶
func NewSRPCWorldRefreshClient(cc srpc.Client) SRPCWorldRefreshClient
func NewSRPCWorldRefreshClientWithServiceID ¶
func NewSRPCWorldRefreshClientWithServiceID(cc srpc.Client, serviceID string) SRPCWorldRefreshClient
type SRPCWorldRefreshHandler ¶
type SRPCWorldRefreshHandler struct {
// contains filtered or unexported fields
}
func (SRPCWorldRefreshHandler) GetMethodIDs ¶
func (SRPCWorldRefreshHandler) GetMethodIDs() []string
func (*SRPCWorldRefreshHandler) GetServiceID ¶
func (d *SRPCWorldRefreshHandler) GetServiceID() string
func (*SRPCWorldRefreshHandler) InvokeMethod ¶
func (SRPCWorldRefreshHandler) InvokeMethod_Refresh ¶
func (SRPCWorldRefreshHandler) InvokeMethod_Refresh(impl SRPCWorldRefreshServer, strm srpc.Stream) error
type SRPCWorldRefreshServer ¶
type SRPCWorldRefreshServer interface {
// Refresh queues a root fetch under the mount's lifetime.
Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error)
}