Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultStore ¶
type DefaultStore struct {
// contains filtered or unexported fields
}
DefaultStore is a default implementation of the Store interface.
func NewStore ¶
func NewStore(rc *redis.Client) (*DefaultStore, error)
NewStore returns a new DefaultStore.
type GoTimeStatus ¶
type GoTimeStatus struct {
// contains filtered or unexported fields
}
GoTimeStatus posts social status updates from @gotime@changelog.social
func New ¶
func New(s Store, c *http.Client, logger zerolog.Logger, statusMaxAge time.Duration, notify NotifyFunc) (*GoTimeStatus, error)
New constructs a *GoTimeStatus.
statusMaxAge sets the max age of a status to notify on
func (*GoTimeStatus) Poll ¶
func (gt *GoTimeStatus) Poll(ctx context.Context) error
Poll conditionally calls notify if there is a status update from @gotime@changelog.social
For a status to be posted, it needs to be younger than the maxStatusAge this prevents very old statuses from being notified and acts as a safeguard if the last status ID could not be persisted to state storage, and prevents reposts if we lose the last status ID.
type NotifyFunc ¶
NotifyFunc represents the function signature the poller notifies on a new social status. If error is not nil, the item will be retried at some point in the future.