Documentation ¶
Index ¶
- Variables
- func GetPageLang(query, header, defaultLang string) string
- func GetPaginationFromURL(u *url.URL, defaultCount int) (int, int, bool)
- func NewClient(application, version, endpoint string) *http.Client
- func ReturnError(w http.ResponseWriter, status int, errStr string, vars ...interface{})
- type ContextKey
- type Module
- type Server
- func (s *Server) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route
- func (s *Server) MethodNotAllowedHandler() http.Handler
- func (s *Server) NotFoundHandler() http.Handler
- func (s *Server) PathPrefix(path string) *mux.Route
- func (s *Server) Start() error
- func (s *Server) Stop(ctx context.Context) error
- func (s *Server) WrapInMiddlewares(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMalformedAccept = errors.New("malformed Accept header")
)
Functions ¶
func GetPageLang ¶
func GetPaginationFromURL ¶
GetPaginationFromURL returns a page and item count derived from the url query returns true if count is present in query.
func ReturnError ¶
func ReturnError(w http.ResponseWriter, status int, errStr string, vars ...interface{})
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a http 2 web server.
func (*Server) HandleFunc ¶
HandleFunc attaches a function to a path.
func (*Server) MethodNotAllowedHandler ¶
func (*Server) NotFoundHandler ¶
func (*Server) PathPrefix ¶
PathPrefix attaches a new route url path prefix.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.