Documentation
¶
Index ¶
- func GenerateBytesUUID() []byte
- func GenerateUUID() string
- func OpenWSServerConn(writer http.ResponseWriter, request *http.Request) (*websocket.Conn, error)
- type Config
- type DummyServer
- type HttpHandler
- type Input
- type Options
- type Output
- type ReqContext
- type RequestHandler
- type ResponseErr
- type Server
- func (s *Server) Addr() string
- func (s *Server) HandlerChain(h http.Handler, secure bool) http.Handler
- func (s *Server) RegisterHandler(pattern string, handler http.Handler, secure bool)
- func (s *Server) Run(signals <-chan os.Signal, ready chan<- struct{}) error
- func (s *Server) Start() error
- func (s *Server) Stop() error
- type TLS
- type WSStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateBytesUUID ¶
func GenerateBytesUUID() []byte
GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes
func OpenWSServerConn ¶
Types ¶
type DummyServer ¶
type DummyServer struct{}
func NewDummyServer ¶
func NewDummyServer() *DummyServer
func (*DummyServer) RegisterHandler ¶
func (d *DummyServer) RegisterHandler(s string, handler http.Handler, secure bool)
func (*DummyServer) Start ¶
func (d *DummyServer) Start() error
func (*DummyServer) Stop ¶
func (d *DummyServer) Stop() error
type HttpHandler ¶
type HttpHandler struct {
// contains filtered or unexported fields
}
func NewHttpHandler ¶
func NewHttpHandler() *HttpHandler
func (*HttpHandler) RegisterURI ¶
func (h *HttpHandler) RegisterURI(uri string, method string, rh RequestHandler)
func (*HttpHandler) ServeHTTP ¶
func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type ReqContext ¶
type RequestHandler ¶
type RequestHandler interface { // HandleRequest dispatches the request in the backend by parsing the given request context // and returning a status code and a response back to the client. HandleRequest(*ReqContext) (response interface{}, statusCode int) // ParsePayload parses the payload to handler specific form or returns an error ParsePayload([]byte) (interface{}, error) }
type ResponseErr ¶
type ResponseErr struct {
Reason string
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandlerChain ¶
func (*Server) RegisterHandler ¶
RegisterHandler registers into the ServeMux a handler chain that borrows its security properties from the fabhttp.Server. This method is thread safe because ServeMux.Handle() is thread safe, and options are immutable. This method can be called either before or after Server.Start(). If the pattern exists the method panics.
type TLS ¶
type WSStream ¶
type WSStream struct {
// contains filtered or unexported fields
}
func NewWSStream ¶
func (*WSStream) WriteResult ¶
Click to show internal directories.
Click to hide internal directories.