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) GetSignature() (s Sign, err error)
- func (o *Common) GetUUID() string
- func (o *Common) SetMeta(m map[string]string)
- func (o *Common) SetUUID(v string)
- func (o *Common) UpdateUUID()
- 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 )
Variables ¶
Functions ¶
func Code2HTTPCode ¶
func CreateUUID ¶ added in v2.0.2
func CreateUUID() string
func HTTPCode2Code ¶
func RandomPort ¶
Types ¶
type Common ¶
func (*Common) CreateSign ¶
func (*Common) DecodeJSON ¶
func (*Common) EncodeJSON ¶
func (*Common) GetSignature ¶
func (*Common) UpdateUUID ¶ added in v2.0.2
func (o *Common) UpdateUUID()
type Request ¶
func NewRequest ¶
func NewRequest() *Request
func (*Request) GetVersion ¶
func (*Request) SetVersion ¶
type Response ¶
type Response struct {
Common
}
func NewResponse ¶
func NewResponse() *Response
func (*Response) GetStatusCode ¶
func (*Response) SetStatusCode ¶
func (*Response) UpdateFromHTTP ¶
func (*Response) WriteToHTTP ¶
func (r *Response) WriteToHTTP(w http.ResponseWriter) error
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func (*Signer) CreateString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.