svc

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 92 Imported by: 0

Documentation

Index

Constants

View Source
const Delim = "."

Variables

This section is empty.

Functions

func Component added in v0.4.6

func Component[T any](name string, set configset.Set[T], opts ...fx.Option) fx.Option

func DBFxOpt added in v0.4.6

func DBFxOpt() fx.Option

func GetConfig added in v0.4.6

func GetConfig[T any](c *Config, path string, def T) (*T, error)

GetConfig returns the unmarshalled configuration in `path`. If `path` does not exist, `def` is returned. Unmarshalling is done into a prepopulated config with `def`.

func HookOnStart added in v0.4.6

func HookOnStart(lc fx.Lifecycle, f func(context.Context) error)

func HookOnStop added in v0.4.6

func HookOnStop(lc fx.Lifecycle, f func(context.Context) error)

func HookSimpleOnStart added in v0.4.6

func HookSimpleOnStart(lc fx.Lifecycle, f func())

func HookSimpleOnStop added in v0.4.6

func HookSimpleOnStop(lc fx.Lifecycle, f func())

func LoggerFxOpt added in v0.4.6

func LoggerFxOpt() fx.Option

func NewOpts

func NewOpts(cfg *Config, ropts RunOptions) []fx.Option

func StartDB added in v0.4.6

func StartDB(ctx context.Context, cfg *Config, ropt RunOptions) (db.DB, error)

Types

type Config added in v0.4.6

type Config struct {
	// contains filtered or unexported fields
}

TODO: need to find a way to list all expected keys.

func LoadConfig added in v0.4.6

func LoadConfig(envVarPrefix string, confmapvs map[string]any, yamlPath string) (*Config, error)

TODO: make sure confmapvs maps to real pre-registered keys. If envVarPrefix is empty, do not load from environment. If yamlPath is empty, do not load from file.

func (*Config) Get added in v0.4.6

func (c *Config) Get(path string, dst any) (bool, error)

func (*Config) ListAll added in v0.4.6

func (c *Config) ListAll() []string

func (*Config) Store added in v0.4.6

func (c *Config) Store(name string, config any)

type HTTPServerAddr added in v0.4.6

type HTTPServerAddr string

type RunOptions added in v0.4.6

type RunOptions struct {
	Mode           configset.Mode
	Silent         bool          // No logs at all
	TemporalClient client.Client // use this instead of creating a new temporal client.
}

Jump to

Keyboard shortcuts

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