http

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpHandler

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

func NewHttpHandler

func NewHttpHandler() *HttpHandler

func (*HttpHandler) Route

func (h *HttpHandler) Route(method, path string, call func(*Message))

func (*HttpHandler) ServeHTTP

func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Message

type Message struct {
	Writer http.ResponseWriter
	Reader *http.Request
}

func (*Message) Binary

func (m *Message) Binary(call func() ([]byte, error))

func (*Message) Decode

func (m *Message) Decode(call func([]byte) error) error

func (*Message) Empty

func (m *Message) Empty(code int)

func (*Message) Encode

func (m *Message) Encode(mime string, call func() ([]byte, error))

func (*Message) Json

func (m *Message) Json(call func() ([]byte, error))

type Server

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

func New

func New() *Server

func (*Server) Down

func (s *Server) Down() error

func (*Server) Route

func (s *Server) Route(method, path string, call func(*Message))

func (*Server) SetAddr

func (s *Server) SetAddr(addr string)

func (*Server) Up

func (s *Server) Up() error

Jump to

Keyboard shortcuts

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