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.
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 UserConfigDir ¶ added in v3.2.5
type UserConfigDir string
Click to show internal directories.
Click to hide internal directories.