Documentation ¶
Index ¶
- Constants
- Variables
- func AddController(cinterface interface{}) (string, string)
- func AddModule(alias string, modname string)
- func HasController(mod, con string) (exists bool)
- func HasModule(mod string) bool
- func Module(mod string) (m map[string]*Meta)
- type ActionMap
- func (a ActionMap) Add(name string, am *ActionMeta)
- func (a ActionMap) Count() int
- func (a ActionMap) Delete(name string)
- func (a ActionMap) Get(name string, reqtype ReqMethod) *ActionMeta
- func (a ActionMap) GetReqMeth(name string) (rm ReqMethod)
- func (a ActionMap) GetReqMethList(name string) (rml []string)
- func (a ActionMap) HasAction(name string) bool
- func (a ActionMap) Remove(name string, reqtype ReqMethod)
- type ActionMeta
- type ArgMeta
- type ControlHandler
- type ControlManager
- func (c *ControlManager) ActionMeta() *ActionMeta
- func (c *ControlManager) ActionName() string
- func (c *ControlManager) AvailableMethods() ReqMethod
- func (c *ControlManager) AvailableMethodsList() []string
- func (c *ControlManager) Cleanup()
- func (c *ControlManager) Context() *web.Context
- func (c *ControlManager) Controller() reflect.Value
- func (c *ControlManager) ControllerMeta() *Meta
- func (c *ControlManager) ControllerName() string
- func (c *ControlManager) Execute() (state int, vw mvc.View)
- func (c *ControlManager) IsExecuted() bool
- func (c *ControlManager) IsPrepared() bool
- func (c *ControlManager) ModuleName() string
- func (c *ControlManager) MvcMeta() mvc.Meta
- func (c *ControlManager) Prepare() error
- func (c *ControlManager) PrepareAndExecute() (state int, vw mvc.View)
- func (c *ControlManager) PublishView() (err error)
- func (c *ControlManager) SetAction(action string) (ok bool)
- func (c *ControlManager) SetControllerMeta(cm *Meta) (ok bool)
- func (c *ControlManager) SetState(state int)
- func (c *ControlManager) State() int
- func (c *ControlManager) View() mvc.View
- type DataMeta
- type DataType
- type FieldMeta
- type Group
- func (cg *Group) AddController(cinterface interface{}) (string, string)
- func (cg *Group) AddModule(alias string, modname string)
- func (cg *Group) Controller(mod, con string) (c *Meta)
- func (cg *Group) HasController(mod, con string) (exists bool)
- func (cg *Group) HasModule(mod string) bool
- func (cg *Group) Module(mod string) (m map[string]*Meta)
- type Meta
- func (cm *Meta) Action(name string, reqtype ReqMethod) *ActionMeta
- func (cm Meta) ActionAvailableMethods(name string) ReqMethod
- func (cm Meta) ActionAvailableMethodsList(name string) []string
- func (cm Meta) ActionFromRequest(name string, ctxt *web.Context) *ActionMeta
- func (cm *Meta) Args() []*ArgMeta
- func (cm *Meta) Fields() []*FieldMeta
- func (cm *Meta) HasAction(name string) bool
- func (cm *Meta) HasActionMethod(name string, reqtype ReqMethod) bool
- func (cm *Meta) Meths() ActionMap
- func (cm *Meta) Module() string
- func (cm *Meta) Name() string
- func (cm *Meta) New() reflect.Value
- func (cm *Meta) RType() reflect.Type
- func (cm *Meta) ReqMeth() ReqMethod
- func (cm *Meta) T() Type
- type ReqMethod
- type ResultStyle
- type StructValueFeeder
- type Type
- type WebsocketChat
- func (wc *WebsocketChat) AddChannel(channel string)
- func (wc *WebsocketChat) AddClient(channel, uid string, context *web.Context)
- func (wc *WebsocketChat) Broadcast(channel string, msgT int, msg []byte)
- func (wc *WebsocketChat) BroadcastJSON(channel string, msg interface{})
- func (wc *WebsocketChat) Client(channel, uid string) map[*web.Context]*websocket.Conn
- func (wc *WebsocketChat) MessageClient(channel, uid string, msgT int, msg []byte) bool
- func (wc *WebsocketChat) MessageJSONClient(channel, uid string, msg interface{}) bool
- func (wc *WebsocketChat) RemoveClient(channel, uid string, context *web.Context)
Constants ¶
View Source
const ( DatatypeStringSuffix = "_String" DatatypeIntSuffix = "_Int" DatatypeInt64Suffix = "_Int64" DatatypeFloatSuffix = "_Float" DatatypeFloat64Suffix = "_Float64" DatatypeEmailSuffix = "_Email" DatatypeURLSuffix = "_Url" DatatypeDateSuffix = "_Date" DatatypeTimeSuffix = "_Time" DatatypeDateTimeSuffix = "_Datetime" DatatypeBoolSuffix = "_Bool" FormValueTypeTagName = "value.type" FormValueTypeLprefix = "form_" )
View Source
const ( SconConstructName = "Construct_" SconDestructName = "Destruct_" )
View Source
const StructValueFeedTag = "sunnified.feed"
View Source
const StructValueResTag = "sunnified.res"
Variables ¶
View Source
var ErrControllerNotFound = errors.New("controller not found")
View Source
var ErrParseStruct = errors.New("Sunnified Parser error")
View Source
var ErrUnexecuted = errors.New("controller has not been executed")
View Source
var ErrUnprepared = errors.New("controller has not been prep'ed")
Functions ¶
func AddController ¶
func HasController ¶
Types ¶
type ActionMap ¶
type ActionMap map[string]map[ReqMethod]*ActionMeta
func (ActionMap) Add ¶
func (a ActionMap) Add(name string, am *ActionMeta)
func (ActionMap) GetReqMeth ¶
func (ActionMap) GetReqMethList ¶
type ActionMeta ¶
type ActionMeta struct { ResultStyle // contains filtered or unexported fields }
func (*ActionMeta) Args ¶
func (am *ActionMeta) Args() []*ArgMeta
func (*ActionMeta) Name ¶
func (am *ActionMeta) Name() string
func (*ActionMeta) RMeth ¶
func (am *ActionMeta) RMeth() reflect.Method
func (*ActionMeta) ReqMeth ¶
func (am *ActionMeta) ReqMeth() ReqMethod
type ControlHandler ¶
type ControlHandler interface {
GetControlManager(*web.Context) *ControlManager
}
type ControlManager ¶
type ControlManager struct {
// contains filtered or unexported fields
}
func NewControlManager ¶
func NewControlManager(context *web.Context, cm *Meta, action string) *ControlManager
func (*ControlManager) ActionMeta ¶
func (c *ControlManager) ActionMeta() *ActionMeta
func (*ControlManager) ActionName ¶
func (c *ControlManager) ActionName() string
func (*ControlManager) AvailableMethods ¶
func (c *ControlManager) AvailableMethods() ReqMethod
func (*ControlManager) AvailableMethodsList ¶
func (c *ControlManager) AvailableMethodsList() []string
func (*ControlManager) Cleanup ¶
func (c *ControlManager) Cleanup()
func (*ControlManager) Context ¶
func (c *ControlManager) Context() *web.Context
func (*ControlManager) Controller ¶
func (c *ControlManager) Controller() reflect.Value
func (*ControlManager) ControllerMeta ¶
func (c *ControlManager) ControllerMeta() *Meta
func (*ControlManager) ControllerName ¶
func (c *ControlManager) ControllerName() string
func (*ControlManager) IsExecuted ¶
func (c *ControlManager) IsExecuted() bool
func (*ControlManager) IsPrepared ¶
func (c *ControlManager) IsPrepared() bool
func (*ControlManager) ModuleName ¶
func (c *ControlManager) ModuleName() string
func (*ControlManager) MvcMeta ¶
func (c *ControlManager) MvcMeta() mvc.Meta
func (*ControlManager) Prepare ¶
func (c *ControlManager) Prepare() error
func (*ControlManager) PrepareAndExecute ¶
func (c *ControlManager) PrepareAndExecute() (state int, vw mvc.View)
func (*ControlManager) PublishView ¶
func (c *ControlManager) PublishView() (err error)
func (*ControlManager) SetAction ¶
func (c *ControlManager) SetAction(action string) (ok bool)
func (*ControlManager) SetControllerMeta ¶
func (c *ControlManager) SetControllerMeta(cm *Meta) (ok bool)
func (*ControlManager) SetState ¶
func (c *ControlManager) SetState(state int)
func (*ControlManager) State ¶
func (c *ControlManager) State() int
func (*ControlManager) View ¶
func (c *ControlManager) View() mvc.View
type DataType ¶
type DataType int
const ( DatatypeWebContext DataType = 1 + iota DatatypeRequest DatatypeResponseWriter DatatypeUpath DatatypeUpathSlice DatatypePdata DatatypePdataMap DatatypeStruct DatatypeString DatatypeInt DatatypeInt64 DatatypeFloat DatatypeFloat64 DatatypeEmail DatatypeURL DatatypeDate DatatypeTime DatatypeDateTime DatatypeBool DatatypeEmbedded )
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func GetDefaultControllerGroup ¶
func GetDefaultControllerGroup() *Group
func NewControllerGroup ¶
func NewControllerGroup() *Group
func (*Group) AddController ¶
func (*Group) Controller ¶
func (*Group) HasController ¶
type Meta ¶
type Meta struct { ResultStyle // contains filtered or unexported fields }
func Controller ¶
func MakeControllerMeta ¶
func (Meta) ActionAvailableMethods ¶
func (Meta) ActionAvailableMethodsList ¶
func (Meta) ActionFromRequest ¶
func (cm Meta) ActionFromRequest(name string, ctxt *web.Context) *ActionMeta
type ReqMethod ¶
type ReqMethod uint16
const ( // the first four must be get, post, put and delete (the order is less impt) // since ActionMap.Add() depends on it to work correctly ReqMethodGet ReqMethod = 1 << iota ReqMethodPost ReqMethodPut ReqMethodDelete ReqMethodPatch ReqMethodOptions ReqMethodHead ReqMethodCommon ReqMethod = 15 //1 | 2 | 4 | 8 ReqMethodAll ReqMethod = 127 //1 | 2 | 4 | 8 | 16 | 32 | 64 )
func GetReqMethod ¶
func GetXReqMethod ¶
type ResultStyle ¶
type ResultStyle struct {
// contains filtered or unexported fields
}
func (ResultStyle) IsNil ¶
func (rs ResultStyle) IsNil() bool
func (ResultStyle) MapSI ¶
func (rs ResultStyle) MapSI() bool
func (ResultStyle) Status ¶
func (rs ResultStyle) Status() bool
func (ResultStyle) View ¶
func (rs ResultStyle) View() bool
func (ResultStyle) Vmap ¶
func (rs ResultStyle) Vmap() bool
type StructValueFeeder ¶
type Type ¶
type Type int
const ( ContypeFunc Type ContypeStruct ContypeConstructor ContypeScontroller )
type WebsocketChat ¶
type WebsocketChat struct {
// contains filtered or unexported fields
}
func NewWebSocketChat ¶
func NewWebSocketChat() *WebsocketChat
func (*WebsocketChat) AddChannel ¶
func (wc *WebsocketChat) AddChannel(channel string)
func (*WebsocketChat) AddClient ¶
func (wc *WebsocketChat) AddClient(channel, uid string, context *web.Context)
func (*WebsocketChat) Broadcast ¶
func (wc *WebsocketChat) Broadcast(channel string, msgT int, msg []byte)
func (*WebsocketChat) BroadcastJSON ¶
func (wc *WebsocketChat) BroadcastJSON(channel string, msg interface{})
func (*WebsocketChat) MessageClient ¶
func (wc *WebsocketChat) MessageClient(channel, uid string, msgT int, msg []byte) bool
func (*WebsocketChat) MessageJSONClient ¶
func (wc *WebsocketChat) MessageJSONClient(channel, uid string, msg interface{}) bool
func (*WebsocketChat) RemoveClient ¶
func (wc *WebsocketChat) RemoveClient(channel, uid string, context *web.Context)
Click to show internal directories.
Click to hide internal directories.