Versions in this module Expand all Collapse all v1 v1.0.2 Nov 25, 2023 v1.0.1 Sep 19, 2022 Changes in this version + const ContentType + var ErrContentType = errors.New("eventsource: the content type of the stream is not allowed") + var ErrUnauthorized = errors.New("eventsource: connection is unauthorized") + type EventSource struct + func New(url string, requestModifiers ...RequestModifier) (*EventSource, error) + func (es *EventSource) Close() + func (es *EventSource) MessageEvents() <-chan *base.MessageEvent + func (es *EventSource) ReadyState() <-chan Status + func (es *EventSource) URL() string + type ReadyState uint16 + const Closed + const Connecting + const Open + func (i ReadyState) String() string + type RequestModifier func(r *http.Request) + func WithBasicAuth(username, password string) RequestModifier + func WithBearerTokenAuth(token string) RequestModifier + type Status struct + Err error + ReadyState ReadyState + func (s *Status) Error() string