autoconfig

package
v3.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

autoconfig provides a way to create various instances from the config.Config like project.Project, command.Session, zap.Logger.

For example, to instantiate project.Project, you can write:

autoconfig.Invoke(func(p *project.Project) error {
    ...
})

Treat it as a dependency injection mechanism.

autoconfig relies on viper.Viper which has a set of limitations. The most important one is the fact that it does not support hierarchical configuration per folder. We might consider switchig from viper.Viper to something else in the future.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invoke

func Invoke(function interface{}, opts ...dig.InvokeOption) error

Invoke is used to invoke the function with the given dependencies. The package will automatically figure out how to instantiate them using the available configuration.

Types

type KernelGetter added in v3.2.7

type KernelGetter func(name string) (command.Kernel, error)

type UserConfigDir added in v3.2.5

type UserConfigDir string

Jump to

Keyboard shortcuts

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