api

package
v0.0.0-...-b392570 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(controller *ctrl.Controller, enableCors bool) *mux.Router

Types

type Context

type Context struct {
	context.Context
	ID string

	Controller *ctrl.Controller
	// contains filtered or unexported fields
}

func NewContext

func NewContext(w http.ResponseWriter, r *http.Request, controller *ctrl.Controller) *Context

func (*Context) Form

func (c *Context) Form(name string) string

func (*Context) Get

func (c *Context) Get(key string) interface{}

func (*Context) JSON

func (c *Context) JSON(code int, v interface{}) error

func (*Context) JSONP

func (c *Context) JSONP(code int, callback string, v interface{}) error

func (*Context) Query

func (c *Context) Query(name string) string

func (*Context) Request

func (c *Context) Request() *http.Request

func (*Context) Response

func (c *Context) Response() *Response

func (*Context) Set

func (c *Context) Set(key string, v interface{})

func (*Context) WriteHeader

func (c *Context) WriteHeader(code int)

type Dispatcher

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

func (*Dispatcher) ServeHTTP

func (dispatcher *Dispatcher) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Dispatcher) SetHandler

func (dispatcher *Dispatcher) SetHandler(handler http.Handler)

type Response

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

func NewResponse

func NewResponse(w http.ResponseWriter) *Response

func (*Response) Flush

func (r *Response) Flush()

func (*Response) Header

func (r *Response) Header() http.Header

func (*Response) SetWriter

func (r *Response) SetWriter(w http.ResponseWriter)

func (*Response) Size

func (r *Response) Size() int64

func (*Response) Status

func (r *Response) Status() int

func (*Response) Write

func (r *Response) Write(b []byte) (int, error)

func (*Response) WriteHeader

func (r *Response) WriteHeader(code int)

func (*Response) Writer

func (r *Response) Writer() http.ResponseWriter

type Server

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

func NewServer

func NewServer(hosts []string, tlsConfig *tls.Config, controller *ctrl.Controller, enablecors bool) *Server

func (*Server) ListenHosts

func (server *Server) ListenHosts() []string

func (*Server) SetHandler

func (server *Server) SetHandler(handler http.Handler)

func (*Server) Startup

func (server *Server) Startup() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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