core

package
v0.0.0-...-4b5f6dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserId        = "UserID"
	AUTHENTICATED = "Authenticated"
	IsAdmin       = "IsAdmin"
)

Variables

This section is empty.

Functions

func Admin

func Admin(s *sessions.Session) bool

func GetCurrentUserID

func GetCurrentUserID(s *sessions.Session) int64

func IsLoggedIn

func IsLoggedIn(s *sessions.Session) bool

func RenderFailure

func RenderFailure(msg string) mvc.Response

func RenderJson

func RenderJson(obj interface{}) mvc.Response

Types

type AppConf

type AppConf struct {
	SqlConf
	AppInfo
}

type AppInfo

type AppInfo struct {
	Name    string
	Desc    string
	Author  string
	Version string
}

应用信息配置

type SqlConf

type SqlConf struct {
	DriverName string
	DbUrl      string
	ShowSql    bool
	LogLevel   int64
}

数据库连接配置

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL