Documentation ¶
Index ¶
- Constants
- Variables
- func AsFloat64(value any) (float64, error)
- func AsMap(value any) (gin.H, error)
- func AsSlice(value any) ([]any, error)
- func AsString(value any) (string, error)
- func AsUint64(value any) (uint64, error)
- func GetBaseUrl(levelToErase uint8, data gin.H) (string, error)
- func GetCurrentUserId(data gin.H) (uint64, error)
- func GetFiles(data gin.H) (map[string][]byte, error)
- func GetFormData(data gin.H) (gin.H, error)
- func GetPagination(defaultPageSize uint64, data gin.H) (uint64, uint64, uint64, string)
- func GetPaginationNames() []string
- type Action
- type ActionHandler
- type Registerer
- type Widget
- type WidgetManager
Constants ¶
View Source
const (
FilesKey = "Files"
)
Variables ¶
View Source
var Registerers []Registerer
Functions ¶
func GetPagination ¶
func GetPaginationNames ¶
func GetPaginationNames() []string
Types ¶
type Action ¶
type Action struct { Kind uint8 Path string QueryNames []string Handler ActionHandler }
type ActionHandler ¶
type Registerer ¶
type Registerer func(WidgetManager, map[string]string, servicecommon.LoggerGetter) error
type Widget ¶
func (Widget) AddAction ¶
func (w Widget) AddAction(actionName string, kind uint8, path string, handler ActionHandler)
based on gin path convention, with the path "/view/:id/:name" the map passed to handler will contains "pathData/id" and "pathData/name" entries handler returned values are supposed to be redirect, templateName and data :
redirect is a redirect path (ignored if empty), to build an absolute one on the site the map contains the "CurrentUrl" entry
data could be :
- a json marshalled map which entries will be added to the data passed to the template engine with templateName
- or any raw data when the action kind is remoteservice.KIND_RAW
func (Widget) AddActionWithQuery ¶
func (w Widget) AddActionWithQuery(actionName string, kind uint8, path string, queryNames []string, handler ActionHandler)
Like AddAction but allow to indicate which query parameters should be transmitted.
type WidgetManager ¶
func NewManager ¶
func NewManager() WidgetManager
func (WidgetManager) CreateWidget ¶
func (manager WidgetManager) CreateWidget(widgetName string) Widget
Click to show internal directories.
Click to hide internal directories.