argument

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentPreset

type ArgumentPreset struct {
	Path    *jsonpath.Path
	Value   ArgumentPresetValueGetter
	Targets map[string]schema.TypeRepresentation
}

ArgumentPreset represents an argument preset.

func NewArgumentPreset

func NewArgumentPreset(
	httpSchema *rest.NDCHttpSchema,
	preset rest.ArgumentPresetConfig,
	isGlobal bool,
) (*ArgumentPreset, error)

NewArgumentPreset create a new ArgumentPreset instance.

func (ArgumentPreset) Evaluate

func (ap ArgumentPreset) Evaluate(
	operationName string,
	arguments map[string]any,
	headers map[string]string,
) (map[string]any, error)

Evaluate iterates and inject values into request arguments recursively.

type ArgumentPresetValueEnv

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

ArgumentPresetValueEnv represents the argument preset getter from an environment variable.

func NewArgumentPresetValueEnv

func NewArgumentPresetValueEnv(name string) *ArgumentPresetValueEnv

NewArgumentPresetValueEnv creates a new ArgumentPresetValueEnv instance.

func (ArgumentPresetValueEnv) GetValue

func (apv ArgumentPresetValueEnv) GetValue(
	_ map[string]string,
	typeRep schema.TypeRepresentation,
) (any, error)

GetValue gets and parses the argument preset value.

type ArgumentPresetValueForwardHeader

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

ArgumentPresetValueForwardHeader represents the argument preset getter from request headers.

func NewArgumentPresetValueForwardHeader

func NewArgumentPresetValueForwardHeader(name string) *ArgumentPresetValueForwardHeader

NewArgumentPresetValueForwardHeader creates a new ArgumentPresetValueForwardHeader instance.

func (ArgumentPresetValueForwardHeader) GetValue

func (apv ArgumentPresetValueForwardHeader) GetValue(
	headers map[string]string,
	typeRep schema.TypeRepresentation,
) (any, error)

GetValue gets and parses the argument preset value.

type ArgumentPresetValueGetter

type ArgumentPresetValueGetter interface {
	GetValue(headers map[string]string, typeRep schema.TypeRepresentation) (any, error)
}

ArgumentPresetValueGetter abstracts the value getter of a argument preset.

func NewArgumentPresetValueGetter

func NewArgumentPresetValueGetter(
	presetValue rest.ArgumentPresetValue,
) (ArgumentPresetValueGetter, error)

NewArgumentPresetValueGetter creates an ArgumentPresetValueGetter from config.

type ArgumentPresetValueLiteral

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

ArgumentPresetValueLiteral represents an argument preset getter from a literal value.

func NewArgumentPresetValueLiteral

func NewArgumentPresetValueLiteral(value any) *ArgumentPresetValueLiteral

NewArgumentPresetValueLiteral creates a new ArgumentPresetValueLiteral instance.

func (ArgumentPresetValueLiteral) GetValue

func (apv ArgumentPresetValueLiteral) GetValue(
	_ map[string]string,
	typeRep schema.TypeRepresentation,
) (any, error)

GetValue gets and parses the argument preset value.

type ArgumentPresets

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

ArgumentPresets manage and apply default preset values to request arguments.

func NewArgumentPresets

func NewArgumentPresets(
	httpSchema *rest.NDCHttpSchema,
	presets []rest.ArgumentPresetConfig,
	isGlobal bool,
) (*ArgumentPresets, error)

NewArgumentPresets create a new ArgumentPresets instance.

func (ArgumentPresets) Apply

func (ap ArgumentPresets) Apply(
	operationName string,
	arguments map[string]any,
	headers map[string]string,
) (map[string]any, error)

Apply replaces argument preset values into request arguments.

Jump to

Keyboard shortcuts

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