model

package
v0.96.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func CheckFilePart(filePart int32) (err error)

CheckFilePart FILE_PART_INVALID: The file part number is invalid. The value is not between 0 and 2,999.

func CheckFilePartSize

func CheckFilePartSize(partSize int32) (err error)

CheckFilePartSize FILE_PART_SIZE_INVALID - 512KB cannot be evenly divided by part_size

func CheckFileParts

func CheckFileParts(fileParts int32) (err error)

CheckFileParts FILE_PARTS_INVALID - Invalid number of parts. The value is not between 1..3000

func GetFileExtName

func GetFileExtName(filePath string) string

func GetImageMimeType

func GetImageMimeType(ext string) string

func GetMimeTypeByStorageFileTyp

func GetMimeTypeByStorageFileTyp(t *mtproto.Storage_FileType) string

func GetStorageFileTypeConstructor

func GetStorageFileTypeConstructor(extName string) int32

func IsFileExtImage

func IsFileExtImage(ext string) bool

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL