Documentation ¶
Index ¶
- Variables
- func CheckFilePart(filePart int32) (err error)
- func CheckFilePartSize(partSize int32) (err error)
- func CheckFileParts(fileParts int32) (err error)
- func GetFileExtName(filePath string) string
- func GetImageMimeType(ext string) string
- func GetMimeTypeByStorageFileTyp(t *mtproto.Storage_FileType) string
- func GetStorageFileTypeConstructor(extName string) int32
- func IsFileExtImage(ext string) bool
- func MakeStorageFileType(c int32) *mtproto.Storage_FileType
- type DfsFileInfo
- type DfsHttpFileInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ImageExtensions = [5]string{".jpg", ".jpeg", ".gif", ".bmp", ".png"} ImageMimeTypes = map[string]string{".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"} )
Functions ¶
func CheckFilePart ¶
CheckFilePart FILE_PART_INVALID: The file part number is invalid. The value is not between 0 and 2,999.
func CheckFilePartSize ¶
CheckFilePartSize FILE_PART_SIZE_INVALID - 512KB cannot be evenly divided by part_size
func CheckFileParts ¶
CheckFileParts FILE_PARTS_INVALID - Invalid number of parts. The value is not between 1..3000
func GetFileExtName ¶
func GetImageMimeType ¶
func GetMimeTypeByStorageFileTyp ¶
func GetMimeTypeByStorageFileTyp(t *mtproto.Storage_FileType) string
func IsFileExtImage ¶
func MakeStorageFileType ¶
func MakeStorageFileType(c int32) *mtproto.Storage_FileType
Types ¶
type DfsFileInfo ¶
type DfsFileInfo struct { Creator int64 `json:"creator"` FileId int64 `json:"file_id"` Big bool `json:"big"` FileName string `json:"file_name"` FileTotalParts int `json:"file_total_parts"` FirstFilePartSize int `json:"first_file_part_size"` FilePartSize int `json:"file_part_size"` LastFilePartSize int `json:"last_file_part_size"` MimeType string `json:"mime_type"` Mtime int64 `json:"mtime"` }
func (*DfsFileInfo) GetFileSize ¶
func (m *DfsFileInfo) GetFileSize() int64
func (*DfsFileInfo) ToArgs ¶
func (m *DfsFileInfo) ToArgs() map[string]string
type DfsHttpFileInfo ¶
type DfsHttpFileInfo struct { io.ReadSeeker Name string Modtime time.Time }
Click to show internal directories.
Click to hide internal directories.