Versions in this module Expand all Collapse all v2 v2.1.2 Mar 10, 2022 v2.1.1 Mar 10, 2022 Changes in this version + func AdjustPage(page int) int + func HasNextPage(page, pageSize, recordCount int) bool + func NewRESTRouterAndServer(config RESTConfig) (*mux.Router, *http.Server) + func NewSPARouterAndServer(config SPAConfig) (*mux.Router, *http.Server) + func ReadJSONBody(r *http.Request, dest interface{}) error + func RealIP(r *http.Request) string + func TotalPages(pageSize, recordCount int) int + func ValidateHTTPMethod(r *http.Request, w http.ResponseWriter, expectedMethod string, ...) error + func WaitForKill() chan os.Signal + func WriteJSON(logger *logrus.Entry, w http.ResponseWriter, status int, value interface{}) + func WriteString(logger *logrus.Entry, w http.ResponseWriter, status int, value string) + type Endpoint struct + Handler http.Handler + HandlerFunc http.HandlerFunc + Methods []string + Path string + type Endpoints []*Endpoint + func (a Endpoints) Len() int + func (a Endpoints) Less(i, j int) bool + func (a Endpoints) Swap(i, j int) + type RESTConfig struct + Endpoints Endpoints + Host string + IdleTimeout int + ReadTimeout int + WriteTimeout int + func DefaultRESTConfig(host string) RESTConfig + type SPAConfig struct + AppDirectory string + AppFileSystem embed.FS + Endpoints Endpoints + Host string + IdleTimeout int + IndexHTML []byte + MainJS []byte + ManifestJSON []byte + ReadTimeout int + Version string + WriteTimeout int + func DefaultSPAConfig(host, version string, appFileSystem embed.FS, ...) SPAConfig