Documentation ¶
Overview ¶
Package file contains file service implementation for tgtest server.
Index ¶
- type Config
- 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)
- 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 an 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 ¶
Click to show internal directories.
Click to hide internal directories.