Documentation ¶
Index ¶
- Constants
- type Deserializer
- type DeserializerV1
- func (i *DeserializerV1) BuildObject(pkg string, data map[interface{}]interface{}) (interface{}, error)
- func (i *DeserializerV1) Read() ([]interface{}, error)
- func (i *DeserializerV1) ReadArrayAt(p []byte, begin int) ([]interface{}, int, error)
- func (i *DeserializerV1) ReadAt(p []byte, begin int) ([]interface{}, int, error)
- func (i *DeserializerV1) ReadBytesAt(p []byte, begin int) ([]byte, int, error)
- func (i *DeserializerV1) ReadFloat64At(p []byte, begin int) (float64, int, error)
- func (i *DeserializerV1) ReadInt32At(p []byte, begin int) (int32, int, error)
- func (i *DeserializerV1) ReadInt64At(p []byte, begin int) (int64, int, error)
- func (i *DeserializerV1) ReadMapAt(p []byte, begin int) (map[interface{}]interface{}, int, error)
- func (i *DeserializerV1) ReadStringAt(p []byte, begin int) (string, int, error)
- func (i *DeserializerV1) Reset(r io.Reader)
- func (i *DeserializerV1) SetTypeMap(typeMap map[string]reflect.Type)
- type Package
- type Proxy
- type ProxyConfig
- type Serializer
- type SerializerV1
- func (o *SerializerV1) Call(m string, args ...interface{}) error
- func (o *SerializerV1) CompleteCall() error
- func (o *SerializerV1) Flush()
- func (o *SerializerV1) Reader() io.Reader
- func (o *SerializerV1) SetTypeMap(typeMap map[string]reflect.Type)
- func (o *SerializerV1) StartCall() error
- func (o *SerializerV1) WriteArray(arr interface{}) error
- func (o *SerializerV1) WriteBool(b bool) error
- func (o *SerializerV1) WriteBytes(b []byte) error
- func (o *SerializerV1) WriteDouble(i float64) error
- func (o *SerializerV1) WriteInt(i int32) error
- func (o *SerializerV1) WriteLong(i int64) error
- func (o *SerializerV1) WriteMap(m interface{}) error
- func (o *SerializerV1) WriteMethod(m string) error
- func (o *SerializerV1) WriteNull() error
- func (o *SerializerV1) WriteObject(arg interface{}) error
- func (o *SerializerV1) WritePtr(p interface{}) error
- func (o *SerializerV1) WriteString(s string) error
- func (o *SerializerV1) WriteStruct(s interface{}) error
- func (o *SerializerV1) Writer() io.Writer
Constants ¶
const ( V1 version = iota V2 )
Versions
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deserializer ¶
type Deserializer interface { // Read parse input (io.Reader) to return value Read() ([]interface{}, error) // Reset Reset(io.Reader) // SetTypeMap SetTypeMap(map[string]reflect.Type) }
Deserializer input stream for hessian response
type DeserializerV1 ¶
type DeserializerV1 struct {
// contains filtered or unexported fields
}
DeserializerV1 input stream for hessian 1.0 response
func NewDeserializerV1 ¶
func NewDeserializerV1() *DeserializerV1
NewDeserializerV1 create DeserializerV1
func (*DeserializerV1) BuildObject ¶
func (i *DeserializerV1) BuildObject(pkg string, data map[interface{}]interface{}) (interface{}, error)
BuildObject build a struct or ptr(of struct) from given package and data
func (*DeserializerV1) Read ¶
func (i *DeserializerV1) Read() ([]interface{}, error)
Read parse input (io.Reader) to return value
func (*DeserializerV1) ReadArrayAt ¶
func (i *DeserializerV1) ReadArrayAt(p []byte, begin int) ([]interface{}, int, error)
ReadArrayAt Read string from given bytes and begin index.
After 'Vt <type> <size>' chart, find <value> + <value> ...
func (*DeserializerV1) ReadAt ¶
func (i *DeserializerV1) ReadAt(p []byte, begin int) ([]interface{}, int, error)
ReadAt Read object from given bytes and begin index.
func (*DeserializerV1) ReadBytesAt ¶
ReadBytesAt Read bytes from given bytes and begin index.
After 'B' chart, find b16 b8 <bytes-value>
func (*DeserializerV1) ReadFloat64At ¶
ReadFloat64At Read string from given bytes and begin index.
After 'D' chart, find b64 b56 b48 b40 b32 b24 b16 b8
func (*DeserializerV1) ReadInt32At ¶
ReadInt32At Read string from given bytes and begin index.
After 'I' chart, find b32 b24 b16 b8
func (*DeserializerV1) ReadInt64At ¶
ReadInt64At Read string from given bytes and begin index.
After 'L' chart, find b64 b56 b48 b40 b32 b24 b16 b8
func (*DeserializerV1) ReadMapAt ¶
func (i *DeserializerV1) ReadMapAt(p []byte, begin int) (map[interface{}]interface{}, int, error)
ReadMapAt Read string from given bytes and begin index.
After 'Mt' chart, find <key> + <value> ...
func (*DeserializerV1) ReadStringAt ¶
ReadStringAt Read string from given bytes and begin index.
After 'S' chart, find b16 b8 <string-value>
func (*DeserializerV1) SetTypeMap ¶
func (i *DeserializerV1) SetTypeMap(typeMap map[string]reflect.Type)
SetTypeMap set type map
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy hessian proxy
func NewProxy ¶
func NewProxy(c *ProxyConfig) (*Proxy, error)
NewProxy create a proxy of the hessian service
type ProxyConfig ¶
type ProxyConfig struct { Version version URL string TypeMap map[string]reflect.Type Client *http.Client }
ProxyConfig config for NewProxy
type Serializer ¶
type Serializer interface { // Call Writes a complete method call. Call(string, ...interface{}) error // Writer get writer Writer() io.Writer // Reader get reader Reader() io.Reader // Flush clean writer Flush() // SetTypeMap SetTypeMap(map[string]reflect.Type) }
Serializer output stream for hessian requests
type SerializerV1 ¶
type SerializerV1 struct {
// contains filtered or unexported fields
}
SerializerV1 output stream for hessian 1.0 requests
func (*SerializerV1) Call ¶
func (o *SerializerV1) Call(m string, args ...interface{}) error
Call Writes a complete method call.
func (*SerializerV1) CompleteCall ¶
func (o *SerializerV1) CompleteCall() error
CompleteCall Completes
func (*SerializerV1) SetTypeMap ¶
func (o *SerializerV1) SetTypeMap(typeMap map[string]reflect.Type)
SetTypeMap set type map
func (*SerializerV1) StartCall ¶
func (o *SerializerV1) StartCall() error
StartCall Starts the method call.
func (*SerializerV1) WriteArray ¶
func (o *SerializerV1) WriteArray(arr interface{}) error
WriteArray Write an map value to the stream. The map will be written with the following syntax:
Vt b16 b8 <array-type> l b32 b24 b16 b8 <object> ... ... z
func (*SerializerV1) WriteBool ¶
func (o *SerializerV1) WriteBool(b bool) error
WriteBool Writes a boolean value to the stream. The boolean will be written with the following syntax:
T or F
func (*SerializerV1) WriteBytes ¶
func (o *SerializerV1) WriteBytes(b []byte) error
WriteBytes Writes a bytes value to the stream
func (*SerializerV1) WriteDouble ¶
func (o *SerializerV1) WriteDouble(i float64) error
WriteDouble Writes an double value to the stream. The double will be written with the following syntax:
D b64 b56 b48 b40 b32 b24 b16 b8
func (*SerializerV1) WriteInt ¶
func (o *SerializerV1) WriteInt(i int32) error
WriteInt Writes an integer value to the stream. The integer will be written with the following syntax:
I b32 b24 b16 b8
func (*SerializerV1) WriteLong ¶
func (o *SerializerV1) WriteLong(i int64) error
WriteLong Writes an long value to the stream. The long will be written with the following syntax:
L b64 b56 b48 b40 b32 b24 b16 b8
func (*SerializerV1) WriteMap ¶
func (o *SerializerV1) WriteMap(m interface{}) error
WriteMap Write an map value to the stream. The map will be written with the following syntax:
Mt b16 b8 (<key> <value>)z
func (*SerializerV1) WriteMethod ¶
func (o *SerializerV1) WriteMethod(m string) error
WriteMethod Writes the method tag.
m b16 b8 method-name
func (*SerializerV1) WriteNull ¶
func (o *SerializerV1) WriteNull() error
WriteNull Writes a null value to the stream.
func (*SerializerV1) WriteObject ¶
func (o *SerializerV1) WriteObject(arg interface{}) error
WriteObject Writes any object to the output stream.
func (*SerializerV1) WritePtr ¶
func (o *SerializerV1) WritePtr(p interface{}) error
WritePtr Writes an object value to the stream.
func (*SerializerV1) WriteString ¶
func (o *SerializerV1) WriteString(s string) error
WriteString Writes a string value to the stream using UTF-8 encoding.
The string will be written with the following syntax:
S b16 b8 string-value
func (*SerializerV1) WriteStruct ¶
func (o *SerializerV1) WriteStruct(s interface{}) error
WriteStruct Writes an object value to the stream.