Documentation
¶
Index ¶
Constants ¶
View Source
const (
ApiPrefix = "/api"
)
Variables ¶
View Source
var (
ErrMalformed = errors.New("malformed api endpoint; should be /api/...")
)
Functions ¶
This section is empty.
Types ¶
type ApiHandler ¶
type ApiHandler struct {
// contains filtered or unexported fields
}
ApiHandler implements Handler
func (*ApiHandler) HandleEndpoint ¶
func (h *ApiHandler) HandleEndpoint(url *url.URL, w http.ResponseWriter, r *http.Request)
func (*ApiHandler) RegisterEndpoint ¶
func (h *ApiHandler) RegisterEndpoint(e endpoint.ApiEndpoint)
func (*ApiHandler) ServeHTTP ¶
func (h *ApiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ApiHandlerFunc ¶
type ApiHandlerFunc func(w http.ResponseWriter, r *http.Request)
type Handler ¶
type Handler interface {
ServeHTTP(http.ResponseWriter, *http.Request)
}
Handler provides api handler methods and implements http.Handler
func NewHandler ¶
func NewHandler(connHandler connection.ConnectionHandler) Handler
Click to show internal directories.
Click to hide internal directories.