Documentation ¶
Overview ¶
Package private is an internal holder of state that different Service Weaver packages share without exposing it externally. E.g., if module X wants to expose a function to module Y without making it public, X can store the function in a variable in private and Y can read it from there.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Start func(ctx context.Context, options AppOptions) (App, error)
Starts starts a Service Weaver application. Callers are required to call app.Wait().
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.13.0
type App interface { // Wait returns when the application has ended. Wait(context.Context) error // Get fetches the component with type t from wlet. Get(requester string, t reflect.Type) (any, error) // ListenerAddress returns the address (host:port) of the // named listener, waiting for the listener to be created // if necessary. ListenerAddress(name string) (string, error) }
App is an internal handle to a Service Weaver application.
type AppOptions ¶ added in v0.13.0
type AppOptions struct { // Fakes holds a mapping from component interface type to the fake // implementation to use for that component. Fakes map[reflect.Type]any }
AppOptions controls a Service Weaver application execution.
Click to show internal directories.
Click to hide internal directories.