Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker is the event message broker
func ListenAndServeOnSocket ¶
ListenAndServeOnSocket starts a minimal server (mostly for testing) listening at the given unix socket path.
type ErrInvalidTopic ¶
type ErrInvalidTopic string
ErrInvalidTopic is the error raised when topic is invalid
func (ErrInvalidTopic) Error ¶
func (e ErrInvalidTopic) Error() string
type ErrNotAuthorized ¶
type ErrNotAuthorized string
ErrNotAuthorized is the error raised when the user isn't authorized
func (ErrNotAuthorized) Error ¶
func (e ErrNotAuthorized) Error() string
type Interceptor ¶
type Interceptor struct { // Do is the body of the http handler -- required Do http.HandlerFunc // Pre is called to before actual subscription to a topic happens. // This is the hook where validation and authentication / authorization checks happen. Pre func(topic string, headers map[string][]string) error // Post is called when the client disconnects. This is optional. Post func(topic string) }
Interceptor implements http Handler and is used to intercept incoming requests to subscribe to topics and perform some validations before allowing the subscription to be established. Tasks that the interceptor can do include authn and authz, topic validation, etc.
func (*Interceptor) ServeHTTP ¶
func (i *Interceptor) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP calls the before and after subscribe methods.
Click to show internal directories.
Click to hide internal directories.