flagset

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

type Flag struct {
	Key          string
	Type         FlagType
	Description  string
	DefaultValue any
}

type FlagType

type FlagType int

FlagType are the primitive types of flags.

const (
	UnknownFlagType FlagType = iota
	IntType
	FloatType
	BoolType
	StringType
	ObjectType
)

Collection of the different kinds of flag types

func (FlagType) String

func (f FlagType) String() string

type Flagset

type Flagset struct {
	Flags []Flag
}

func Load

func Load(manifestPath string) (*Flagset, error)

Loads, validates, and unmarshals the manifest file at the given path into a flagset

func (*Flagset) Filter

func (fs *Flagset) Filter(unsupportedFlagTypes map[FlagType]bool) *Flagset

Filter removes flags from the Flagset that are of unsupported types.

func (*Flagset) UnmarshalJSON

func (fs *Flagset) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into a Flagset. It is used by json.Unmarshal.

Jump to

Keyboard shortcuts

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