Documentation ¶
Overview ¶
Package file contains file service implementation for tgtest server.
Index ¶
- type File
- type InMemory
- type Service
- func (m *Service) OnMessage(server *tgtest.Server, req *tgtest.Request) error
- func (m *Service) Register(dispatcher *tgtest.Dispatcher)
- func (m *Service) UploadGetFile(ctx context.Context, request *tg.UploadGetFileRequest) (tg.UploadFileClass, error)
- func (m *Service) UploadGetFileHashes(ctx context.Context, request *tg.UploadGetFileHashesRequest) ([]tg.FileHash, error)
- func (m *Service) UploadSaveBigFilePart(ctx context.Context, request *tg.UploadSaveBigFilePartRequest) (bool, error)
- func (m *Service) UploadSaveFilePart(ctx context.Context, request *tg.UploadSaveFilePartRequest) (bool, error)
- func (m *Service) WitHashPartSize(hashPartSize int) *Service
- func (m *Service) WitHashRangeSize(hashRangeSize int) *Service
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File interface { io.ReaderAt io.WriterAt io.Closer PartSize() int SetPartSize(v int) Size() int }
File represents Telegram file.
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory is a inmemory implementation of file storage.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a Telegram file service.
func (*Service) Register ¶
func (m *Service) Register(dispatcher *tgtest.Dispatcher)
Register registers service handlers.
func (*Service) UploadGetFile ¶
func (m *Service) UploadGetFile(ctx context.Context, request *tg.UploadGetFileRequest) (tg.UploadFileClass, error)
func (*Service) UploadGetFileHashes ¶
func (*Service) UploadSaveBigFilePart ¶
func (*Service) UploadSaveFilePart ¶
func (*Service) WitHashPartSize ¶
WitHashPartSize sets size of part to use in tg.FileHash. Must be valid part size.
func (*Service) WitHashRangeSize ¶
WitHashRangeSize sets size of range to return in upload.getFileHashes.
Click to show internal directories.
Click to hide internal directories.