Documentation
¶
Overview ¶
Package standalone composes source-backed applications and owns their listeners.
Index ¶
- type AsyncOptions
- type Options
- type Server
- func (s *Server) DispatchStorageEvent(ctx context.Context, object storage.Object) error
- func (s *Server) InvokeComponent(ctx context.Context, request dexec.ComponentRequest) (any, error)
- func (s *Server) Metadata(ctx context.Context) (*application.Metadata, error)
- func (s *Server) Reload(ctx context.Context, revision uint64) error
- func (s *Server) Serve(ctx context.Context, output io.Writer) (err error)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) WaitReady(ctx context.Context) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncOptions ¶
type AsyncOptions struct {
Authorize jobs.Authorizer
FS afs.Service
Notify func(context.Context, *xasync.Job) error
WatchError func(string, error)
}
AsyncOptions is the trusted linked host integration for configured Jobs. Authorize must check current application access for every action, including status. Canonical inputs have verified declared codecs; storage Inspect has nil Input and requires independently trusted worker authority. Stored principals are not authority. Nil authorization rejects startup. Callbacks and FS must be concurrency-safe and remain valid until Shutdown completes; the host retains FS ownership.
type Options ¶
type Options struct {
// Codecs supplies named application codec factories; built-in names are reserved.
Codecs map[string]xcodec.Factory
// Providers supplies immutable application-owned capabilities to every
// linked component. The caller owns their lifecycle.
Providers []locator.Provider
// DefaultAuthenticator is the application-owned credential implementation.
// It may invoke generated components through the current handler session.
DefaultAuthenticator xauth.Authenticator
// Async supplies trusted authorization and optional AFS callbacks for Config.Jobs.
Async *AsyncOptions
Workspace *xmodule.Workspace
// Holders are concrete component declarations emitted into a custom build.
// Runtime package names still come exclusively from Config.GoBootstrap.
Holders []any
// RequireLinked rejects Go holder source that is absent from the executable's
// runtime typelinks. Custom commands enable it; direct authoring tests may not.
RequireLinked bool
// MCPResourceAuthorizer uses the linked deployment's existing token/scope
// verifier for protected embedded resources. Nil denies protected skill reads.
MCPResourceAuthorizer auth.ResourceAuthorizer
// Config is transferred to the server; callers must not mutate it after New.
Config *config.Config
// Registry supplies compiled package exports, including typed handler bridges.
// Resources supplies immutable named filesystems for configured static mounts.
Resources *resource.Store
Registry *x.Registry
Diagnostics io.Writer
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) DispatchStorageEvent ¶
DispatchStorageEvent admits externally delivered AFS objects through the same Manager used by polling and HTTP. The delivery adapter owns acknowledgement.
func (*Server) InvokeComponent ¶ added in v1.1.0
InvokeComponent runs a linked component in the currently published generation without starting an HTTP listener. Reload must publish the first generation before an in-process caller invokes a component.
func (*Server) Metadata ¶
Metadata snapshots the published application generation, not source files.
func (*Server) Reload ¶
Reload reads the full authored source set again. Only Manager publishes it. Endpoint, credentials, connectors and other startup options are lifetime-fixed.
func (*Server) Serve ¶
Serve binds every endpoint, publishes a complete initial generation and then serves. Readiness output contains only listener addresses, never configuration. The caller supplies signal cancellation; this package installs no global handlers.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves the published generation. Reload must succeed before serving.