Documentation
¶
Index ¶
- func Env(envName string, defaultValue string) (value string)
- func H3hash(s string) string
- func PackagePath() string
- func PostBind(c *gin.Context, ret interface{}) bool
- func Wait()
- type Func
- type GroupsList
- type Menu
- type Module
- type ModuleSettings
- type NotifyStruct
- type Panel
- type Rights
- type Settings
- type Simple
- type UsersStruct
- type WebFunc
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 GroupsList ¶
func (*GroupsList) Get ¶
func (g *GroupsList) Get(names ...string) (actions []string)
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
Ajax Func
Websockets WebFunc
Icon string
GroupTo Simple
GroupTitle string
Rights Rights
}
ModuleSettings struct
type NotifyStruct ¶
type NotifyStruct struct {
ID uint64 `json:"id" bson:"_id"`
UserID uint64 `json:"userId" bson:"userId"`
Title string `json:"title" bson:"title" binding:"required,min=3"`
Text string `json:"text" bson:"text"`
Created uint `json:"-" bson:"created"`
Updated uint `json:"-" bson:"updated"`
Deleted bool `json:"-" bson:"deleted"`
Demo bool
}
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
// Groups
Groups *GroupsList
// contains filtered or unexported fields
}
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
UsersCollection string // collection for panel's users
NotifyCollection string // collection for panel's notifications
AICollection string // collection for AUTO_INCREMENT
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
JS []string // external JS resources
CSS []string // external CSS resources
}
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"`
Created uint `form:"-" json:"-" bson:"created"`
Updated uint `form:"-" json:"-" bson:"updated"`
Deleted bool `form:"-" json:"-" bson:"deleted"`
Rights Rights `form:"-" json:"rights" bson:"rights"`
Settings map[string]interface{} `form:"-" json:"settings" bson:"-"`
Demo bool
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
