Documentation
¶
Index ¶
- type AggregateFunc
- type Entries
- type Filter
- type FilterFunc
- type Period
- type PollFunc
- type Poller
- func (p *Poller[T, AggregateT]) Get(filter Filter) ([]*T, bool)
- func (p *Poller[T, AggregateT]) GetLastResult() *T
- func (p *Poller[T, AggregateT]) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (p *Poller[T, AggregateT]) Start()
- func (p *Poller[T, AggregateT]) WithResultFilter(filter FilterFunc[T]) *Poller[T, AggregateT]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateFunc ¶
type Entries ¶
type Entries[T any] struct { // contains filtered or unexported fields }
func (*Entries[T]) MarshalJSON ¶
func (*Entries[T]) UnmarshalJSON ¶
type FilterFunc ¶
type Period ¶
type Poller ¶
func (*Poller[T, AggregateT]) GetLastResult ¶
func (p *Poller[T, AggregateT]) GetLastResult() *T
func (*Poller[T, AggregateT]) ServeHTTP ¶
func (p *Poller[T, AggregateT]) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves the data for the given period.
If the period is not specified, it serves the last result.
If the period is specified, it serves the data for the given period.
If the period is invalid, it returns a 400 error.
If the data is not found, it returns a 204 error.
If the request is a websocket request, it serves the data for the given period for every interval.
func (*Poller[T, AggregateT]) WithResultFilter ¶
func (p *Poller[T, AggregateT]) WithResultFilter(filter FilterFunc[T]) *Poller[T, AggregateT]
Click to show internal directories.
Click to hide internal directories.