Documentation ¶
Index ¶
- Variables
- func AddFileToS3(s *session.Session, bucket, key, filePath string) error
- func CloseBackupDB()
- func CloseMainDB()
- func CloseRedisPools()
- func GetRealIp(context echo.Context) (ip string)
- func GetRedisConn(redisName string) redis.Conn
- func InitAwsS3Config()
- func InitBackupDB()
- func InitMainDB()
- func InitQiniuConfig()
- func InitRedisPools()
- func RandStringRunes(n int) string
- func UploadFileToQiniu(bucket, key, filePath string) error
- func UploadFileToS3(bucket, key, filePath string) error
- type ArrayBodyStruct
- type ArrayDataResponse
- type ConfigEnv
- type GormDB
- type MyPutRet
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RailsCachePool *redis.Pool DatePool *redis.Pool TickerPool *redis.Pool KLinePool *redis.Pool LimitPool *redis.Pool )
View Source
var ( SuccessResponse = Response{Head: map[string]string{"code": "1000", "msg": "Success."}} ArrayResponse = ArrayDataResponse{Head: map[string]string{"code": "1000", "msg": "Success."}} )
View Source
var (
MainDb, BackupDb *gorm.DB
)
View Source
var QiniuConfig map[string]string
View Source
var S3Config map[string]string
Functions ¶
func AddFileToS3 ¶
AddFileToS3 will upload a single file to S3, it will require a pre-built aws session and will set file info like content type and encryption on the uploaded file.
func CloseBackupDB ¶
func CloseBackupDB()
func CloseMainDB ¶
func CloseMainDB()
func CloseRedisPools ¶
func CloseRedisPools()
func GetRedisConn ¶
func InitAwsS3Config ¶
func InitAwsS3Config()
func InitBackupDB ¶
func InitBackupDB()
func InitMainDB ¶
func InitMainDB()
func InitQiniuConfig ¶
func InitQiniuConfig()
func InitRedisPools ¶
func InitRedisPools()
func RandStringRunes ¶
func UploadFileToQiniu ¶
func UploadFileToS3 ¶
Types ¶
type ArrayBodyStruct ¶
type ArrayDataResponse ¶
type ArrayDataResponse struct { Head map[string]string `json:"head"` Body interface{} `json:"body"` }
func (*ArrayDataResponse) Init ¶
func (arrayResponse *ArrayDataResponse) Init(data interface{}, page, count, per_page int)
type ConfigEnv ¶
type ConfigEnv struct {
// contains filtered or unexported fields
}
func (*ConfigEnv) GetDuration ¶
type GormDB ¶
func BackupDbBegin ¶
func BackupDbBegin() *GormDB
func MainDbBegin ¶
func MainDbBegin() *GormDB
func (*GormDB) DbRollback ¶
func (c *GormDB) DbRollback()
Click to show internal directories.
Click to hide internal directories.