Documentation ¶
Index ¶
- Variables
- func AskFile(requester Request) (respStatusCode int, respBytes io.ReadCloser, respHeader http.Header, err error)
- func CalculateByteMd5(b []byte) (string, error)
- func CalculateFileMd5(filename string) (string, error)
- func CheckDownloadSignature(date, expire, bucket, objectName, signature string) bool
- func CheckFileRespStatus(resp *http.Response) (io.ReadCloser, http.Header, error)
- func CheckUploadSignature(date, expire, signature string) bool
- func CheckValid(uidStr, date, expireStr string) (int64, error, string)
- func DetectContentType(fileName string) (string, error)
- func GenDownloadSignature(uid int64, srcName, bucket, objectName, expire, date, signature string) string
- func GenDownloadSingle(meta models.MetaDataInfo, expire string, respChan chan models.GenDownloadResp, ...)
- func GenUploadSignature(uid, date string, expire int, signature string) string
- func GenUploadSingle(filename string, expire int, respChan chan models.GenUploadResp, ...)
- func GetClientIp() (string, error)
- func GetExtension(filename string) string
- func GetOutBoundIP() (string, error)
- func GetRange(rangeHeader string, size int64) (int64, int64)
- func InTurnPrint(filename string) string
- func InitSnowFlake()
- func NewServiceRegister() *serviceRegister
- func Query(values map[string][]string, name string) string
- type RedisLock
- type Request
- type Response
- type Service
- type Snowflake
- type Uid
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Client *http.Client //HTTPClient
)
Functions ¶
func AskFile ¶
func AskFile(requester Request) (respStatusCode int, respBytes io.ReadCloser, respHeader http.Header, err error)
AskFile 建立http请求,返回header信息
func CheckDownloadSignature ¶
func CheckFileRespStatus ¶
CheckFileRespStatus 状态检查
func CheckUploadSignature ¶
func DetectContentType ¶
func GenDownloadSignature ¶
func GenDownloadSingle ¶
func GenDownloadSingle(meta models.MetaDataInfo, expire string, respChan chan models.GenDownloadResp, wg *sync.WaitGroup)
func GenUploadSignature ¶
func GenUploadSingle ¶
func GenUploadSingle(filename string, expire int, respChan chan models.GenUploadResp, metaDataInfoChan chan models.MetaDataInfo, wg *sync.WaitGroup)
GenUploadSingle .
func GetExtension ¶
func NewServiceRegister ¶
func NewServiceRegister() *serviceRegister
Types ¶
type RedisLock ¶
type RedisLock struct {
// contains filtered or unexported fields
}
A RedisLock is a redis lock.
func NewRedisLock ¶
NewRedisLock returns a RedisLock.
type Response ¶
type Response struct { Code int `json:"code"` Msg string `json:"message"` Data json.RawMessage `json:"data"` Total int64 `json:"total,omitempty"` }
Click to show internal directories.
Click to hide internal directories.