dao

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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CachedTypeSize            = 0
	CachedTypePathSize        = 1
	CachedTypeStrippedSize    = 2
	CachedTypeCachedSize      = 3
	CachedTypeSizeProgressive = 4
)

Variables

View Source
var (
	GenCacheDocumentKey   = genCacheDocumentKey
	ParseCacheDocumentKey = parseCacheDocumentKey
)
View Source
var (
	GetPhotoSize = getPhotoSize
)

Functions

This section is empty.

Types

type CachePhotoData added in v0.90.1

type CachePhotoData struct {
	Id            int64                      `json:"id"`
	Photo         *dataobject.PhotosDO       `json:"photo"`
	SizeList      []*dataobject.PhotoSizesDO `json:"size_list"`
	VideoSizeList []*dataobject.VideoSizesDO `json:"video_size_list"`
}

func (*CachePhotoData) ToPhoto added in v0.90.1

func (c *CachePhotoData) ToPhoto() *mtproto.Photo

func (*CachePhotoData) ToPhotoSizeList added in v0.90.1

func (c *CachePhotoData) ToPhotoSizeList() *media.PhotoSizeList

func (*CachePhotoData) ToSizes added in v0.90.1

func (c *CachePhotoData) ToSizes() []*mtproto.PhotoSize

func (*CachePhotoData) ToVideoSizeList added in v0.90.1

func (c *CachePhotoData) ToVideoSizeList() *media.VideoSizeList

func (*CachePhotoData) ToVideoSizes added in v0.90.1

func (c *CachePhotoData) ToVideoSizes() []*mtproto.VideoSize

type Dao

type Dao struct {
	*Mysql
	sqlc.CachedConn
	dfs_client.DfsClient
}

func New

func New(c config.Config) *Dao

func (*Dao) GetCachePhotoData added in v0.90.1

func (m *Dao) GetCachePhotoData(ctx context.Context, photoId int64) (*CachePhotoData, error)

func (*Dao) GetDocumentById

func (m *Dao) GetDocumentById(ctx context.Context, id int64) *mtproto.Document

func (*Dao) GetDocumentListByIdList added in v0.86.3

func (m *Dao) GetDocumentListByIdList(ctx context.Context, idList []int64) []*mtproto.Document

func (*Dao) GetPhotoSizeListList

func (m *Dao) GetPhotoSizeListList(ctx context.Context, idList []int64) (sizes map[int64][]*mtproto.PhotoSize)

func (*Dao) GetPhotoSizeListV2

func (m *Dao) GetPhotoSizeListV2(ctx context.Context, sizeId int64) (sizes []*mtproto.PhotoSize)

func (*Dao) GetPhotoV2

func (m *Dao) GetPhotoV2(ctx context.Context, photoId int64) (*mtproto.Photo, error)

func (*Dao) GetVideoSizeList

func (m *Dao) GetVideoSizeList(ctx context.Context, sizeId int64) (sizes []*mtproto.VideoSize)

func (*Dao) GetVideoSizeListList added in v0.86.3

func (m *Dao) GetVideoSizeListList(ctx context.Context, idList []int64) (sizes map[int64][]*mtproto.VideoSize)

func (*Dao) MakeDocumentByDO added in v0.90.1

func (m *Dao) MakeDocumentByDO(
	ctx context.Context,
	document *mtproto.Document,
	id int64,
	do *dataobject.DocumentsDO,
	thumbs []*mtproto.PhotoSize,
	videoThumbs []*mtproto.VideoSize)

MakeDocumentByDO

document#1e87342b flags:#

id:long
access_hash:long
file_reference:bytes
date:int
mime_type:string
size:int
thumbs:flags.0?Vector<PhotoSize>
video_thumbs:flags.1?Vector<VideoSize>
dc_id:int
attributes:Vector<DocumentAttribute> = Document;

func (*Dao) SaveDocumentV2

func (m *Dao) SaveDocumentV2(ctx context.Context, fileName string, document *mtproto.Document)

func (*Dao) SavePhotoSizeV2

func (m *Dao) SavePhotoSizeV2(ctx context.Context, szId int64, szList []*mtproto.PhotoSize) error

func (*Dao) SavePhotoV2

func (m *Dao) SavePhotoV2(ctx context.Context, id, accessHash int64, hasStickers, hasVideo bool, fileName string) error

func (*Dao) SaveVideoSizeV2

func (m *Dao) SaveVideoSizeV2(ctx context.Context, szId int64, szList []*mtproto.VideoSize) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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