Documentation
¶
Index ¶
- func CheckScene(scene string, scenes []string) (bool, error)
- func Contains(target []string, sub string) bool
- func Contains_TO_remove(obj interface{}, objContainer interface{}) booldeprecated
- func CopyFile(src, dst string) (int64, error)
- func CopyfileRemove(src, dst string) (int64, error)
- func CreateDirectories(dir string, perm os.FileMode) error
- func CrossOrigin(ctx *gin.Context)
- func DownloadFileToResponse(url string, ctx *gin.Context)
- func Exist(filename string) bool
- func ExpandFilename(filename string) string
- func FileAndExists(fileName string) bool
- func FileExists(fileName string) bool
- func FormatTimeByDay(t time.Time) string
- func FormatTimeByHour(t time.Time) string
- func GetClientIp(r *http.Request) string
- func GetDayFromTimeStamp(timeStamp int64) string
- func GetFileMd5(file *os.File) string
- func GetFileServerRunningAbsDir(appName string) (path string, err error)
- func GetFileSha1Sum(file *os.File) string
- func GetFileSum(file *os.File, alg string) string
- func GetFileSumByName(filepath string, alg string) (string, error)
- func GetPublicIP() string
- func GetRequestURI(action string) string
- func GetServerURI(r *http.Request) string
- func GetUUID() string
- func GetUUIDOp() string
- func HumanSize(size float64) string
- func InsideContainer() (bool, error)
- func JsonEncodePretty(o interface{}) string
- func MD5(str string) string
- func MapSetToStr(set mapSet.Set, sep string) string
- func Match(matcher string, content string) []string
- func NotPermit(w http.ResponseWriter)
- func RandInt(min, max int) int
- func ReadFile(path string) ([]byte, error)
- func ReadFileByOffSet(filepath string, offset int64, length int) ([]byte, error)
- func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error)
- func RemoveEmptyDir(pathName string)
- func ResizeImage(w http.ResponseWriter, fullPath string, width, height uint)
- func ResizeImageByBytes(w http.ResponseWriter, data []byte, width, height uint)
- func SetDownloadHeader(ctx *gin.Context)
- func StrToMapSet(str string, sep string) mapSet.Set
- func Today() string
- func UrlDecodeToMap(body string) (map[string]string, error)
- func UrlEncode(v interface{}) string
- func UrlEncodeFromMap(m map[string]string) string
- func WriteBinFile(path string, data []byte) bool
- func WriteFile(path string, data string) bool
- func WriteFileByOffSet(filepath string, offset int64, data []byte) error
- type CommonMap
- func (cMap *CommonMap) Add(key string)
- func (cMap *CommonMap) AddCount(key string, count int)
- func (cMap *CommonMap) AddCountInt64(key string, count int64) int64
- func (cMap *CommonMap) AddUniq(key string)
- func (cMap *CommonMap) Clear()
- func (cMap *CommonMap) Contains(i ...interface{}) bool
- func (cMap *CommonMap) Get() map[string]interface{}
- func (cMap *CommonMap) GetValue(k string) (interface{}, bool)
- func (cMap *CommonMap) IsLock(k string) bool
- func (cMap *CommonMap) Iter() <-chan Tuple
- func (cMap *CommonMap) Keys() []string
- func (cMap *CommonMap) LockKey(k string)
- func (cMap *CommonMap) Put(k string, v interface{})
- func (cMap *CommonMap) Remove(key string)
- func (cMap *CommonMap) UnLockKey(k string)
- func (cMap *CommonMap) Zero()
- type Mail
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains_TO_remove
deprecated
func Contains_TO_remove(obj interface{}, objContainer interface{}) bool
Deprecated:
func CopyfileRemove ¶
CopyFile copies from src to dst until either EOF is reached on src or an error occurs. It verifies src exists and removes the dst if it exists.
func CreateDirectories ¶
CreateDirectories creates directories for storing photos, metadata and cache files.
func DownloadFileToResponse ¶
DownloadFileToResponse
func ExpandFilename ¶
Returns full path of a file, "~" is replaced with home directory
func FileAndExists ¶
FileAndExists check is the file exists, not dir
func FileExists ¶
func FormatTimeByDay ¶
func FormatTimeByHour ¶
func GetClientIp ¶
func GetDayFromTimeStamp ¶
func GetFileMd5 ¶
func GetFileSha1Sum ¶
func GetPublicIP ¶
func GetPublicIP() string
func GetRequestURI ¶
GetRequestURI returns the request url, if group-manage is enable, add the group info to req url
func InsideContainer ¶
InsideContainer check if running inside container
func JsonEncodePretty ¶
func JsonEncodePretty(o interface{}) string
func ReadFileByOffSet ¶
func ReadLinesOffsetN ¶
ReadLinesOffsetN reads contents from file and splits them by new line. The offset tells at which line number to start. The count determines the number of lines to read (starting from offset):
n >= 0: at most n lines n < 0: whole file
func RemoveEmptyDir ¶
func RemoveEmptyDir(pathName string)
func ResizeImage ¶
func ResizeImage(w http.ResponseWriter, fullPath string, width, height uint)
ResizeImage
func ResizeImageByBytes ¶
func ResizeImageByBytes(w http.ResponseWriter, data []byte, width, height uint)
ResizeImageByBytes
func SetDownloadHeader ¶
SetDownloadHeader add download info to header
func UrlEncodeFromMap ¶
func WriteBinFile ¶
Types ¶
type CommonMap ¶
type CommonMap struct {
// contains filtered or unexported fields
}
func NewCommonMap ¶
func NewCommonMap() *CommonMap