actionresponse

package
v0.12.30 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: LGPL-3.0, LGPL-3.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name                    string                      // Name of the action
	Label                   string                      // Human-readable text defining the function
	OnType                  string                      // Name of the entity for this action, used to build url endpoint $BASE/action/<entityName>
	InstanceOptional        bool                        // if true a "reference_id" parameter is expected to a value of a an existing <entityType> object, the entity object looked up by this reference_id will be passed on in the Context for outcome evaluations
	RequestSubjectRelations []string                    // if above is true and, this array of strings defined what relations to be fecthed when the subject (above) is fetched and also provided in the context
	ReferenceId             daptinid.DaptinReferenceId  // uuid of this action
	Permission              *auth.AuthPermission        // row permission for this schema-managed action instance
	AccessGroups            table_info.DefaultGroupList // usergroups for this schema-managed action row
	InFields                []api2go.ColumnInfo         // {ColumnName: ”, ... }
	OutFields               []Outcome                   // {Action: ”, Type: ”, Attributes: {...} }
	Validations             []columns.ColumnTag
	Conformations           []columns.ColumnTag
}

Action is a set of `Outcome` based on set of Input values on a particular data type New actions can be defined and added using JSON or YAML files Actions are stored and reloaded from the `action` table of the storage

type ActionPerformerInterface

type ActionPerformerInterface interface {
	DoAction(request Outcome, inFields map[string]interface{}, transaction *sqlx.Tx) (api2go.Responder, []ActionResponse, []error)
	Name() string
}

type ActionRequest

type ActionRequest struct {
	Type          string                 // name of the entity on which the action is defined
	Action        string                 // action name
	Attributes    map[string]interface{} // set of parameters as expected by the action definition
	RawBodyBytes  []byte
	RawBodyString string
}

type ActionResponse

type ActionResponse struct {
	ResponseType string
	Attributes   interface{}
}

type Outcome

type Outcome struct {
	Type            string
	Method          string // method name
	Reference       string
	LogToConsole    bool
	SkipInResponse  bool
	Condition       string
	Attributes      map[string]interface{}
	ContinueOnError bool
}

Outcome is call to a internal function with attributes as parameters Outcome has a particular `type`, it can be one of the data entities already defined Method is the type of outcome: GET/PUT/POST/DELETE/UPDATE/PATCH/EXECUTE/INTEGRATION Condition can be specified in JS to be checked, false condition will skip processing the outcome set SkipInResponse to true to not include action outcome in the http response of the action call reference is a name you can assign to the outcome of, which can be used in furthur chained outcomes Attributes is a map of string to interface{} which will be used by the action The attributes are evaluated to generate the actual data to be sent to execution JS scripting can be used to reference existing outcomes by reference names

Jump to

Keyboard shortcuts

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