httpserver

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Verb          string               // Verb identifying the action ("GET", "POST", "WATCH", PROXY", etc).
	Path          string               // The path of the action
	Params        []*restful.Parameter // List of parameters associated with the action.
	Handler       restful.RouteFunction
	FilterHandler []restful.FilterFunction
}

Action restful action struct

func NewAction

func NewAction(verb, path string, params []*restful.Parameter, handler restful.RouteFunction, filters []restful.FilterFunction) *Action

func (*Action) AddFilter

func (a *Action) AddFilter(f func(req *restful.Request, resp *restful.Response, fchain *restful.FilterChain))

func (*Action) GetFilter

func (a *Action) GetFilter() []restful.FilterFunction

type HttpServer

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

HttpServer is data struct of http server

func NewHttpServer

func NewHttpServer(port uint, addr, sock string) *HttpServer

func (*HttpServer) GetWebContainer

func (s *HttpServer) GetWebContainer() *restful.Container

func (*HttpServer) ListenAndServe

func (s *HttpServer) ListenAndServe() error

func (*HttpServer) NewWebService

func (s *HttpServer) NewWebService(rootPath string, filter restful.FilterFunction) *restful.WebService

func (*HttpServer) RegisterActions

func (s *HttpServer) RegisterActions(ws *restful.WebService, actions []*Action)

func (*HttpServer) RegisterWebServer

func (s *HttpServer) RegisterWebServer(rootPath string, filter restful.FilterFunction, actions []*Action) error

func (*HttpServer) SetSsl

func (s *HttpServer) SetSsl(cafile, certfile, keyfile, certPasswd string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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