Documentation
¶
Index ¶
- type Client
- type Event
- type NotificationHandler
- type PollClient
- func (c *PollClient) Ack(ctx context.Context, traceIDs []string) error
- func (c *PollClient) Poll(ctx context.Context, cursor int64, limit int32) (*PollResponse, error)
- func (c *PollClient) PollAll(ctx context.Context, ch chan<- storage.Notification) (int, error)
- func (c *PollClient) SetAPIKey(apiKey string)
- type PollResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type NotificationHandler ¶
type NotificationHandler func(notification storage.Notification)
type PollClient ¶
type PollClient struct {
// contains filtered or unexported fields
}
func NewPollClient ¶
func NewPollClient(baseURL string, tokenSource oauth2.TokenSource, sessionID string, apiKey string) *PollClient
func (*PollClient) Poll ¶
func (c *PollClient) Poll(ctx context.Context, cursor int64, limit int32) (*PollResponse, error)
Poll fetches unacknowledged notifications using cursor-based pagination. Pass cursor=0 for the first page. Returns notifications with id > cursor.
func (*PollClient) PollAll ¶
func (c *PollClient) PollAll(ctx context.Context, ch chan<- storage.Notification) (int, error)
PollAll fetches all unacknowledged notifications by paginating until exhausted. Sends notifications to the provided channel as they are fetched. Returns total count fetched, or error. Closes channel when done or on error.
func (*PollClient) SetAPIKey ¶
func (c *PollClient) SetAPIKey(apiKey string)
type PollResponse ¶
type PollResponse struct {
Notifications []storage.Notification `json:"notifications"`
}
Click to show internal directories.
Click to hide internal directories.