advargs

package
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultParser = NewParser()

DefaultParser is a convenience parser for simple use cases.

Functions

func Parse

func Parse(raw map[string]string, dest any, ctx *ParseContext) error

Parse is a convenience function using the default parser.

Types

type ParseContext

type ParseContext struct {
	LauncherIDs []string
}

ParseContext provides runtime context for validation.

func NewParseContext

func NewParseContext(launcherIDs []string) *ParseContext

NewParseContext creates a ParseContext from a list of launcher IDs.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles parsing and validation of advanced arguments.

func NewParser

func NewParser() *Parser

NewParser creates a new Parser with registered custom validators.

func (*Parser) Parse

func (p *Parser) Parse(raw map[string]string, dest any, ctx *ParseContext) error

Parse decodes raw advanced args into a typed struct and validates them. Returns an error if decoding or validation fails.

Jump to

Keyboard shortcuts

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