Documentation ¶
Index ¶
- func BlockingBackoff(fn func() error, attempts int, sleep time.Duration) error
- func ReadJSON(r *http.Request, payload interface{}) error
- func RenderTemplate(w http.ResponseWriter, components templ.Component)
- func WriteJSON(w http.ResponseWriter, payload interface{}) error
- type Database
- type DatabaseConfig
- type HttpRouter
- type JsonMiddleware
- type Route
- type RouterContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockingBackoff ¶
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, components templ.Component)
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, payload interface{}) error
Types ¶
type Database ¶
type Database struct { *sqlx.DB Config DatabaseConfig // contains filtered or unexported fields }
type DatabaseConfig ¶
func GetDefaultDatabaseConfig ¶
func GetDefaultDatabaseConfig() DatabaseConfig
type HttpRouter ¶
func NewHttpRouter ¶
func NewHttpRouter(ctx *RouterContext) *HttpRouter
func (*HttpRouter) MapRoutes ¶
func (r *HttpRouter) MapRoutes(routes []Route) *HttpRouter
func (*HttpRouter) Serve ¶
func (r *HttpRouter) Serve()
type JsonMiddleware ¶
type JsonMiddleware struct{}
func (JsonMiddleware) ServeHTTP ¶
func (j JsonMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RouterContext ¶
type RouterContext struct {
DB Database
}
Click to show internal directories.
Click to hide internal directories.