Documentation
¶
Overview ¶
Package sse contains utilities for working with server sent events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface {
Close()
CreateStream(id string) *sse.Stream
HTTPHandler(w http.ResponseWriter, r *http.Request)
Publish(id string, event *sse.Event)
}
Server is in charge of managing the streams to which the events are sent to.
type ServerMock ¶
ServerMock is a mocked implementation of event server.
func (*ServerMock) CreateStream ¶
func (s *ServerMock) CreateStream(id string) *sse.Stream
CreateStream mock.
func (*ServerMock) HTTPHandler ¶
func (s *ServerMock) HTTPHandler(w http.ResponseWriter, r *http.Request)
HTTPHandler mock.
type Streamer ¶
type Streamer interface {
http.Handler
io.Closer
TrackPayment(rHash, publicKey string, amount uint64) uint64
}
Streamer is in charge of tracking payments and executing actions based on them.
type StreamerMock ¶
StreamerMock is a mocked implementation of an event streamer.
func NewStreamerMock ¶
func NewStreamerMock() *StreamerMock
NewStreamerMock returns a mocked event streamer.
func (*StreamerMock) ServeHTTP ¶
func (s *StreamerMock) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServerHTTP mock.
func (*StreamerMock) TrackPayment ¶
func (s *StreamerMock) TrackPayment(rHash, publicKey string, amount uint64) uint64
TrackPayment mock.
Click to show internal directories.
Click to hide internal directories.