private

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL