Actions runtime
Technical reference of Runtime de Actions.
This API is used in Action Parameters.
Symbols
| Symbol | Class | Description |
|---|---|---|
| MaxJavaScriptSafeInteger | const | MaxJavaScriptSafeInteger defines a constant value of the API. |
| ActionSignedIntegerType | func | Returns number or bigint for an integer with a sign. |
| ActionUnsignedIntegerType | func | Returns number or bigint for an integer without a sign. |
| ActionHandler | type | ActionHandler defines a public type of API. |
| ActionParamType | type | ActionParamType defines a public type of API. |
| ActionString | const | ActionString defines a constant value of the API. |
| ActionNumber | const | ActionNumber defines a constant value of the API. |
| ActionBoolean | const | ActionBoolean defines a constant value of the API. |
| ActionDate | const | ActionDate defines a constant value of the API. |
| ActionFile | const | ActionFile defines a constant value of the API. |
| ActionFiles | const | ActionFiles defines a constant value of the API. |
| ActionJSON | const | ActionJSON defines a constant value of the API. |
| ActionSpec | type | ActionSpec defines a public type of API. |
| ActionParamSpec | type | ActionParamSpec defines a public type of API. |
| ValidateActionParams | func | Valida ValidateActionParams. |
MaxJavaScriptSafeInteger
Declaration:
const MaxJavaScriptSafeInteger int64 = 1<<53 - 1 MaxJavaScriptSafeInteger defines a constant value of the API.
ActionSignedIntegerType
Declaration:
func ActionSignedIntegerType(value int64) string Returns number or bigint for an integer with a sign.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | int64 | Value to be stored or issued. |
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := gox.ActionSignedIntegerType(value) ActionUnsignedIntegerType
Declaration:
func ActionUnsignedIntegerType(value uint64) string Returns number or bigint for an integer without a sign.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | uint64 | Value to be stored or issued. |
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := gox.ActionUnsignedIntegerType(value) ActionHandler
Declaration:
type ActionHandler func(ctx *Context) ActionHandler defines a public type of API.
ActionParamType
Declaration:
type ActionParamType uint8 ActionParamType defines a public type of API.
ActionString
Declaration:
ActionString ActionParamType = iota ActionString defines a constant value of the API.
ActionNumber
Declaration:
ActionNumber ActionNumber defines a constant value of the API.
ActionBoolean
Declaration:
ActionBoolean ActionBoolean defines a constant value of the API.
ActionDate
Declaration:
ActionDate ActionDate defines a constant value of the API.
ActionFile
Declaration:
ActionFile ActionFile defines a constant value of the API.
ActionFiles
Declaration:
ActionFiles ActionFiles defines a constant value of the API.
ActionJSON
Declaration:
ActionJSON ActionJSON defines a constant value of the API.
ActionSpec
Declaration:
type ActionSpec struct {
Name string
Params []ActionParamSpec
} ActionSpec defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Name | string | Name of the value. |
Params | []ActionParamSpec | Dynamic parameters of the route. |
ActionParamSpec
Declaration:
type ActionParamSpec struct {
Name string
Type ActionParamType
JSName string
} ActionParamSpec defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Name | string | Name of the value. |
Type | ActionParamType | Declared type. |
JSName | string | Name of the element. |
ValidateActionParams
Declaration:
func ValidateActionParams(ctx *Context, spec *ActionSpec, dest ...any) error Valida ValidateActionParams.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
spec | *ActionSpec | Type value *ActionSpec required by the operation. |
dest | ...any | Type value ...any required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil 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
err := gox.ValidateActionParams(ctx, nil, value)