api

package
v0.0.0-...-0be3886 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachProfiler

func AttachProfiler(router *mux.Router)

Types

type API

type API struct {
	BaseRoutes *Routes
	Service    *service.Service
}

func Init

func Init(config *config.Config, root *mux.Router, service *service.Service) *API

func (*API) ApiHandler

func (api *API) ApiHandler(h func(*Context, http.ResponseWriter, *http.Request, *service.Service)) http.Handler

func (*API) InitStatus

func (api *API) InitStatus()

func (*API) InitTodo

func (api *API) InitTodo()

type Context

type Context struct {
	RequestId string
	IpAddress string
	Path      string
	Err       *model.AppError
}

func (*Context) SetInvalidParam

func (c *Context) SetInvalidParam(parameter string)

type Routes

type Routes struct {
	ApiRoot *mux.Router // 'api'
	Todo    *mux.Router // 'api/todo'
	Status  *mux.Router // 'api/status'
}

Jump to

Keyboard shortcuts

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