Documentation
¶
Index ¶
- func Bind(w http.ResponseWriter, r *http.Request, out any) bool
- func EventLog(r *http.Request, action EventLogType, item EventLogItem)
- func GetFromContext(r *http.Request, key string) any
- func GetIntParam(name string, w http.ResponseWriter, r *http.Request) (int, error)
- func GetOkFromContext(r *http.Request, key string) (res any, ok bool)
- func GetStrParam(name string, w http.ResponseWriter, r *http.Request) (string, error)
- func QueryParams(url *url.URL) db.RetrieveQueryParams
- func QueryParamsForProps(url *url.URL, props db.ObjectProps) (params db.RetrieveQueryParams)
- func QueryParamsWithOwner(url *url.URL, props db.ObjectProps) db.RetrieveQueryParams
- func SetContextValue(r *http.Request, key string, value any) *http.Request
- func Store(r *http.Request) db.Store
- func UserFromContext(r *http.Request) *db.User
- func WriteError(w http.ResponseWriter, err error)
- func WriteErrorStatus(w http.ResponseWriter, err string, code int)
- func WriteJSON(w http.ResponseWriter, code int, out any)
- type EventLogItem
- type EventLogType
- type H
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventLog ¶
func EventLog(r *http.Request, action EventLogType, item EventLogItem)
func GetIntParam ¶
GetIntParam fetches a parameter from the route variables as an integer redirects to a 404 or writes bad request state depending on error state
func GetStrParam ¶
GetStrParam fetches a parameter from the route variables as an integer redirects to a 404 or writes bad request state depending on error state
func QueryParams ¶
func QueryParams(url *url.URL) db.RetrieveQueryParams
func QueryParamsForProps ¶
func QueryParamsForProps(url *url.URL, props db.ObjectProps) (params db.RetrieveQueryParams)
func QueryParamsWithOwner ¶
func QueryParamsWithOwner(url *url.URL, props db.ObjectProps) db.RetrieveQueryParams
func WriteError ¶
func WriteError(w http.ResponseWriter, err error)
func WriteErrorStatus ¶
func WriteErrorStatus(w http.ResponseWriter, err string, code int)
Types ¶
type EventLogItem ¶
type EventLogType ¶
type EventLogType string
const ( EventLogCreate EventLogType = "create" EventLogUpdate EventLogType = "update" EventLogDelete EventLogType = "delete" )
Click to show internal directories.
Click to hide internal directories.