flagset

package
v0.3.10-rc Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 3 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

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