Versions in this module Expand all Collapse all v2 v2.1.0 Feb 7, 2021 Changes in this version + const ContentTypeBinaryValue + const ContentTypeJSONValue + const ContentTypeKey + const SignKey + const StatusCodeFail + const StatusCodeForbidden + const StatusCodeKey + const StatusCodeNotFound + const StatusCodeOK + const StatusCodeRedirect + const StatusCodeServerError + const StatusCodeUnauthorized + const UUIDKey + const VersionKey + var ErrClientNotFound = errors.New(`client not found`) + var ErrCookieNotFound = errors.New(`cookie not found`) + var ErrEmptyPool = errors.New(`pool is empty`) + var ErrEpollEmptyEvents = errors.New("epoll events is empty") + var ErrInvalidPoolAddress = errors.New(`invalid address in pool`) + var ErrInvalidSignature = errors.New(`invalid signature format`) + var ErrServAlreadyRunning = errors.New("server is already running") + func Code2HTTPCode(v uint) int + func CreateUUID() string + func GetFD(c net.Conn) int + func HTTPCode2Code(v int) uint + func RandomPort(host string) (string, error) + func Reader(rc io.ReadCloser) ([]byte, error) + type CliCaller func(pool Pooler, in *Request, out *Response) error + type Client struct + func NewClient(conf Configer) *Client + func (o *Client) Call(name string, in *Request, out *Response) error + func (o *Client) Client(name string, call CliCaller) + type Common struct + Body []byte + Meta http.Header + func (o *Common) CreateSign(s *Signer) + func (o *Common) DecodeGob(v interface{}) error + func (o *Common) DecodeJSON(v interface{}) error + func (o *Common) EncodeGob(v interface{}) (err error) + func (o *Common) EncodeJSON(v interface{}) (err error) + func (o *Common) GetCookie(name string) (*http.Cookie, error) + func (o *Common) GetSignature() (s Sign, err error) + func (o *Common) GetUUID() string + func (o *Common) SetCookie(v ...*http.Cookie) + func (o *Common) SetMeta(m map[string]string) + func (o *Common) SetUUID(v string) + func (o *Common) UpdateUUID() + func (o *Common) ValidateSign(s *Signer) bool + type Configer interface + Get func(name string) List + type List []string + func (v List) Pool() (string, string, error) + type Pool struct + Items map[string]List + func (c Pool) Get(name string) List + type Pooler interface + Pool func() (string, string, error) + type Request struct + URL *url.URL + func NewRequest() *Request + func (r *Request) GetVersion() uint64 + func (r *Request) SetVersion(v uint64) + func (r *Request) UpdateFromHTTP(v *http.Request, headers ...string) (err error) + type Response struct + func NewResponse() *Response + func (r *Response) GetStatusCode() uint + func (r *Response) SetStatusCode(v uint) + func (r *Response) UpdateFromHTTP(v *http.Response, headers ...string) (err error) + func (r *Response) WriteToHTTP(w http.ResponseWriter) error + type Server struct + func NewServer() *Server + func (o *Server) Call(in *Request, out *Response) + func (o *Server) Handler(path string, ver uint64, call SrvCaller) + type Sign struct + Algorithm string + ID string + Signature string + type Signer struct + func NewCustomSigner(id, secret string, h func() hash.Hash) *Signer + func NewSigner(id, secret string) *Signer + func (s *Signer) Create(b []byte) []byte + func (s *Signer) CreateString(b []byte) string + func (s *Signer) ID() string + func (s *Signer) Validate(b []byte, ex string) bool + type SrvCaller func(in *Request, out *Response)