registry

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment string

An Environment is the execution context in which the program is running.

const (
	EnvironmentDev  Environment = "dev"  // development: testing, debugging, etc.
	EnvironmentProd Environment = "prod" // production: user data, SLOs, etc.
)

func CurrentEnvironment

func CurrentEnvironment() Environment

CurentEnvironment returns the currently active environment.

type Flow

type Flow interface{}

Flow is the type for the flows stored in a registry. Since a registry just remembers flows and returns them, this interface is empty.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}
var Global *Registry

The global registry, used in non-test code. A test may create their own registries to avoid conflicting with other tests.

func New

func New() (*Registry, error)

func (*Registry) Freeze

func (r *Registry) Freeze()

func (*Registry) ListActions

func (r *Registry) ListActions() []action.Desc

ListActions returns a list of descriptions of all registered actions. The list is sorted by action name.

func (*Registry) ListFlows

func (r *Registry) ListFlows() []Flow

func (*Registry) LookupAction

func (r *Registry) LookupAction(key string) action.Action

LookupAction returns the action for the given key, or nil if there is none.

func (*Registry) LookupTraceStore

func (r *Registry) LookupTraceStore(env Environment) tracing.Store

func (*Registry) RegisterAction

func (r *Registry) RegisterAction(typ atype.ActionType, a action.Action)

RegisterAction records the action in the registry. It panics if an action with the same type, provider and name is already registered.

func (*Registry) RegisterFlow

func (r *Registry) RegisterFlow(f Flow)

RegisterFlow stores the flow for use by the production server (see [NewFlowServeMux]). It doesn't check for duplicates because registerAction will do that.

func (*Registry) RegisterSpanProcessor

func (r *Registry) RegisterSpanProcessor(sp sdktrace.SpanProcessor)

func (*Registry) RegisterTraceStore

func (r *Registry) RegisterTraceStore(env Environment, ts tracing.Store)

func (*Registry) TracingState

func (r *Registry) TracingState() *tracing.State

Jump to

Keyboard shortcuts

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