Documentation ¶
Index ¶
- type Action
- type HTTPServer
- func (s *HTTPServer) GetRouter() *mux.Router
- func (s *HTTPServer) GetWebContainer() *restful.Container
- func (s *HTTPServer) ListenAndServe() error
- func (s *HTTPServer) NewWebService(rootPath string, filter restful.FilterFunction) *restful.WebService
- func (s *HTTPServer) RegisterActions(ws *restful.WebService, actions []*Action)
- func (s *HTTPServer) RegisterWebServer(rootPath string, filter restful.FilterFunction, actions []*Action) error
- func (s *HTTPServer) SetInsecureServer(insecureAddr string, insecurePort uint)
- func (s *HTTPServer) SetSSL(cafile, certfile, keyfile, certPasswd string)
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 }
Action restful action struct.
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
NewHTTPServer get a new http server.
func (*HTTPServer) GetRouter ¶
func (s *HTTPServer) GetRouter() *mux.Router
GetRouter return the router.
func (*HTTPServer) GetWebContainer ¶
func (s *HTTPServer) GetWebContainer() *restful.Container
GetWebContainer return the web container.
func (*HTTPServer) ListenAndServe ¶
func (s *HTTPServer) ListenAndServe() error
ListenAndServe start a http server
func (*HTTPServer) NewWebService ¶
func (s *HTTPServer) NewWebService(rootPath string, filter restful.FilterFunction) *restful.WebService
NewWebService get a new web service.
func (*HTTPServer) RegisterActions ¶
func (s *HTTPServer) RegisterActions(ws *restful.WebService, actions []*Action)
RegisterActions register a list of actions into web service.
func (*HTTPServer) RegisterWebServer ¶
func (s *HTTPServer) RegisterWebServer(rootPath string, filter restful.FilterFunction, actions []*Action) error
RegisterWebServer register a new web server beyond rootPath and handle these actions.
func (*HTTPServer) SetInsecureServer ¶
func (s *HTTPServer) SetInsecureServer(insecureAddr string, insecurePort uint)
SetInsecureServer set insecure(http) address and port into http server.
func (*HTTPServer) SetSSL ¶
func (s *HTTPServer) SetSSL(cafile, certfile, keyfile, certPasswd string)
SetSSL set certs files into http server.
Click to show internal directories.
Click to hide internal directories.