Documentation ¶
Index ¶
- Constants
- func ErrorInternalServer(w http.ResponseWriter, err error)
- func ErrorNotFound(w http.ResponseWriter, err error)
- func ErrorUnauthorizedAccess(w http.ResponseWriter, err error)
- func GetHealth(w http.ResponseWriter, r *http.Request, ctx *Context)
- func GetVersion(w http.ResponseWriter, r *http.Request, ctx *Context)
- func HandleOk(w http.ResponseWriter, payload []byte)
- func SetAccessControlOrigin(w http.ResponseWriter)
- func SetContentTypeHtml(w http.ResponseWriter)
- func SetContentTypeJson(w http.ResponseWriter)
- type Context
- type ServiceAPI
Constants ¶
View Source
const ( AuthLevelAny authLevel = iota AuthLevelLoggedIn AuthLevelAdmin )
View Source
const (
DefaultMaxFormMemory = 32 << 20 // 32 MB
)
View Source
const (
ProdTypeDefault productType = iota
)
Variables ¶
This section is empty.
Functions ¶
func ErrorInternalServer ¶
func ErrorInternalServer(w http.ResponseWriter, err error)
func ErrorNotFound ¶
func ErrorNotFound(w http.ResponseWriter, err error)
func ErrorUnauthorizedAccess ¶
func ErrorUnauthorizedAccess(w http.ResponseWriter, err error)
func GetVersion ¶
func GetVersion(w http.ResponseWriter, r *http.Request, ctx *Context)
func HandleOk ¶
func HandleOk(w http.ResponseWriter, payload []byte)
func SetAccessControlOrigin ¶
func SetAccessControlOrigin(w http.ResponseWriter)
func SetContentTypeHtml ¶
func SetContentTypeHtml(w http.ResponseWriter)
func SetContentTypeJson ¶
func SetContentTypeJson(w http.ResponseWriter)
Types ¶
type Context ¶
type Context struct { *ServiceAPI // default UserDefault *mdefault.User // contains filtered or unexported fields }
func DefaultAppContext ¶
type ServiceAPI ¶
func NewServiceAPI ¶
func NewServiceAPI() (*ServiceAPI, error)
func (*ServiceAPI) Close ¶
func (*ServiceAPI) Close()
Click to show internal directories.
Click to hide internal directories.