Documentation
¶
Overview ¶
Package manifest collects a service's declarations into a backplanev1.Manifest. Declarations are recorded as they happen; the first error is kept and returned by Build.
Index ¶
- Constants
- Variables
- func Descriptors(services []string) ([]byte, error)
- func Register(dst Registry, register func(grpc.ServiceRegistrar)) ([]string, error)
- func SDKVersion() string
- func UIHash(bundle fs.FS) (string, error)
- type Builder
- func (b *Builder) API(r *backplanev1.API)
- func (b *Builder) Activity(a *backplanev1.Activity)
- func (b *Builder) Build() (*backplanev1.Manifest, error)
- func (b *Builder) Config(schema *sp.Schema, live []string)
- func (b *Builder) Event(e *backplanev1.Event)
- func (b *Builder) Fail(err error)
- func (b *Builder) HasEvents() bool
- func (b *Builder) Hook(h *backplanev1.Hook)
- func (b *Builder) Internal(services []string)
- func (b *Builder) Nodes(nodes []*backplanev1.Node)
- func (b *Builder) Seal()
- func (b *Builder) Sealed() bool
- func (b *Builder) Subscription(s *backplanev1.Subscription)
- func (b *Builder) Telemetry(sources *backplanev1.TelemetrySources)
- func (b *Builder) UI(bundle fs.FS)
- func (b *Builder) Workflow(w *backplanev1.Workflow)
- type Registry
Constants ¶
const (
// MaxSize is Consul's KV value limit; the manifest is one value.
MaxSize = 512 * 1024
)
Variables ¶
var ( // ErrTooLarge: the manifest does not fit one Consul KV value. ErrTooLarge = errors.New("manifest: larger than a Consul KV value (512 KiB)") // ErrDuplicate: something declared or registered twice. ErrDuplicate = errors.New("manifest: duplicate") )
Errors.
Functions ¶
func Descriptors ¶
Descriptors serializes the files of the named services with their transitive imports from the global registry.
func Register ¶
func Register(dst Registry, register func(grpc.ServiceRegistrar)) ([]string, error)
Register runs register against dst and returns the services it added. A service already on dst is an error instead of grpc's process exit.
func SDKVersion ¶
func SDKVersion() string
SDKVersion is the version of the backplane module linked into the binary, "(devel)" when unknown; the manifest's sdk_version.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder accumulates declarations until Seal; declaring after that is a programming error and panics.
func (*Builder) API ¶
func (b *Builder) API(r *backplanev1.API)
API records an API; duplicate host, prefix and port declarations are errors.
func (*Builder) Activity ¶
func (b *Builder) Activity(a *backplanev1.Activity)
Activity records an activity.
func (*Builder) Build ¶
func (b *Builder) Build() (*backplanev1.Manifest, error)
Build returns a copy of the manifest with the shared descriptor set, or every declaration error.
func (*Builder) Nodes ¶
func (b *Builder) Nodes(nodes []*backplanev1.Node)
Nodes records the node tree.
func (*Builder) Subscription ¶
func (b *Builder) Subscription(s *backplanev1.Subscription)
Subscription records a reactor.
func (*Builder) Telemetry ¶
func (b *Builder) Telemetry(sources *backplanev1.TelemetrySources)
Telemetry retains declaration presence, including an explicitly empty set.
func (*Builder) Workflow ¶
func (b *Builder) Workflow(w *backplanev1.Workflow)
Workflow records a workflow the console may start.
type Registry ¶
type Registry interface {
grpc.ServiceRegistrar
GetServiceInfo() map[string]grpc.ServiceInfo
}
Registry is a gRPC registrar that can list what it holds: *grpc.Server and the ws-proto registrar.