service

package
v0.0.0-...-804de46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 GetHealth

func GetHealth(w http.ResponseWriter, r *http.Request, ctx *Context)

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

func DefaultAppContext(api *ServiceAPI, r *http.Request, user *mdefault.User) *Context

type ServiceAPI

type ServiceAPI struct {
	Name    string
	Version string
	Router  *mux.Router
}

func NewServiceAPI

func NewServiceAPI() (*ServiceAPI, error)

func (*ServiceAPI) Close

func (*ServiceAPI) Close()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL