Documentation
¶
Overview ¶
Package telegram provides a telegram access layer
Index ¶
- Variables
- func LoadFs(access *confpar.Access, logger *slog.Logger) (afero.Fs, error)
- type File
- func (f *File) Close() error
- func (f *File) Name() string
- func (f *File) Read(b []byte) (int, error)
- func (f *File) ReadAt(_ []byte, _ int64) (int, error)
- func (f *File) Readdir(_ int) ([]os.FileInfo, error)
- func (f *File) Readdirnames(_ int) ([]string, error)
- func (f *File) Seek(_ int64, _ int) (int64, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) Sync() error
- func (f *File) Truncate(_ int64) error
- func (f *File) Write(b []byte) (int, error)
- func (f *File) WriteAt(b []byte, off int64) (int, error)
- func (f *File) WriteString(s string) (int, error)
- type FileData
- type FileInfo
- type Fs
- func (m *Fs) Chmod(name string, mode os.FileMode) error
- func (m *Fs) Chown(string, int, int) error
- func (m *Fs) Chtimes(name string, atime, mtime time.Time) error
- func (m *Fs) Create(name string) (afero.File, error)
- func (m *Fs) LstatIfPossible(name string) (os.FileInfo, bool, error)
- func (m *Fs) Mkdir(name string, mode os.FileMode) error
- func (m *Fs) MkdirAll(name string, mode os.FileMode) error
- func (m *Fs) Name() string
- func (m *Fs) Open(name string) (afero.File, error)
- func (m *Fs) OpenFile(name string, flag int, mode os.FileMode) (afero.File, error)
- func (m *Fs) Remove(name string) error
- func (m *Fs) RemoveAll(name string) error
- func (m *Fs) Rename(name string, newname string) error
- func (m *Fs) Stat(name string) (os.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidParameter = errors.New("invalid parameter")
ErrInvalidParameter is returned when a parameter is invalid
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when something is not found
View Source
var ErrNotImplemented = errors.New("not implemented")
ErrNotImplemented is returned when something is not implemented
Functions ¶
Types ¶
type File ¶
type File struct {
// Path is the file path
Path string
// Content is the file content
Content []byte
// Fs is the parent Fs
Fs *Fs
// At is the current position in the file
At int64
}
File is the afero.File implementation
func (*File) Readdirnames ¶
Readdirnames is not implemented
type FileData ¶
type FileData struct {
// contains filtered or unexported fields
}
FileData is a simple structure to store file information and implement os.FileInfo interface
type Fs ¶
type Fs struct {
// Bot is the telegram bot instance
Bot *tele.Bot
// ChatID is the telegram chat ID to send files to
ChatID int64
// Logger is the logger, obviously
Logger *slog.Logger
// contains filtered or unexported fields
}
Fs is a write-only afero.Fs implementation using telegram as backend
func (*Fs) LstatIfPossible ¶
LstatIfPossible is not implemented
Click to show internal directories.
Click to hide internal directories.