Documentation
¶
Overview ¶
Package updatepoller provides a long-polling mechanism for receiving updates from the Telegram Bot API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OffsetStore ¶
type OffsetStore interface {
// Load loads the offset from the store.
Load(ctx context.Context) (int, error)
// Save saves the offset to the store.
Save(ctx context.Context, offset int) error
}
OffsetStore is an interface for storing and loading the update offset.
type OptOptionsSetter ¶
type OptOptionsSetter func(o *Options)
func WithOffsetStore ¶
func WithOffsetStore(opt OffsetStore) OptOptionsSetter
offsetStore is the store to use for storing the update offset.
func WithPollingInterval ¶
func WithPollingInterval(opt time.Duration) OptOptionsSetter
pollingInterval is the interval between polling requests.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is the options for the Poller.
func NewOptions ¶
func NewOptions( client client.ClientWithResponsesInterface, options ...OptOptionsSetter, ) Options
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller polls the Telegram API for updates.
func (*Poller) UpdateChan ¶
UpdateChan returns the updates channel.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package offsetstore provides implementations for storing the update offset.
|
Package offsetstore provides implementations for storing the update offset. |
Click to show internal directories.
Click to hide internal directories.