Documentation
¶
Index ¶
- Constants
- Variables
- func Listening(app *iris.Application)
- func Load(app *iris.Application, configPath string)
- func LoadConf(path ...string)
- func LoadMysql()
- func LoadRedis()
- func LogError(msg string, data interface{})
- func LogInfo(msg string, data interface{})
- func MySqlDefault() *gorm.DB
- func NewRedisConn(conn *redis.Client) *redisConn
- func RedisConn() *redisConn
- func RedisDefault() *redis.Client
- type Api
- type ApiInterface
- type App
- type Base
- func (this *Base) CancelMustJsonParam()
- func (this *Base) CryptReceive() []byte
- func (this *Base) CryptSend(data []byte)
- func (this *Base) Ctx() iris.Context
- func (this *Base) DB() *gorm.DB
- func (this *Base) Init(data interface{})
- func (this *Base) InitAndBackParam(data interface{}) (param map[string]interface{})
- func (this *Base) Key() (rsa []byte)
- func (this *Base) MyId() uint32
- func (this *Base) MyIdToString() string
- func (this *Base) Page() int64
- func (this *Base) PageSize() int64
- func (this *Base) Redis() *redis.Client
- func (this *Base) ReplaceParamColumn(data, old interface{}, requestParam map[string]interface{}) map[string]interface{}
- func (this *Base) SetMyId(id uint32)
- func (this *Base) Skip() int64
- func (this *Base) Success()
- func (this *Base) SuccessWithData(data interface{})
- func (this *Base) SuccessWithList(list interface{}, total interface{})
- func (this *Base) Token() (token string)
- func (this *Base) ValidateParam(data interface{})
- type DbInfo
- type ErrorLevel
- type Message
- type Microservices
- type Redis
- type ResJson
- type ResSign
- type SysConfig
- type UpBase
- type Wechat
Constants ¶
View Source
const ( ResponseTypeJson = 1 ResponseTypeXml = 3 CodeSuccess = 0 )
Variables ¶
View Source
var Config conf
View Source
var DB *gorm.DB
View Source
var ErrLevel = map[ErrorLevel]string{ LogLevelInfo: "info", LogLevelError: "error", }
Functions ¶
func MySqlDefault ¶
func NewRedisConn ¶
func NewRedisConn(conn *redis.Client) *redisConn
func RedisDefault ¶
func RedisDefault() *redis.Client
Types ¶
type ApiInterface ¶
type ApiInterface interface {
Handler() int
}
type Base ¶
type Base struct { Method string `json:"-"` Path string `json:"-"` Time time.Time `json:"-"` TimeStamp int64 `json:"-"` // 参数签名 RandomStr string `valid:"length(32|32)"` SignAt int64 `valid:"timestamp"` Sign string `valid:"-"` // contains filtered or unexported fields }
func (*Base) CancelMustJsonParam ¶
func (this *Base) CancelMustJsonParam()
func (*Base) InitAndBackParam ¶
InitAndBackParam Init返回前端传回的参数
func (*Base) MyIdToString ¶ added in v0.9.5
func (*Base) ReplaceParamColumn ¶
func (*Base) SuccessWithData ¶
func (this *Base) SuccessWithData(data interface{})
func (*Base) SuccessWithList ¶
func (this *Base) SuccessWithList(list interface{}, total interface{})
type DbInfo ¶ added in v0.9.2
type DbInfo struct { Host string `yaml:"host"` Port string `yaml:"port"` Database string `yaml:"database"` UserName string `yaml:"username"` Password string `yaml:"password"` MaxIdleConn int `yaml:"maxIdleConn"` MaxOpenConn int `yaml:"maxOpenConn"` ConnMaxIdleTime int `yaml:"connMaxIdleTime"` ConnMaxLifetime int `yaml:"connMaxLifetime"` }
type ErrorLevel ¶ added in v0.2.0
type ErrorLevel int
const ( LogLevelInfo ErrorLevel = 1 + iota LogLevelError LogDriverConsole LogDriverLocal LogDriverServer )
type Microservices ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.