rest

package
v0.0.0-...-1dbe30f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest() (interface{}, int, error)

func Int32Param

func Int32Param(name string, req *http.Request) (int32, error)

func Int64Param

func Int64Param(name string, req *http.Request) (int64, error)

func Int64QueryParam

func Int64QueryParam(name string, req *http.Request) (int64, error)

Types

type Action

type Action struct {
	*WebContext
	Apply func(*WebContext, http.ResponseWriter, *http.Request) (interface{}, int, error)
}

func (Action) ServeHTTP

func (action Action) ServeHTTP(w http.ResponseWriter, r *http.Request)

type AssetHandler

type AssetHandler struct {
	// contains filtered or unexported fields
}

func NewAssetHandler

func NewAssetHandler(root http.FileSystem, asset string) *AssetHandler

func (*AssetHandler) ServeHTTP

func (f *AssetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CtxMux

type CtxMux struct {
	*goji.Mux
	*WebContext
}

func NewMux

func NewMux(c *WebContext) *CtxMux

func (*CtxMux) Handle

func (m *CtxMux) Handle(p goji.Pattern, h func(*WebContext, http.ResponseWriter, *http.Request) (interface{}, int, error))

type EventsSearchController

type EventsSearchController struct {
}

func (*EventsSearchController) Register

func (c *EventsSearchController) Register(mux *CtxMux)

func (*EventsSearchController) SearchMessages

func (c *EventsSearchController) SearchMessages(ctx *WebContext, w http.ResponseWriter, req *http.Request) (interface{}, int, error)

type TopicsController

type TopicsController struct {
}

func (*TopicsController) DownloadMessage

func (c *TopicsController) DownloadMessage(ctx *WebContext, w http.ResponseWriter, req *http.Request) (interface{}, int, error)

func (*TopicsController) FetchMessage

func (c *TopicsController) FetchMessage(ctx *WebContext, w http.ResponseWriter, req *http.Request) (interface{}, int, error)

func (*TopicsController) Register

func (c *TopicsController) Register(mux *CtxMux)

type WebContext

type WebContext struct {
	*render.Render
	// contains filtered or unexported fields
}

func NewWebContext

func NewWebContext(engine *engine.Engine) *WebContext

func (*WebContext) Start

func (ctx *WebContext) Start(cfg *engine.Config)

func (*WebContext) Stop

func (ctx *WebContext) Stop()

Jump to

Keyboard shortcuts

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