Documentation ¶
Index ¶
- Variables
- func CacheMake(root string, filename string, level int) string
- func DbClose(dbConfigs ...string)
- func DbInstance(dbConfigs ...string) *gorm.DB
- func GetAllConfig(source ...string) gin.H
- func GetConfig(key string, source ...string) *ini.Key
- func GetGlobal(key string) interface{}
- func GetSectionConfig(baseKey string, source ...string) gin.H
- func HasConfig(key string, source ...string) bool
- func LogError(content string) error
- func LogNotice(content string) error
- func LogRecord(content gin.H, args ...string) error
- func LogWarning(content string) error
- func LogWrite(content string, args ...string) error
- func RedisClose(selectDb ...int)
- func RedisKey(key string, prefix string) string
- func SetGlobal(key string, value interface{}) bool
- func SetGlobalOrExists(key string, value interface{}) bool
- type ApiJsonData
- type Cache
- type CacheInterface
- type Confer
- type Config
- type ConfigsFactory
- type Controller
- func (c *Controller) Assign(key interface{}, data ...interface{})
- func (c *Controller) Error(message string, params ...string)
- func (c *Controller) Fetch(name ...string)
- func (c *Controller) Init(child interface{}) gin.HandlerFunc
- func (*Controller) Initialize()
- func (c *Controller) Success(message string, params ...string)
- type FactoryInterface
- type FactoryUploader
- type Log
- type Logger
- type Redis
- type Request
- func (r *Request) Action() string
- func (r *Request) BaseUrl() string
- func (r *Request) Controller(name ...string) string
- func (r *Request) Domain() string
- func (r *Request) Get(key string, defaultValue ...string) string
- func (r *Request) GetArray(key string) []string
- func (r *Request) GetMap(key string) map[string]string
- func (r *Request) Input() []byte
- func (r *Request) IsAjax() bool
- func (r *Request) IsDelete() bool
- func (r *Request) IsGet() bool
- func (r *Request) IsMobile() bool
- func (r *Request) IsOption() bool
- func (r *Request) IsPage() bool
- func (r *Request) IsPost() bool
- func (r *Request) IsPut() bool
- func (r *Request) IsQQ() bool
- func (r *Request) IsWeChat() bool
- func (r *Request) Lang(name ...string) string
- func (r *Request) Module(name ...string) string
- func (r *Request) Param(key string, defaultValue ...string) string
- func (r *Request) Port() string
- func (r *Request) Post(key string, defaultValue ...string) string
- func (r *Request) PostArray(key string) []string
- func (r *Request) PostJsonBind(T interface{}) interface{}
- func (r *Request) PostJsonMap() map[string]interface{}
- func (r *Request) PostMap(key string) map[string]string
- func (r *Request) Query() string
- func (r *Request) Scheme() string
- func (r *Request) Static(child interface{}, methodName string)
- func (r *Request) StaticWithReturn(child interface{}, method string, params ...interface{}) interface{}
- func (r *Request) Url() string
- type RequestFactory
- type Requester
- type RequesterFactory
- type UploadFactory
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetSectionConfig ¶
factory get section func
func SetGlobalOrExists ¶
set global config value if not exists
Types ¶
type ApiJsonData ¶
type ApiJsonData struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"result"` }
api response json data
func Callback ¶
func Callback(code int, message string, data ...interface{}) *ApiJsonData
require api return format
type CacheInterface ¶
type Confer ¶
type Confer interface { GetAll() gin.H GetSection(baseKey string) gin.H Get(key string) *ini.Key Has(key string) bool }
config object func interface
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
config object type struct
type ConfigsFactory ¶
type ConfigsFactory struct { }
func (*ConfigsFactory) Source ¶
func (*ConfigsFactory) Source(file string) Confer
get config file source
type Controller ¶
func (*Controller) Assign ¶
func (c *Controller) Assign(key interface{}, data ...interface{})
assign template var
func (*Controller) Error ¶
func (c *Controller) Error(message string, params ...string)
error redirect
func (*Controller) Init ¶
func (c *Controller) Init(child interface{}) gin.HandlerFunc
before init handle
func (*Controller) Success ¶
func (c *Controller) Success(message string, params ...string)
success redirect
type FactoryInterface ¶
factory init interface
type FactoryUploader ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
type Logger ¶
type Request ¶
func (*Request) Controller ¶
get current controller name
func (*Request) PostJsonBind ¶
func (r *Request) PostJsonBind(T interface{}) interface{}
post json into struct
func (*Request) PostJsonMap ¶
post json into map
func (*Request) StaticWithReturn ¶
func (r *Request) StaticWithReturn(child interface{}, method string, params ...interface{}) interface{}
reflect call method and return
type RequestFactory ¶
type RequestFactory struct { }
type Requester ¶
type Requester interface { Scheme() string Domain() string Query() string Port() string BaseUrl() string Url() string Module(name ...string) string Controller(name ...string) string Action() string Lang(name ...string) string Get(key string, defaultValue ...string) string GetArray(key string) []string GetMap(key string) map[string]string Post(key string, defaultValue ...string) string PostArray(key string) []string Input() []byte PostMap(key string) map[string]string PostJsonMap() map[string]interface{} PostJsonBind(T interface{}) interface{} Param(key string, defaultValue ...string) string IsAjax() bool IsPage() bool IsGet() bool IsPost() bool IsPut() bool IsDelete() bool IsOption() bool IsMobile() bool IsWeChat() bool IsQQ() bool Static(child interface{}, methodName string) StaticWithReturn(child interface{}, methodName string, params ...interface{}) interface{} }
type RequesterFactory ¶
type UploadFactory ¶
type UploadFactory struct {
// contains filtered or unexported fields
}
*
@auth CrastGin @date 2020-10
func (*UploadFactory) Save ¶
func (u *UploadFactory) Save(file *multipart.FileHeader) bool
upload file
func (*UploadFactory) SaveMultipart ¶
func (u *UploadFactory) SaveMultipart(form *multipart.Form) bool
upload multipart files
Source Files ¶
Click to show internal directories.
Click to hide internal directories.