Versions in this module Expand all Collapse all v0 v0.1.0 Jul 14, 2023 Changes in this version + var DefaultClient = Client + func ErrorCode(err error, def int) int + func NewRequest(c ctx.C, method string, url string, body io.Reader) (*http.Request, error) + func TestAPI(c ctx.C, uid UID, obj T) error + type Call struct + func (this *Call) SetBody(b []byte) + func (this *Call) Write(b []byte) + type CallHandler struct + Handler func(c ctx.C, call *Call) error + MaxLength int + Path string + ReadTimeout time.Duration + func (this CallHandler) Register(s *Server) + type Client struct + BaseUrl *url.URL + func (this Client) API(c ctx.C, obj Doable) error + func (this Client) Do(r *http.Request) (*http.Response, error) + func (this Client) Get(c ctx.C, url string) ([]byte, error) + func (this Client) Post(c ctx.C, url string, body []byte) ([]byte, error) + type Doable interface + Do func(ctx.C) error + type Error struct + Code int + Err error + func NewErrorf(c ctx.C, code int, f string, args ...any) Error + func (this Error) Error() string + func (this Error) Unwrap() error + type Server struct + OnResponse func(Stat) + func NewServer(c ctx.C) *Server + func (s *Server) RegisterAPI(c ctx.C, obj Doable) error + func (this *Server) HandleRequest(pattern string, f func(c ctx.C, in []byte, r *http.Request) ([]byte, error)) + func (this Server) Listen(c ctx.C, addr string) (net.Addr, error) + func (this Server) Mux() *http.ServeMux + type Stat struct + Code int + Elapsed time.Duration + Method string + Path string + UA string