Documentation ¶
Index ¶
- Variables
- func BindRPCParams(c *gin.Context, data interface{})
- func Execute(uid int64, params CallParams) (res interface{}, rError error)
- func GetFieldValue(uid, id int64, model, field string) (res interface{}, rError error)
- func LoadInternalResources()
- func PostInit()
- func RPC(c *gin.Context, code int, obj interface{}, err ...error)
- func RegisterModule(mod *Module)
- type CallParams
- type JSONRPCError
- type Module
- type RequestRPC
- type ResponseError
- type ResponseRPC
- type SearchReadParams
- type SearchReadResult
- type Server
Constants ¶
This section is empty.
Variables ¶
var Modules []*Module
Functions ¶
func BindRPCParams ¶
BindParams binds the RPC parameters to the given data object.
func Execute ¶
func Execute(uid int64, params CallParams) (res interface{}, rError error)
Execute executes a method on an object
func GetFieldValue ¶
GetFieldValue retrieves the given field of the given model and id.
func LoadInternalResources ¶
func LoadInternalResources()
LoadInternalResources loads all data in the 'views' directory, that are - views, - actions, - menu items,
func PostInit ¶
func PostInit()
PostInit runs all actions that need to be done after all modules have been loaded. This is typically all actions that need to be done after bootstrapping the models. This function: - loads the data from the data files of all modules, - runs successively all PostInit() func of all modules, - loads html templates from all modules.
func RegisterModule ¶
func RegisterModule(mod *Module)
RegisterModules registers the given module in the server This function should be called in the init() function of all YEP Addons.
Types ¶
type CallParams ¶
type CallParams struct { Model string `json:"model"` Method string `json:"method"` Args []json.RawMessage `json:"args"` KWArgs map[string]json.RawMessage `json:"kwargs"` }
type JSONRPCError ¶
type RequestRPC ¶
type RequestRPC struct { JsonRPC string `json:"jsonrpc"` ID int64 `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params"` }
type ResponseError ¶
type ResponseError struct { JsonRPC string `json:"jsonrpc"` ID int64 `json:"id"` Error JSONRPCError `json:"error"` }
type ResponseRPC ¶
type SearchReadParams ¶
type SearchReadResult ¶
type SearchReadResult struct { Records []models.FieldMap `json:"records"` Length int `json:"length"` }
func SearchRead ¶
func SearchRead(uid int64, params SearchReadParams) (res *SearchReadResult, rError error)
SearchRead retrieves database records according to the filters defined in params.