hero.baobab.action #
fn openapi_request_to_action #
fn openapi_request_to_action(request Request) Action
enum ActionState #
enum ActionState {
init // first state
next // will continue with next steps
restart
error
done // means we don't process the next ones
}
enum ActionType #
enum ActionType {
unknown
dal
sal
wal
macro
}
enum ErrorReason #
enum ErrorReason {
timeout
serialization_failed
deserialization_failed
enqueue_failed
}
Enum for different error reasons
struct Action #
struct Action {
pub mut:
id int
cid string
name string
actor string
priority int = 10 // 0 is highest, do 10 as default
params paramsparser.Params
result paramsparser.Params // can be used to remember outputs
// run bool = true // certain actions can be defined but meant to be executed directly
actiontype ActionType = .sal
comments string
done bool // if done then no longer need to process
}
fn (Action) str #
fn (action Action) str() string
fn (Action) heroscript #
fn (action Action) heroscript() string
serialize to heroscript
fn (Action) names #
fn (action Action) names() []string
return list of names . the names are normalized (no special chars, lowercase, ... )
fn (Action) hashkey #
fn (action Action) hashkey() string
get hash from the action, should always be the same for the same action
struct ActionError #
struct ActionError {
reason ErrorReason
}
Error struct for error handling
fn (ActionError) code #
fn (err ActionError) code() int
fn (ActionError) msg #
fn (err ActionError) msg() string
struct ProcedureResponse #
struct ProcedureResponse {
pub:
result string // Response data
error string // Internal error message (if any)
}
ProcedureResponse struct representing the result of a procedure call
struct ProcessParams #
@[params]
struct ProcessParams {
pub:
timeout int // Timeout in seconds
}
Parameters for processing a procedure call