Actions runtime

Technical reference of Runtime de Actions.

This API is used in Action Parameters.


Symbols

SymbolClassDescription
MaxJavaScriptSafeIntegerconstMaxJavaScriptSafeInteger defines a constant value of the API.
ActionSignedIntegerTypefuncReturns number or bigint for an integer with a sign.
ActionUnsignedIntegerTypefuncReturns number or bigint for an integer without a sign.
ActionHandlertypeActionHandler defines a public type of API.
ActionParamTypetypeActionParamType defines a public type of API.
ActionStringconstActionString defines a constant value of the API.
ActionNumberconstActionNumber defines a constant value of the API.
ActionBooleanconstActionBoolean defines a constant value of the API.
ActionDateconstActionDate defines a constant value of the API.
ActionFileconstActionFile defines a constant value of the API.
ActionFilesconstActionFiles defines a constant value of the API.
ActionJSONconstActionJSON defines a constant value of the API.
ActionSpectypeActionSpec defines a public type of API.
ActionParamSpectypeActionParamSpec defines a public type of API.
ValidateActionParamsfuncValida ValidateActionParams.

MaxJavaScriptSafeInteger

Declaration:

gox
const MaxJavaScriptSafeInteger int64 = 1<<53 - 1

MaxJavaScriptSafeInteger defines a constant value of the API.


ActionSignedIntegerType

Declaration:

gox
func ActionSignedIntegerType(value int64) string

Returns number or bigint for an integer with a sign.

Parameters

ParameterTypeDescription
valueint64Value to be stored or issued.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := gox.ActionSignedIntegerType(value)

ActionUnsignedIntegerType

Declaration:

gox
func ActionUnsignedIntegerType(value uint64) string

Returns number or bigint for an integer without a sign.

Parameters

ParameterTypeDescription
valueuint64Value to be stored or issued.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := gox.ActionUnsignedIntegerType(value)

ActionHandler

Declaration:

gox
type ActionHandler func(ctx *Context)

ActionHandler defines a public type of API.


ActionParamType

Declaration:

gox
type ActionParamType uint8

ActionParamType defines a public type of API.


ActionString

Declaration:

gox
ActionString ActionParamType = iota

ActionString defines a constant value of the API.


ActionNumber

Declaration:

gox
ActionNumber

ActionNumber defines a constant value of the API.


ActionBoolean

Declaration:

gox
ActionBoolean

ActionBoolean defines a constant value of the API.


ActionDate

Declaration:

gox
ActionDate

ActionDate defines a constant value of the API.


ActionFile

Declaration:

gox
ActionFile

ActionFile defines a constant value of the API.


ActionFiles

Declaration:

gox
ActionFiles

ActionFiles defines a constant value of the API.


ActionJSON

Declaration:

gox
ActionJSON

ActionJSON defines a constant value of the API.


ActionSpec

Declaration:

gox
type ActionSpec struct {
	Name   string
	Params []ActionParamSpec
}

ActionSpec defines a public type of API.

Fields

FieldTypeDescription
NamestringName of the value.
Params[]ActionParamSpecDynamic parameters of the route.

ActionParamSpec

Declaration:

gox
type ActionParamSpec struct {
	Name   string
	Type   ActionParamType
	JSName string
}

ActionParamSpec defines a public type of API.

Fields

FieldTypeDescription
NamestringName of the value.
TypeActionParamTypeDeclared type.
JSNamestringName of the element.

ValidateActionParams

Declaration:

gox
func ValidateActionParams(ctx *Context, spec *ActionSpec, dest ...any) error

Valida ValidateActionParams.

Parameters

ParameterTypeDescription
ctx*ContextContext of execution.
spec*ActionSpecType value *ActionSpec required by the operation.
dest...anyType value ...any required by the operation.

Returns

ReturnTypeDescription
errerrornil if the operation ends correctly; otherwise, the error produced.

Behavior

The operation returns an error when it cannot complete the above contract.

Errors

ValidateActionParams returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.

Usage syntax

gox
err := gox.ValidateActionParams(ctx, nil, value)

See also

Next step

Continue with Runtime response writing.

Response runtime