multinput

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputResolver

type InputResolver func(ctx context.Context) (*Result, error)

Function signature required for resolvers used by Multinput.

type Multinput

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

Multinput models the configuration/state.

func New

func New(resolvers []InputResolver) Multinput

Initializes a new Multinput

func (*Multinput) Provide

func (m *Multinput) Provide(ctx context.Context) (*Result, error)

Provide runs the given resolvers and will keep waiting for first non-empty value until timeout (defined by ctx) reached.

type ResolverID

type ResolverID string

Identifier for a single resolver.

type Result

type Result struct {
	Value      string
	ResolverID ResolverID
}

Result which is expected from resolvers and finally returned by Provide function as well (from the first resolve to "win").

Jump to

Keyboard shortcuts

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