Documentation ¶
Index ¶
- Constants
- func Base64Decode(data string) ([]byte, error)
- func Base64Encode(data string) string
- func CookieAuth(context *gin.Context) (*http.Cookie, error)
- func Fail(context *gin.Context, v interface{})
- func FileServerAddr() string
- func InitSession(engine *gin.Engine)
- func Md5(data string) string
- func SessionGet(context *gin.Context, key interface{}) interface{}
- func SessionSet(context *gin.Context, key, value interface{}) error
- func Sha256(data string) string
- func Success(context *gin.Context, v interface{})
- func UploadFile(fileName string) string
- type Config
- type DatabaseConfig
- type JsonParse
- type Orm
- type RedisConfig
- type RedisStore
Constants ¶
View Source
const ( //成功Code SUCCESS int = 0 FAIL int = 1 )
View Source
const CookieName = "cookie_user"
View Source
const CookieTimeLength = 10 * 60
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
Types ¶
type Config ¶
type Config struct { AppName string `json:"app_name"` AppMode string `json:"app_mode"` AppHost string `json:"app_host"` AppPort string `json:"app_port"` Database DatabaseConfig `json:"database"` Redis RedisConfig `json:"redis"` }
配置结构体
func ParseConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Driver string `json:"driver"` User string `json:"user"` Password string `json:"password"` Host string `json:"host"` Port string `json:"port"` DBName string `json:"db_name"` Charset string `json:"charset"` ShowSql bool `json:"show_sql"` }
数据库配置结构体
type RedisConfig ¶
type RedisConfig struct { Addr string `json:"addr"` Port string `json:"port"` Password string `json:"password"` Db int `json:"db"` }
redis参数配置
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
var Redis RedisStore
Click to show internal directories.
Click to hide internal directories.