flagset

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromSourceFlags added in v0.3.6

func LoadFromSourceFlags(data []byte) (*[]Flag, error)

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 ParseFlagType added in v0.3.10

func ParseFlagType(typeStr string) (FlagType, error)

ParseFlagType converts a string flag type to FlagType enum

func (FlagType) String

func (f FlagType) String() string

type Flagset

type Flagset struct {
	Flags []Flag
}

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) MarshalJSON added in v0.3.6

func (fs *Flagset) MarshalJSON() ([]byte, error)

MarshalJSON marshals a Flagset into JSON format compatible with the manifest structure

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