jsonflag

package
v0.1.0-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(body, query, header []byte) ([]byte, []byte, []byte, error)

func Clear

func Clear()

func Register

func Register(kind MutationKind, path string, value interface{})

Types

type JSONAnyFlag

type JSONAnyFlag = cli.FlagBase[interface{}, JSONConfig, JsonValueCreator[interface{}]]

type JSONConfig

type JSONConfig struct {
	Kind MutationKind
	Path string
	// For boolean flags that set a specific value when present
	SetValue interface{}
}

type JsonDateValueCreator

type JsonDateValueCreator struct{}

JsonDateValueCreator is a specialized creator for date-only values

func (JsonDateValueCreator) Create

func (c JsonDateValueCreator) Create(val time.Time, dest *time.Time, config JSONConfig) cli.Value

func (JsonDateValueCreator) ToString

func (c JsonDateValueCreator) ToString(val time.Time) string

type JsonFileValueCreator

type JsonFileValueCreator struct{}

JsonFileValueCreator handles file-based flags that read content and register with mutations

func (JsonFileValueCreator) Create

func (c JsonFileValueCreator) Create(val string, dest *string, config JSONConfig) cli.Value

func (JsonFileValueCreator) ToString

func (c JsonFileValueCreator) ToString(val string) string

type JsonValueCreator

type JsonValueCreator[T any] struct{}

func (JsonValueCreator[T]) Create

func (c JsonValueCreator[T]) Create(val T, dest *T, config JSONConfig) cli.Value

func (JsonValueCreator[T]) ToString

func (c JsonValueCreator[T]) ToString(val T) string

type Mutation

type Mutation struct {
	Kind  MutationKind
	Path  string
	Value interface{}
}

type MutationKind

type MutationKind string
const (
	Body   MutationKind = "body"
	Query  MutationKind = "query"
	Header MutationKind = "header"
)

Jump to

Keyboard shortcuts

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