Documentation
¶
Index ¶
- Constants
- Variables
- func GetLatest(resp *http.Response) int
- func GetSeq(resp *http.Response) int
- func IsEOS(resp *http.Response) bool
- type Changefeed
- type HTTPError
- type Segment
- type SegmentSubscriber
- type SequenceNonexistent
- type Server
- type Stream
- type TrickleData
- type TrickleLocalPublisher
- type TrickleLocalSubscriber
- type TricklePublisher
- type TrickleServerConfig
- type TrickleSubscriber
Constants ¶
View Source
const CHANGEFEED = "_changes"
Variables ¶
View Source
var EOS = errors.New("End of stream")
View Source
var FirstByteTimeout = errors.New("pending read timeout")
View Source
var StreamNotFoundErr = errors.New("stream not found")
Functions ¶
Types ¶
type Changefeed ¶
type SegmentSubscriber ¶
type SegmentSubscriber struct {
// contains filtered or unexported fields
}
type SequenceNonexistent ¶ added in v0.8.2
func (*SequenceNonexistent) Error ¶ added in v0.8.2
func (e *SequenceNonexistent) Error() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func ConfigureServer ¶
func ConfigureServer(config TrickleServerConfig) *Server
type TrickleLocalPublisher ¶
type TrickleLocalPublisher struct {
// contains filtered or unexported fields
}
func NewLocalPublisher ¶
func NewLocalPublisher(sm *Server, channelName string, mimeType string) *TrickleLocalPublisher
func (*TrickleLocalPublisher) Close ¶
func (c *TrickleLocalPublisher) Close() error
func (*TrickleLocalPublisher) CreateChannel ¶
func (c *TrickleLocalPublisher) CreateChannel()
type TrickleLocalSubscriber ¶
type TrickleLocalSubscriber struct {
// contains filtered or unexported fields
}
func NewLocalSubscriber ¶
func NewLocalSubscriber(sm *Server, channelName string) *TrickleLocalSubscriber
func (*TrickleLocalSubscriber) Read ¶
func (c *TrickleLocalSubscriber) Read() (*TrickleData, error)
type TricklePublisher ¶
type TricklePublisher struct {
// contains filtered or unexported fields
}
TricklePublisher represents a trickle streaming client
func NewTricklePublisher ¶
func NewTricklePublisher(url string) (*TricklePublisher, error)
NewTricklePublisher creates a new trickle stream client
func (*TricklePublisher) Close ¶
func (c *TricklePublisher) Close() error
func (*TricklePublisher) Next ¶ added in v0.8.2
func (c *TricklePublisher) Next() (*pendingPost, error)
type TrickleServerConfig ¶
type TrickleServerConfig struct {
// Base HTTP path for the server
BasePath string
// HTTP mux to use
Mux *http.ServeMux
// Whether to enable the changefeed (default false)
Changefeed bool
// Whether to auto-create channels on first publish (default false)
Autocreate bool
// Amount of time a channel has no new segments before being swept (default 5 minutes)
IdleTimeout time.Duration
// How often to sweep for idle channels (default 1 minute)
SweepInterval time.Duration
}
type TrickleSubscriber ¶
type TrickleSubscriber struct {
// contains filtered or unexported fields
}
TrickleSubscriber represents a trickle streaming reader that always fetches from index -1
func NewTrickleSubscriber ¶
func NewTrickleSubscriber(url string) *TrickleSubscriber
NewTrickleSubscriber creates a new trickle stream reader for GET requests
func (*TrickleSubscriber) Read ¶
func (c *TrickleSubscriber) Read() (*http.Response, error)
Read retrieves data from the current segment and sets up the next segment concurrently. It returns the reader for the current segment's data.
func (*TrickleSubscriber) SetSeq ¶ added in v0.8.2
func (c *TrickleSubscriber) SetSeq(seq int)
Click to show internal directories.
Click to hide internal directories.