manifest

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 17 Imported by: 0

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

View Source
const (

	// MaxSize is Consul's KV value limit; the manifest is one value.
	MaxSize = 512 * 1024
)

Variables

View Source
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

func Descriptors(services []string) ([]byte, error)

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.

func UIHash

func UIHash(bundle fs.FS) (string, error)

UIHash addresses an immutable snapshot of the bundle's paths and bytes.

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 New

func New(service, version string) *Builder

New starts a manifest for service@version.

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) Config

func (b *Builder) Config(schema *sp.Schema, live []string)

Config records the configuration schema and its live paths.

func (*Builder) Event

func (b *Builder) Event(e *backplanev1.Event)

Event records an event.

func (*Builder) Fail

func (b *Builder) Fail(err error)

Fail records an error found outside the builder.

func (*Builder) HasEvents

func (b *Builder) HasEvents() bool

HasEvents reports whether the service declared an event.

func (*Builder) Hook

func (b *Builder) Hook(h *backplanev1.Hook)

Hook records a hook.

func (*Builder) Internal

func (b *Builder) Internal(services []string)

Internal records internal API service names.

func (*Builder) Nodes

func (b *Builder) Nodes(nodes []*backplanev1.Node)

Nodes records the node tree.

func (*Builder) Seal

func (b *Builder) Seal()

Seal ends the declaration phase.

func (*Builder) Sealed

func (b *Builder) Sealed() bool

Sealed reports whether declarations have ended.

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) UI

func (b *Builder) UI(bundle fs.FS)

UI records the bundle hash and sdk_major from plugin.json.

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.

Jump to

Keyboard shortcuts

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