Documentation ¶
Index ¶
- func DoUploadedPhotoFile(src *PhotoFile, extName string, srcData []byte, isABC bool, ...) error
- func InitCacheFS(dataPath string) error
- func NewCacheFile(creatorId, fileId int64) *cacheFile
- func ReadFileOffsetData(filePath string, offset int32, limit int32) ([]byte, error)
- type DocumentFile
- type PhotoFile
- type PhotoInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoUploadedPhotoFile ¶
func DoUploadedPhotoFile(src *PhotoFile, extName string, srcData []byte, isABC bool, cb func(pi *PhotoInfo)) error
TODO(@benqi):
我们未来的图片存储系统可能会按facebook的Haystack论文来实现 mtproto协议也定义了一套自己的文件存储方案,fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation; 在这里,我们重新定义mtproto的volume_id和local_id,对应Haystack的key和alternate_key,secret对应cookie 在当前简单实现里,volume_id由sonwflake生成,local_id对应于图片类型,secret为access_hash
TODO(@benqi):
参数使用mtproto.File
func InitCacheFS ¶
func NewCacheFile ¶
func NewCacheFile(creatorId, fileId int64) *cacheFile
Types ¶
type DocumentFile ¶
func CreateDocumentFile ¶
func CreateDocumentFile(fileId, accessHash int64) (d *DocumentFile, err error)
func NewDocumentFile ¶
func NewDocumentFile(fileId, accessHash int64) *DocumentFile
func (*DocumentFile) Close ¶
func (f *DocumentFile) Close()
func (*DocumentFile) ReadData ¶
func (f *DocumentFile) ReadData(offset int32, limit int32) ([]byte, error)
func (*DocumentFile) Sync ¶
func (f *DocumentFile) Sync()
func (*DocumentFile) ToFilePath ¶
func (f *DocumentFile) ToFilePath() string
func (*DocumentFile) ToFilePath2 ¶
func (f *DocumentFile) ToFilePath2() string
type PhotoFile ¶
type PhotoFile struct {
// contains filtered or unexported fields
}
func (*PhotoFile) ToFilePath ¶
func (*PhotoFile) ToFilePath2 ¶
func (*PhotoFile) WritePhotoFile ¶
Click to show internal directories.
Click to hide internal directories.