flagset

package
v0.3.3 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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