Versions in this module Expand all Collapse all v1 v1.8.0 Aug 19, 2020 Changes in this version + type CallFunc func(*Message) error + type FormatterFunc func(m *Message, code int, headers map[string]string, body interface{}) + type Handler struct + Call CallFunc + Method string + Path string + type ModuleInjecter interface + Formatter func() FormatterFunc + Handlers func() []Handler + Middleware func() CallFunc + type Route struct + Call CallFunc + Formatter FormatterFunc + Middleware CallFunc + type Router struct + func NewRouter() *Router + func (h *Router) Add(hhi ModuleInjecter) + func (h *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) type Server + func NewServer() *Server + func (s *Server) AddRoute(hhi ModuleInjecter) v1.7.0 Jul 12, 2020 Changes in this version + func HTTPFormatter(m *Message, code int, headers map[string]string, body interface{}) + func JsonRPCFormatter(m *Message, code int, headers map[string]string, body interface{}) + type CallHandler struct + Call FN + Method string + Path string + type FMT func(m *Message, code int, headers map[string]string, body interface{}) + type FN func(*Message) error + type HttpHandler struct + func NewHttpHandler() *HttpHandler + func (h *HttpHandler) Route(hhi HttpHandlerInterface) + func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type HttpHandlerInterface interface + Formatter func() FMT + Handlers func() []CallHandler + Middelware func() FN + type HttpHandlerItem struct + Call FN + Formatter FMT + Middelware FN + type JsonRPCErrorBody struct + Code int + Message string + func (v *JsonRPCErrorBody) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *JsonRPCErrorBody) UnmarshalJSON(data []byte) error + func (v JsonRPCErrorBody) MarshalEasyJSON(w *jwriter.Writer) + func (v JsonRPCErrorBody) MarshalJSON() ([]byte, error) + type JsonRPCRequest struct + ID string + Method string + Params json.RawMessage + func (v *JsonRPCRequest) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *JsonRPCRequest) UnmarshalJSON(data []byte) error + func (v JsonRPCRequest) MarshalEasyJSON(w *jwriter.Writer) + func (v JsonRPCRequest) MarshalJSON() ([]byte, error) + type JsonRPCResponse struct + ID string + Result json.RawMessage + func (v *JsonRPCResponse) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *JsonRPCResponse) UnmarshalJSON(data []byte) error + func (v JsonRPCResponse) MarshalEasyJSON(w *jwriter.Writer) + func (v JsonRPCResponse) MarshalJSON() ([]byte, error) + type JsonRPCResponseError struct + Error JsonRPCErrorBody + ID string + func (v *JsonRPCResponseError) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *JsonRPCResponseError) UnmarshalJSON(data []byte) error + func (v JsonRPCResponseError) MarshalEasyJSON(w *jwriter.Writer) + func (v JsonRPCResponseError) MarshalJSON() ([]byte, error) + type Message struct + Formatter FMT + Reader *http.Request + Writer http.ResponseWriter + func (m *Message) Decode(call func([]byte) error) error + func (m *Message) Empty(code int) + func (m *Message) Encode(call func() (int, map[string]string, interface{})) + func (m *Message) Error(code int, err error) + func (m *Message) GetCookies() map[string]*http.Cookie + func (m *Message) Redirect(url string) + func (m *Message) SetCookie(key, value string, ttl time.Duration) + type Server struct + func New() *Server + func (s *Server) Down() error + func (s *Server) Route(hhi HttpHandlerInterface) + func (s *Server) SetAddr(addr string) + func (s *Server) Up() error