plugins

package
v0.17.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMethodArgs

type SafeMethodArgs struct {
	Args *plugin.MethodArgs
}

SafeMethodArgs provides safe access to KCL plugin method arguments.

func (*SafeMethodArgs) BoolKwArg

func (sma *SafeMethodArgs) BoolKwArg(name string, defaultValue bool) bool

BoolKwArg returns the boolean keyword argument with the given name, or defaultValue if it doesn't exist.

func (*SafeMethodArgs) Exists

func (sma *SafeMethodArgs) Exists(name string) bool

Exists checks if an argument with the given name exists.

func (*SafeMethodArgs) ListKwArg

func (sma *SafeMethodArgs) ListKwArg(name string, defaultValue []any) []any

ListKwArg returns the list keyword argument with the given name, or defaultValue if it doesn't exist.

func (*SafeMethodArgs) ListStrArg

func (sma *SafeMethodArgs) ListStrArg(idx int) ([]string, error)

ListStrArg returns the string list argument at the given index.

func (*SafeMethodArgs) MapKwArg

func (sma *SafeMethodArgs) MapKwArg(name string, defaultValue map[string]any) map[string]any

MapKwArg returns the map keyword argument with the given name, or defaultValue if it doesn't exist.

func (*SafeMethodArgs) StrArg

func (sma *SafeMethodArgs) StrArg(idx int) (string, error)

StrArg returns the string argument at the given index.

func (*SafeMethodArgs) StrKwArg

func (sma *SafeMethodArgs) StrKwArg(name, defaultValue string) string

StrKwArg returns the string keyword argument with the given name, or defaultValue if it doesn't exist.

Jump to

Keyboard shortcuts

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