config

package
v1.119.11 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(ctx context.Context, cmd *cobra.Command, component *mud.Component, opts ...cfgstruct.BindOpt) error

Bind binds the config for a command.

func BindAll

func BindAll(ctx context.Context, cmd *cobra.Command, ball *mud.Ball, selector mud.ComponentSelector, opts ...cfgstruct.BindOpt) error

BindAll will register all the Config annotated components as flags / config keys.

func RegisterConfig

func RegisterConfig[T any](ball *mud.Ball, prefix string)

RegisterConfig registers a config to mud, with all the information required for binding.

Types

type Config

type Config struct {
	Prefix string
}

Config is a mud annotation. Structs annotated with this, will be exposed as flags / configs (with the given prefix).

func (Config) String

func (c Config) String() string

String implements String.

Jump to

Keyboard shortcuts

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