framework

package
v0.0.0-...-fb0e841 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 13

Documentation

Index

Constants

View Source
const (
	ConfName      = "kusciaapp"
	GinServerName = "server"
	MetricsName   = "metrics"
)

Default Bean Names

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name    string // not be null
	Usage   string
	Version string
}

func (*AppConfig) Validate

func (o *AppConfig) Validate(errs *errorcode.Errs)

type Bean

type Bean interface {
	Init(e ConfBeanRegistry) error
	Start(ctx context.Context, e ConfBeanRegistry) error
}

type ConfBeanRegistry

type ConfBeanRegistry interface {
	GetBeanByName(name string) (Bean, bool)
	GetConfigByName(name string) (Config, bool)
}

ConfBeanRegistry is a subset of the Framework Interface. Objects that implement the Framework interface can be used as ConfBeanRegistry, which is used to obtain other required config and bean in the Bean Init and Start stages。

type Config

type Config interface {
	// Validate options.
	Validate(errs *errorcode.Errs)
}

type ConfigLoader

type ConfigLoader interface {
	// RegisterFlags registers flags.
	RegisterFlags(conf Config, name string, fs *pflag.FlagSet)
	// Process config obtained by Flag.
	Process(conf Config, name string, errs *errorcode.Errs)
}

ConfigLoader provides behavioral abstraction for different Config sources.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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