Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type Client
- type Common
- 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
- type List
- type Pool
- type Pooler
- type Request
- type Response
- type Server
- type Sign
- type Signer
- type SrvCaller
Constants ¶
View Source
const ( VersionKey = `Accept` UUIDKey = `X-Request-ID` StatusCodeKey = `X-Status` SignKey = `Signature` ContentTypeKey = `Content-Type` ContentTypeJSONValue = `application/json; charset=utf-8` ContentTypeBinaryValue = `application/octet-stream` StatusCodeFail uint = 0 StatusCodeOK uint = 1 StatusCodeNotFound uint = 2 StatusCodeForbidden uint = 4 StatusCodeServerError uint = 5 StatusCodeRedirect uint = 6 )
nolint: golint
Variables ¶
View Source
var ( ErrServAlreadyRunning = errors.New("server is already running") ErrEpollEmptyEvents = errors.New("epoll events is empty") ErrInvalidSignature = errors.New(`invalid signature format`) ErrEmptyPool = errors.New(`pool is empty`) ErrInvalidPoolAddress = errors.New(`invalid address in pool`) ErrClientNotFound = errors.New(`client not found`) ErrCookieNotFound = errors.New(`cookie not found`) )
nolint: golint
Functions ¶
Types ¶
type Response ¶
type Response struct {
Common
}
Response model
func (*Response) UpdateFromHTTP ¶
UpdateFromHTTP ...
func (*Response) WriteToHTTP ¶
func (r *Response) WriteToHTTP(w http.ResponseWriter) error
WriteToHTTP ...
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer ...
func NewCustomSigner ¶
NewCustomSigner ...
Click to show internal directories.
Click to hide internal directories.