Versions in this module Expand all Collapse all v1 v1.1.0 May 14, 2024 v1.0.0 Apr 5, 2024 Changes in this version + var ErrComponentNotFound = errors.New("component not found") + var ErrModuleNotFound = errors.New("module not found") + func AllNames() []string + func Register(r Registration) + type Arguments interface + type Component interface + Run func(ctx context.Context) error + Update func(args Arguments) error + type DebugComponent interface + DebugInfo func() interface{} + type ExportFunc func(exports map[string]any) + type Exports interface + type Health struct + Health HealthType + Message string + UpdateTime time.Time + func LeastHealthy(h Health, hh ...Health) Health + type HealthComponent interface + CurrentHealth func() Health + type HealthType uint8 + const HealthTypeExited + const HealthTypeHealthy + const HealthTypeUnhealthy + const HealthTypeUnknown + func (ht *HealthType) UnmarshalText(text []byte) error + func (ht HealthType) MarshalText() (text []byte, err error) + func (ht HealthType) String() string + type ID struct + LocalID string + ModuleID string + func ParseID(input string) ID + func (id ID) String() string + type Info struct + Arguments Arguments + Component Component + ComponentName string + DebugInfo interface{} + Exports Exports + Health Health + ID ID + Label string + ModuleIDs []string + ReferencedBy []string + References []string + Type Type + func GetAllComponents(p Provider, opts InfoOptions) []*Info + func (info *Info) MarshalJSON() ([]byte, error) + type InfoOptions struct + GetArguments bool + GetDebugInfo bool + GetExports bool + GetHealth bool + type Module interface + LoadConfig func(config []byte, args map[string]any) error + Run func(context.Context) error + type ModuleController interface + NewModule func(id string, export ExportFunc) (Module, error) + type Options struct + DataPath string + GetServiceData func(name string) (interface{}, error) + ID string + Logger log.Logger + ModuleController ModuleController + OnStateChange func(e Exports) + Registerer prometheus.Registerer + Tracer trace.TracerProvider + type Provider interface + GetComponent func(id ID, opts InfoOptions) (*Info, error) + ListComponents func(moduleID string, opts InfoOptions) ([]*Info, error) + type Registration struct + Args Arguments + Build func(opts Options, args Arguments) (Component, error) + Exports Exports + Name string + Stability featuregate.Stability + func Get(name string) (Registration, bool) + func (r Registration) CloneArguments() Arguments + type Type int + const TypeBuiltin + const TypeCustom + const TypeInvalid + func (t Type) String() string