autoconfig

package
v3.11.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

autoconfig provides a way to create instances of objects based on the configuration in runme.yaml.

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 Decorate added in v3.11.0

func Decorate(decorator interface{}, opts ...dig.DecorateOption) error

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 Builder added in v3.11.0

type Builder struct {
	*dig.Container
}

func NewBuilder added in v3.11.0

func NewBuilder() *Builder

type ClientFactory added in v3.8.4

type ClientFactory func() (*runnerv2client.Client, error)

Jump to

Keyboard shortcuts

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