param

package
v1.0.35 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIObject

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

APIObject should be embedded in api object fields, preferably using an alias to make private

func (APIObject) ExtraFields

func (m APIObject) ExtraFields() map[string]interface{}

ExtraFields returns the extra fields added to the JSON object.

func (APIObject) Overrides

func (m APIObject) Overrides() (interface{}, bool)

Overrides returns the value of the struct when it is created with [Override], the second argument helps differentiate an explicit null.

func (*APIObject) SetExtraFields

func (m *APIObject) SetExtraFields(extraFields map[string]interface{})

SetExtraFields adds extra fields to the JSON object.

SetExtraFields will override any existing fields with the same key. For security reasons, ensure this is only used with trusted input data.

To intentionally omit a required field, use [Omit].

foo.SetExtraFields(map[string]any{"bar": Omit})

If the struct already contains the field ExtraFields, then this method will have no effect.

type APIUnion

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

APIUnion should be embedded in all api unions fields, preferably using an alias to make private

func (APIUnion) ExtraFields

func (m APIUnion) ExtraFields() map[string]interface{}

ExtraFields returns the extra fields added to the JSON object.

func (APIUnion) Overrides

func (m APIUnion) Overrides() (interface{}, bool)

Overrides returns the value of the struct when it is created with [Override], the second argument helps differentiate an explicit null.

func (*APIUnion) SetExtraFields

func (m *APIUnion) SetExtraFields(extraFields map[string]interface{})

SetExtraFields adds extra fields to the JSON object.

SetExtraFields will override any existing fields with the same key. For security reasons, ensure this is only used with trusted input data.

To intentionally omit a required field, use [Omit].

foo.SetExtraFields(map[string]any{"bar": Omit})

If the struct already contains the field ExtraFields, then this method will have no effect.

type ParamNullable

type ParamNullable interface {
	// contains filtered or unexported methods
}

ParamNullable encapsulates all structs in parameters, and all [Opt] types in parameters.

type ParamStruct

type ParamStruct interface {
	Overrides() (interface{}, bool)
	// contains filtered or unexported methods
}

ParamStruct represents the set of all structs that are used in API parameters, by convention these usually end in "Params" or "Param".

Jump to

Keyboard shortcuts

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