Documentation
¶
Index ¶
- func GetAvoCookie(sessionID, publickeyPath string) (*secure.Cookies, error)
- func IsAllowed(appName string, usrRoles secure.ActionMap, required roletype.Enum) (bool, error)
- func RenderUnauthorized(err error) context.Renderer
- type APIController
- func (ctrl *APIController) GetKeyedRequest(target interface{}) (husk.Key, error)
- func (ctrl *APIController) GetMyToken() string
- func (ctrl *APIController) GetPageData() (page, pageSize int)
- func (ctrl *APIController) Prepare()
- func (ctrl *APIController) Serve(statuscode int, err error, result interface{})
- func (ctrl *APIController) ServeBinary(data []byte, filename string)
- func (ctrl *APIController) ServeBinaryWithMIME(data []byte, filename, mimetype string)
- type ControllerMap
- func (m *ControllerMap) Add(path string, actionMap secure.ActionMap)
- func (m *ControllerMap) FilterAPI(ctx *context.Context)
- func (m *ControllerMap) FilterUI(ctx *context.Context)
- func (m *ControllerMap) GetInstanceID() string
- func (m *ControllerMap) GetPublicKeyPath() string
- func (m *ControllerMap) GetRequiredRole(path, action string) (roletype.Enum, error)
- func (m *ControllerMap) GetServiceName() string
- type InstanceController
- type Menu
- type UIController
- func (ctrl *UIController) CreateSideMenu(ctx *context.Context, menu *Menu)
- func (ctrl *UIController) CreateTopMenu(ctx *context.Context, menu *Menu)
- func (ctrl *UIController) EnableSave()
- func (ctrl *UIController) GetMyToken() string
- func (ctrl *UIController) Init(ct *context.Context, controllerName, actionName string, app interface{})
- func (ctrl *UIController) Prepare()
- func (ctrl *UIController) Serve(data interface{}, err error)
- func (ctrl *UIController) ServeJSON(statuscode int, err error, data interface{})
- func (ctrl *UIController) SetTheme(settings mango.ThemeSetting)
- func (ctrl *UIController) Setup(name, title string, hasScript bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAvoCookie ¶ added in v0.3.56
func RenderUnauthorized ¶ added in v0.3.34
Types ¶
type APIController ¶
type APIController struct {
InstanceController
}
APIController serves JSON data.
func (*APIController) GetKeyedRequest ¶
func (ctrl *APIController) GetKeyedRequest(target interface{}) (husk.Key, error)
GetKeyedRequest will return the Key and update the Target when Requests are sent for updates.
func (*APIController) GetMyToken ¶ added in v0.3.41
func (ctrl *APIController) GetMyToken() string
GetMyToken
func (*APIController) GetPageData ¶
func (ctrl *APIController) GetPageData() (page, pageSize int)
GetPageData turns /B1 into page 1. size 1
func (*APIController) Prepare ¶
func (ctrl *APIController) Prepare()
Prepare is called before the Action on a Controller is executed. The API Prepare adds some security Headers to every request.
func (*APIController) Serve ¶
func (ctrl *APIController) Serve(statuscode int, err error, result interface{})
Serve sends data as JSON response.
func (*APIController) ServeBinary ¶
func (ctrl *APIController) ServeBinary(data []byte, filename string)
ServeBinary is used to serve files such as images and documents.
func (*APIController) ServeBinaryWithMIME ¶ added in v0.1.10
func (ctrl *APIController) ServeBinaryWithMIME(data []byte, filename, mimetype string)
ServeBinaryWithMIME is used to serve files such as images and documents. You must specify the MIME Type
type ControllerMap ¶
type ControllerMap struct {
// contains filtered or unexported fields
}
ControllerMap is used to assign Priveliges to Actions
func CreateControlMap ¶
func CreateControlMap(service *mango.Service) *ControllerMap
func (*ControllerMap) Add ¶
func (m *ControllerMap) Add(path string, actionMap secure.ActionMap)
Add is used to specify the permissions required for a controller's actions.
func (*ControllerMap) FilterAPI ¶
func (m *ControllerMap) FilterAPI(ctx *context.Context)
FilterAPI is used to secure API services. When a user is not allowed to access a resource, they will get the Unauthorized Status.
func (*ControllerMap) FilterUI ¶
func (m *ControllerMap) FilterUI(ctx *context.Context)
FilterUI is used to secure web pages. When a user is not allowed to access a Page, they are redirected to secure.login
func (*ControllerMap) GetInstanceID ¶
func (m *ControllerMap) GetInstanceID() string
GetInstanceID returns the ID initially registered with the Service.
func (*ControllerMap) GetPublicKeyPath ¶ added in v0.3.37
func (m *ControllerMap) GetPublicKeyPath() string
GetPublicKeyPath return the Location of the public key file registered with the Service.
func (*ControllerMap) GetRequiredRole ¶
func (m *ControllerMap) GetRequiredRole(path, action string) (roletype.Enum, error)
GetRequiredRole will return the RoleType required to access the 'path' and 'action'
func (*ControllerMap) GetServiceName ¶
func (m *ControllerMap) GetServiceName() string
GetServiceName returns the Name initially registered with the Service
type InstanceController ¶
type InstanceController struct { beego.Controller // contains filtered or unexported fields }
func (*InstanceController) GetInstanceID ¶
func (ctrl *InstanceController) GetInstanceID() string
func (*InstanceController) SetInstanceMap ¶
func (ctrl *InstanceController) SetInstanceMap(ctrlMap *ControllerMap)
type UIController ¶
type UIController struct { APIController // contains filtered or unexported fields }
func (*UIController) CreateSideMenu ¶
func (ctrl *UIController) CreateSideMenu(ctx *context.Context, menu *Menu)
func (*UIController) CreateTopMenu ¶
func (ctrl *UIController) CreateTopMenu(ctx *context.Context, menu *Menu)
func (*UIController) EnableSave ¶ added in v0.3.61
func (ctrl *UIController) EnableSave()
func (*UIController) GetMyToken ¶ added in v0.3.41
func (ctrl *UIController) GetMyToken() string
func (*UIController) Init ¶ added in v0.3.65
func (ctrl *UIController) Init(ct *context.Context, controllerName, actionName string, app interface{})
func (*UIController) Prepare ¶
func (ctrl *UIController) Prepare()
func (*UIController) Serve ¶
func (ctrl *UIController) Serve(data interface{}, err error)
Serve sends the response with 'Error' and 'Data' properties.
func (*UIController) ServeJSON ¶
func (ctrl *UIController) ServeJSON(statuscode int, err error, data interface{})
ServeJSON enables JSON Responses on UI Controllers
func (*UIController) SetTheme ¶ added in v0.2.24
func (ctrl *UIController) SetTheme(settings mango.ThemeSetting)
func (*UIController) Setup ¶
func (ctrl *UIController) Setup(name, title string, hasScript bool)