Documentation ¶
Index ¶
- Constants
- func Action(ctx *Context)
- func GetContextHandler() macaron.Handler
- func HealthCluster(ctx *Context)
- func HealthID(ctx *Context)
- func NewAPI(m *macaron.Macaron) error
- func QueryActive(ctx *Context)
- func Sessioner(options session.Options) macaron.Handler
- func SetConfDir(dir string)
- func SetLogDir(dir string)
- func SetLogger(l *logrus.Logger)
- func WebServer(publicPath string, bindAddr string, cfg *config.HTTPConfig, id string)
- type Context
- type SessionStore
- type SessionWrapper
- type UserLogin
Constants ¶
View Source
const (
SessKeyUserID = "uid"
)
SessKeyUserID type of session key
Variables ¶
This section is empty.
Functions ¶
func GetContextHandler ¶
func GetContextHandler() macaron.Handler
GetContextHandler get context handler
func HealthCluster ¶
func HealthCluster(ctx *Context)
func NewAPI ¶
func NewAPI(m *macaron.Macaron) error
NewAPICfgImportExport Import/Export REST API creator
func QueryActive ¶
func QueryActive(ctx *Context)
Types ¶
type Context ¶
type Context struct { *macaron.Context SignedInUser string Session SessionStore IsSignedIn bool }
Context custom context for http session handler
type SessionStore ¶
type SessionStore interface { // Set sets value to given key in session. Set(interface{}, interface{}) error // Get gets value by given key in session. Get(interface{}) interface{} // ID returns current session ID. ID() string // Release releases session resource and save data to provider. Release() error // Destory deletes a session. Destory(*Context) error // init Start(*Context) error }
SessionStore Session Interface
type SessionWrapper ¶
type SessionWrapper struct {
// contains filtered or unexported fields
}
SessionWrapper session wrapper
func (*SessionWrapper) Destory ¶
func (s *SessionWrapper) Destory(c *Context) error
Destory destory session
func (*SessionWrapper) Get ¶
func (s *SessionWrapper) Get(k interface{}) interface{}
Get session Key/Value getter
func (*SessionWrapper) Set ¶
func (s *SessionWrapper) Set(k interface{}, v interface{}) error
Set session key/value setter
func (*SessionWrapper) Start ¶
func (s *SessionWrapper) Start(c *Context) error
Start start session context
Click to show internal directories.
Click to hide internal directories.