Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PackagePath ¶
func PackagePath() string
PackagePath returns file path of Summer package location
Types ¶
type Module ¶
type Module struct {
Panel
Collection *mgo.Collection
Settings *ModuleSettings
}
Module struct
func (*Module) GetSettings ¶
func (m *Module) GetSettings() *ModuleSettings
GetSettings needs for correct settings getting from module struct
func (*Module) Init ¶ added in v1.2.6
func (m *Module) Init(settings *ModuleSettings, panel *Panel)
Init is default module's initial method
func (*Module) Websockets ¶
Websockets is default module's websockets method
type ModuleSettings ¶
type ModuleSettings struct {
Name string
Menu *Menu
MenuTitle string
MenuOrder int
PageRouteName string
AjaxRouteName string
SocketsRouteName string
Title string
CollectionName string
TemplateName string
AllowGroups []string
AllowRoles []string
AllowUsers []uint64
Ajax Func
Websockets WebFunc
}
ModuleSettings struct
type Panel ¶
type Panel struct {
Settings
// RootMenu is zerro-level menu
RootMenu *Menu
// MainMenu is main admin-panel menu
MainMenu *Menu
// DropMenu is top user dropdown menu
DropMenu *Menu
}
Panel struct
type Settings ¶
type Settings struct {
Port uint
Title string
AuthSalt string
AuthPrefix string
Path string // URL path of panel - "/" by default
Views string // file path of ./templates directory
ViewsDoT string // file path of doT.js templates directory
Files string // file path of ./files directory
TMPs string // file path of /tmp directory
DBName string // MongoDB database name
DefaultPage string
Language string
UserCollection string
Debug bool
Vars map[string]interface{}
TFuncMap template.FuncMap
FirstStart func()
RouterGroup *gin.RouterGroup
Engine *gin.Engine
DisableAuth bool // if TRUE - without summer auth
DisableFirstStart bool // if TRUE - without first user creating
}
Settings intended for data transmission into the Create method of package
type Simple ¶
type Simple interface {
Init(settings *ModuleSettings, panel *Panel)
Page(c *gin.Context)
Ajax(c *gin.Context)
Websockets(c *gin.Context)
GetSettings() *ModuleSettings
}
Simple module interface
type UsersStruct ¶
type UsersStruct struct {
ID uint64 `form:"id" json:"id" bson:"_id"`
Root bool `form:"-" json:"root" bson:"root"`
Name string `form:"name" json:"name" bson:"name" binding:"required,min=3"`
Notice string `form:"notice" json:"notice" bson:"notice"`
Login string `form:"login" json:"login" bson:"login" binding:"required`
Password string `form:"password" json:"-" bson:"password"`
Updated uint `form:"-" json:"-" bson:"updated"`
Deleted bool `form:"-" json:"-" bson:"deleted"`
Settings interface{}
}
Click to show internal directories.
Click to hide internal directories.
