Documentation
¶
Index ¶
- func ConfigureRoutes(in RoutesIn)
- func DecodeEvent(_ context.Context, r *http.Request) (interface{}, error)
- func EncodeError(getLogger GetLoggerFunc) kithttp.ErrorEncoder
- func EncodeResponseCode(statusCode int) kithttp.EncodeResponseFunc
- func NewEventHandler(e endpoint.Endpoint, getLogger GetLoggerFunc) http.Handler
- func Provide() fx.Option
- type BadRequestErr
- type Config
- type Endpoints
- type EndpointsDecodeIn
- type GetLoggerFunc
- type Handler
- type RoutesIn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureRoutes ¶
func ConfigureRoutes(in RoutesIn)
ConfigureRoutes sets up the router provided to handle traffic for the events parsing endpoint.
func DecodeEvent ¶
DecodeEvent decodes the request body into a wrp.Message type.
func EncodeError ¶
func EncodeError(getLogger GetLoggerFunc) kithttp.ErrorEncoder
EncodeError logs the error provided using the logger in the context. The log message includes any details given. If the error includes a status code, that is the status code given in the response. Otherwise, a 500 is sent.
func EncodeResponseCode ¶
func EncodeResponseCode(statusCode int) kithttp.EncodeResponseFunc
EncodeResponseCode creates a go-kit EncodeResponseFunc that returns the response code given.
func NewEventHandler ¶
func NewEventHandler(e endpoint.Endpoint, getLogger GetLoggerFunc) http.Handler
Types ¶
type BadRequestErr ¶
type BadRequestErr struct {
Message string
}
func (BadRequestErr) Error ¶
func (e BadRequestErr) Error() string
func (BadRequestErr) StatusCode ¶
func (e BadRequestErr) StatusCode() int
type Endpoints ¶
Endpoints is the register go-kit endpoints.
func NewEndpoints ¶
func NewEndpoints(eventQueue queue.Queue, validator validation.TimeValidation, timeTracker queue.TimeTracker, logger *zap.Logger) Endpoints
type EndpointsDecodeIn ¶
type EndpointsDecodeIn struct { fx.In Endpoints GetLogger GetLoggerFunc }
EndpointsDecodeIn provides everything needed to handle the endpoints provided.
type GetLoggerFunc ¶
GetLoggerFunc is the function used to get a request-specific logger from its context.
type Handler ¶
func NewHandlers ¶
func NewHandlers(in EndpointsDecodeIn) Handler
NewHandlers builds handlers from endpoints and other input provided.
type RoutesIn ¶
type RoutesIn struct { fx.In Handler Handler AuthChain alice.Chain ServerBundle touchhttp.ServerBundle Router *mux.Router `name:"servers.primary"` APIBase string `name:"api_base"` }
RoutesIn provides the information needed to set up the router and start handling requests for glaukos's primary subscribing endpoint.