Documentation
¶
Index ¶
- Constants
- Variables
- func Marshal(v interface{}) ([]byte, error)
- func RegisterClientFactory(scheme string, newClient func(string) Client)
- func Serialize(v interface{}, simple bool) ([]byte, error)
- func Unmarshal(b []byte, p interface{}) error
- func Unserialize(b []byte, p interface{}, simple bool) error
- type ArgsFixer
- type BaseClient
- func (client *BaseClient) AddFilter(filter Filter)
- func (client *BaseClient) GetFilter() Filter
- func (client *BaseClient) Invoke(name string, args []interface{}, options *InvokeOptions, result interface{}) <-chan error
- func (client *BaseClient) RemoveFilter(filter Filter)
- func (client *BaseClient) SetFilter(filter Filter)
- func (client *BaseClient) SetUri(uri string)
- func (client *BaseClient) Uri() string
- func (client *BaseClient) UseService(args ...interface{})
- type BaseContext
- func (context *BaseContext) GetBool(key string) (value bool, ok bool)
- func (context *BaseContext) GetFloat(key string) (value float64, ok bool)
- func (context *BaseContext) GetInt(key string) (value int, ok bool)
- func (context *BaseContext) GetInt64(key string) (value int64, ok bool)
- func (context *BaseContext) GetInterface(key string) (value interface{}, ok bool)
- func (context *BaseContext) GetString(key string) (value string, ok bool)
- func (context *BaseContext) GetUInt(key string) (value uint, ok bool)
- func (context *BaseContext) GetUInt64(key string) (value uint64, ok bool)
- func (context *BaseContext) SetBool(key string, value bool)
- func (context *BaseContext) SetFloat(key string, value float64)
- func (context *BaseContext) SetInt(key string, value int)
- func (context *BaseContext) SetInt64(key string, value int64)
- func (context *BaseContext) SetInterface(key string, value interface{})
- func (context *BaseContext) SetString(key string, value string)
- func (context *BaseContext) SetUInt(key string, value uint)
- func (context *BaseContext) SetUInt64(key string, value uint64)
- func (context *BaseContext) UserData() map[string]interface{}
- type BaseService
- type BufReader
- type BufWriter
- type BytesReader
- type Client
- type ClientContext
- type Context
- type Filter
- type HttpClient
- func (client *HttpClient) Close()
- func (client *HttpClient) Compression() bool
- func (client *HttpClient) Http() *http.Client
- func (client *HttpClient) KeepAlive() bool
- func (client *HttpClient) MaxIdleConnsPerHost() int
- func (client *HttpClient) SetCompression(enable bool)
- func (client *HttpClient) SetKeepAlive(enable bool)
- func (client *HttpClient) SetMaxIdleConnsPerHost(value int)
- func (client *HttpClient) SetTLSClientConfig(config *tls.Config)
- func (client *HttpClient) SetUri(uri string)
- func (client *HttpClient) TLSClientConfig() *tls.Config
- type HttpContext
- type HttpService
- func (service *HttpService) AddAccessControlAllowOrigin(origin string)
- func (service *HttpService) ClientAccessPolicyXmlContent() []byte
- func (service *HttpService) ClientAccessPolicyXmlFile() string
- func (service *HttpService) CrossDomainXmlContent() []byte
- func (service *HttpService) CrossDomainXmlFile() string
- func (service *HttpService) RemoveAccessControlAllowOrigin(origin string)
- func (service *HttpService) Serve(response http.ResponseWriter, request *http.Request, ...)
- func (service *HttpService) ServeHTTP(response http.ResponseWriter, request *http.Request)
- func (service *HttpService) SetClientAccessPolicyXmlContent(content []byte)
- func (service *HttpService) SetClientAccessPolicyXmlFile(filename string)
- func (service *HttpService) SetCrossDomainXmlContent(content []byte)
- func (service *HttpService) SetCrossDomainXmlFile(filename string)
- type HttpServiceEvent
- type HttpTransporter
- type InvokeOptions
- type JSONRPCClientFilter
- type JSONRPCServiceFilter
- type Method
- type Methods
- func (methods *Methods) AddAllMethods(obj interface{}, options ...interface{})
- func (methods *Methods) AddFunction(name string, function interface{}, options ...interface{})
- func (methods *Methods) AddFunctions(names []string, functions []interface{}, options ...interface{})
- func (methods *Methods) AddMethods(obj interface{}, options ...interface{})
- func (methods *Methods) AddMissingMethod(method MissingMethod, options ...interface{})
- type MissingMethod
- type RawReader
- type Reader
- func (r *Reader) CheckTag(expectTag byte) error
- func (r *Reader) CheckTags(expectTags []byte) (tag byte, err error)
- func (r *Reader) ReadArray(a []reflect.Value) error
- func (r *Reader) ReadBigInt() (*big.Int, error)
- func (r *Reader) ReadBigIntWithoutTag() (*big.Int, error)
- func (r *Reader) ReadBool() (bool, error)
- func (r *Reader) ReadBytes() (*[]byte, error)
- func (r *Reader) ReadBytesWithoutTag() (*[]byte, error)
- func (r *Reader) ReadDateTime() (time.Time, error)
- func (r *Reader) ReadDateWithoutTag() (time.Time, error)
- func (r *Reader) ReadFloat32() (float32, error)
- func (r *Reader) ReadFloat32WithoutTag() (float32, error)
- func (r *Reader) ReadFloat64() (float64, error)
- func (r *Reader) ReadFloat64WithoutTag() (float64, error)
- func (r *Reader) ReadInt() (int, error)
- func (r *Reader) ReadInt16() (int16, error)
- func (r *Reader) ReadInt16WithoutTag() (int16, error)
- func (r *Reader) ReadInt32() (int32, error)
- func (r *Reader) ReadInt32WithoutTag() (int32, error)
- func (r *Reader) ReadInt64() (int64, error)
- func (r *Reader) ReadInt64WithoutTag() (int64, error)
- func (r *Reader) ReadInt8() (int8, error)
- func (r *Reader) ReadInt8WithoutTag() (int8, error)
- func (r *Reader) ReadIntWithoutTag() (int, error)
- func (r *Reader) ReadInteger(tag byte) (int, error)
- func (r *Reader) ReadList() (*list.List, error)
- func (r *Reader) ReadListWithoutTag() (*list.List, error)
- func (r *Reader) ReadMap(p interface{}) error
- func (r *Reader) ReadMapWithoutTag(p interface{}) error
- func (r *Reader) ReadObject(p interface{}) error
- func (r *Reader) ReadObjectWithoutTag(p interface{}) error
- func (r *Reader) ReadSlice(p interface{}) error
- func (r *Reader) ReadSliceWithoutTag(p interface{}) error
- func (r *Reader) ReadString() (string, error)
- func (r *Reader) ReadStringWithoutTag() (str string, err error)
- func (r *Reader) ReadTimeWithoutTag() (time.Time, error)
- func (r *Reader) ReadUUID() (*UUID, error)
- func (r *Reader) ReadUUIDWithoutTag() (*UUID, error)
- func (r *Reader) ReadUint() (uint, error)
- func (r *Reader) ReadUint16() (uint16, error)
- func (r *Reader) ReadUint16WithoutTag() (uint16, error)
- func (r *Reader) ReadUint32() (uint32, error)
- func (r *Reader) ReadUint32WithoutTag() (uint32, error)
- func (r *Reader) ReadUint64() (uint64, error)
- func (r *Reader) ReadUint64WithoutTag() (uint64, error)
- func (r *Reader) ReadUint8() (uint8, error)
- func (r *Reader) ReadUint8WithoutTag() (uint8, error)
- func (r *Reader) ReadUintWithoutTag() (uint, error)
- func (r *Reader) ReadUinteger(tag byte) (uint, error)
- func (r *Reader) ReadValue(v reflect.Value) error
- func (r *Reader) Reset()
- func (r *Reader) Stream() BufReader
- func (r *Reader) Unserialize(p interface{}) (err error)
- type ResultMode
- type ServiceEvent
- type StreamClient
- type StreamConnEntry
- type StreamConnPool
- type StreamContext
- type StreamService
- type TcpClient
- func (client *TcpClient) Close()
- func (client *TcpClient) SetKeepAlive(keepalive bool)
- func (client *TcpClient) SetKeepAlivePeriod(d time.Duration)
- func (client *TcpClient) SetLinger(sec int)
- func (client *TcpClient) SetNoDelay(noDelay bool)
- func (client *TcpClient) SetTLSClientConfig(config *tls.Config)
- func (client *TcpClient) SetTimeout(d time.Duration)
- func (client *TcpClient) SetUri(uri string)
- func (client *TcpClient) TLSClientConfig() *tls.Config
- func (client *TcpClient) Timeout() time.Duration
- type TcpContext
- type TcpServer
- type TcpService
- func (service *TcpService) ServeTCP(conn *net.TCPConn) (err error)
- func (service *TcpService) SetKeepAlive(keepalive bool)
- func (service *TcpService) SetKeepAlivePeriod(d time.Duration)
- func (service *TcpService) SetLinger(sec int)
- func (service *TcpService) SetNoDelay(noDelay bool)
- func (service *TcpService) SetTLSConfig(config *tls.Config)
- type TcpTransporter
- type Transporter
- type UUID
- type UnixClient
- type UnixContext
- type UnixServer
- type UnixService
- type UnixTransporter
- type WebSocketContext
- type WebSocketService
- type Writer
- func (w *Writer) Reset()
- func (w *Writer) Serialize(v interface{}) (err error)
- func (w *Writer) Stream() BufWriter
- func (w *Writer) WriteArray(v []reflect.Value) (err error)
- func (w *Writer) WriteBigInt(v *big.Int) (err error)
- func (w *Writer) WriteBool(v bool) error
- func (w *Writer) WriteBytes(bytes []byte) (err error)
- func (w *Writer) WriteBytesWithRef(bytes []byte) (err error)
- func (w *Writer) WriteFloat64(v float64) (err error)
- func (w *Writer) WriteInt64(v int64) (err error)
- func (w *Writer) WriteNull() error
- func (w *Writer) WriteString(str string) (err error)
- func (w *Writer) WriteStringWithRef(str string) (err error)
- func (w *Writer) WriteTime(t time.Time) (err error)
- func (w *Writer) WriteUint64(v uint64) (err error)
- func (w *Writer) WriteValue(v reflect.Value) (err error)
Constants ¶
View Source
const ( Normal = ResultMode(iota) Serialized Raw RawWithEndTag )
View Source
const ( /* Serialize Tags */ TagInteger byte = 'i' TagLong byte = 'l' TagDouble byte = 'd' TagNull byte = 'n' TagEmpty byte = 'e' TagTrue byte = 't' TagFalse byte = 'f' TagNaN byte = 'N' TagInfinity byte = 'I' TagDate byte = 'D' TagTime byte = 'T' TagUTC byte = 'Z' TagBytes byte = 'b' TagUTF8Char byte = 'u' TagString byte = 's' TagGuid byte = 'g' TagList byte = 'a' TagMap byte = 'm' TagClass byte = 'c' TagObject byte = 'o' TagRef byte = 'r' /* Serialize Marks */ TagPos byte = '+' TagNeg byte = '-' TagSemicolon byte = ';' TagOpenbrace byte = '{' TagClosebrace byte = '}' TagQuote byte = '"' TagPoint byte = '.' /* Protocol Tags */ TagFunctions byte = 'F' TagCall byte = 'C' TagResult byte = 'R' TagArgument byte = 'A' TagError byte = 'E' TagEnd byte = 'z' )
Variables ¶
View Source
var ClassManager = initClassManager()
ClassManager used to be register class with alias for hprose serialize/unserialize.
View Source
var DisableGlobalCookie = false
View Source
var NilError = errors.New("nil")
Functions ¶
func RegisterClientFactory ¶
func Unserialize ¶
Types ¶
type BaseClient ¶
type BaseClient struct { Transporter Client ByRef bool SimpleMode bool DebugEnabled bool // contains filtered or unexported fields }
func NewBaseClient ¶
func NewBaseClient(trans Transporter) *BaseClient
func (*BaseClient) AddFilter ¶
func (client *BaseClient) AddFilter(filter Filter)
func (*BaseClient) GetFilter ¶
func (client *BaseClient) GetFilter() Filter
func (*BaseClient) Invoke ¶
func (client *BaseClient) Invoke(name string, args []interface{}, options *InvokeOptions, result interface{}) <-chan error
func (*BaseClient) RemoveFilter ¶
func (client *BaseClient) RemoveFilter(filter Filter)
func (*BaseClient) SetFilter ¶
func (client *BaseClient) SetFilter(filter Filter)
func (*BaseClient) SetUri ¶
func (client *BaseClient) SetUri(uri string)
func (*BaseClient) Uri ¶
func (client *BaseClient) Uri() string
func (*BaseClient) UseService ¶
func (client *BaseClient) UseService(args ...interface{})
UseService (uri string) UseService (remoteObject interface{}) UseService (uri string, remoteObject interface{})
type BaseContext ¶
type BaseContext struct {
// contains filtered or unexported fields
}
func NewBaseContext ¶
func NewBaseContext() *BaseContext
func (*BaseContext) GetFloat ¶
func (context *BaseContext) GetFloat(key string) (value float64, ok bool)
func (*BaseContext) GetInt64 ¶
func (context *BaseContext) GetInt64(key string) (value int64, ok bool)
func (*BaseContext) GetInterface ¶
func (context *BaseContext) GetInterface(key string) (value interface{}, ok bool)
func (*BaseContext) GetString ¶
func (context *BaseContext) GetString(key string) (value string, ok bool)
func (*BaseContext) GetUInt64 ¶
func (context *BaseContext) GetUInt64(key string) (value uint64, ok bool)
func (*BaseContext) SetBool ¶
func (context *BaseContext) SetBool(key string, value bool)
func (*BaseContext) SetFloat ¶
func (context *BaseContext) SetFloat(key string, value float64)
func (*BaseContext) SetInt ¶
func (context *BaseContext) SetInt(key string, value int)
func (*BaseContext) SetInt64 ¶
func (context *BaseContext) SetInt64(key string, value int64)
func (*BaseContext) SetInterface ¶
func (context *BaseContext) SetInterface(key string, value interface{})
func (*BaseContext) SetString ¶
func (context *BaseContext) SetString(key string, value string)
func (*BaseContext) SetUInt ¶
func (context *BaseContext) SetUInt(key string, value uint)
func (*BaseContext) SetUInt64 ¶
func (context *BaseContext) SetUInt64(key string, value uint64)
func (*BaseContext) UserData ¶
func (context *BaseContext) UserData() map[string]interface{}
type BaseService ¶
type BaseService struct { *Methods ServiceEvent DebugEnabled bool // contains filtered or unexported fields }
func NewBaseService ¶
func NewBaseService() *BaseService
func (*BaseService) AddFilter ¶
func (service *BaseService) AddFilter(filter Filter)
func (*BaseService) GetFilter ¶
func (service *BaseService) GetFilter() Filter
func (*BaseService) Handle ¶
func (service *BaseService) Handle(data []byte, context Context) (output []byte)
func (*BaseService) RemoveFilter ¶
func (service *BaseService) RemoveFilter(filter Filter)
func (*BaseService) SetFilter ¶
func (service *BaseService) SetFilter(filter Filter)
type BytesReader ¶
type BytesReader struct {
// contains filtered or unexported fields
}
func NewBytesReader ¶
func NewBytesReader(b []byte) *BytesReader
func (*BytesReader) ReadByte ¶
func (r *BytesReader) ReadByte() (b byte, err error)
func (*BytesReader) ReadString ¶
func (r *BytesReader) ReadString(delim byte) (line string, err error)
type Client ¶
type Client interface { UseService(...interface{}) Invoke(string, []interface{}, *InvokeOptions, interface{}) <-chan error Uri() string SetUri(string) GetFilter() Filter SetFilter(filter Filter) AddFilter(filter Filter) RemoveFilter(filter Filter) TLSClientConfig() *tls.Config SetTLSClientConfig(config *tls.Config) SetKeepAlive(enable bool) Close() }
func NewHttpClient ¶
func NewTcpClient ¶
func NewUnixClient ¶
type ClientContext ¶
type ClientContext struct { *BaseContext Client }
type Context ¶
type Context interface { UserData() map[string]interface{} GetInt(key string) (value int, ok bool) GetUInt(key string) (value uint, ok bool) GetInt64(key string) (value int64, ok bool) GetUInt64(key string) (value uint64, ok bool) GetFloat(key string) (value float64, ok bool) GetBool(key string) (value bool, ok bool) GetString(key string) (value string, ok bool) GetInterface(key string) (value interface{}, ok bool) SetInt(key string, value int) SetUInt(key string, value uint) SetInt64(key string, value int64) SetUInt64(key string, value uint64) SetFloat(key string, value float64) SetBool(key string, value bool) SetString(key string, value string) SetInterface(key string, value interface{}) }
type HttpClient ¶
type HttpClient struct {
*BaseClient
}
func (*HttpClient) Close ¶
func (client *HttpClient) Close()
func (*HttpClient) Compression ¶
func (client *HttpClient) Compression() bool
func (*HttpClient) Http ¶
func (client *HttpClient) Http() *http.Client
func (*HttpClient) KeepAlive ¶
func (client *HttpClient) KeepAlive() bool
func (*HttpClient) MaxIdleConnsPerHost ¶
func (client *HttpClient) MaxIdleConnsPerHost() int
func (*HttpClient) SetCompression ¶
func (client *HttpClient) SetCompression(enable bool)
func (*HttpClient) SetKeepAlive ¶
func (client *HttpClient) SetKeepAlive(enable bool)
func (*HttpClient) SetMaxIdleConnsPerHost ¶
func (client *HttpClient) SetMaxIdleConnsPerHost(value int)
func (*HttpClient) SetTLSClientConfig ¶
func (client *HttpClient) SetTLSClientConfig(config *tls.Config)
func (*HttpClient) SetUri ¶
func (client *HttpClient) SetUri(uri string)
func (*HttpClient) TLSClientConfig ¶
func (client *HttpClient) TLSClientConfig() *tls.Config
type HttpContext ¶
type HttpContext struct { *BaseContext Response http.ResponseWriter Request *http.Request }
type HttpService ¶
type HttpService struct { *BaseService P3PEnabled bool GetEnabled bool CrossDomainEnabled bool // contains filtered or unexported fields }
func NewHttpService ¶
func NewHttpService() *HttpService
func (*HttpService) AddAccessControlAllowOrigin ¶
func (service *HttpService) AddAccessControlAllowOrigin(origin string)
func (*HttpService) ClientAccessPolicyXmlContent ¶
func (service *HttpService) ClientAccessPolicyXmlContent() []byte
func (*HttpService) ClientAccessPolicyXmlFile ¶
func (service *HttpService) ClientAccessPolicyXmlFile() string
func (*HttpService) CrossDomainXmlContent ¶
func (service *HttpService) CrossDomainXmlContent() []byte
func (*HttpService) CrossDomainXmlFile ¶
func (service *HttpService) CrossDomainXmlFile() string
func (*HttpService) RemoveAccessControlAllowOrigin ¶
func (service *HttpService) RemoveAccessControlAllowOrigin(origin string)
func (*HttpService) Serve ¶
func (service *HttpService) Serve(response http.ResponseWriter, request *http.Request, userData map[string]interface{})
func (*HttpService) ServeHTTP ¶
func (service *HttpService) ServeHTTP(response http.ResponseWriter, request *http.Request)
func (*HttpService) SetClientAccessPolicyXmlContent ¶
func (service *HttpService) SetClientAccessPolicyXmlContent(content []byte)
func (*HttpService) SetClientAccessPolicyXmlFile ¶
func (service *HttpService) SetClientAccessPolicyXmlFile(filename string)
func (*HttpService) SetCrossDomainXmlContent ¶
func (service *HttpService) SetCrossDomainXmlContent(content []byte)
func (*HttpService) SetCrossDomainXmlFile ¶
func (service *HttpService) SetCrossDomainXmlFile(filename string)
type HttpServiceEvent ¶
type HttpServiceEvent interface { ServiceEvent OnSendHeader(context *HttpContext) }
type HttpTransporter ¶
func (*HttpTransporter) SendAndReceive ¶
func (h *HttpTransporter) SendAndReceive(uri string, data []byte) ([]byte, error)
type InvokeOptions ¶
type InvokeOptions struct { ByRef interface{} // true, false, nil SimpleMode interface{} // true, false, nil ResultMode ResultMode }
type JSONRPCClientFilter ¶
type JSONRPCClientFilter struct {
Version string
}
func NewJSONRPCClientFilter ¶
func NewJSONRPCClientFilter(version string) JSONRPCClientFilter
func (JSONRPCClientFilter) InputFilter ¶
func (filter JSONRPCClientFilter) InputFilter(data []byte, context Context) []byte
func (JSONRPCClientFilter) OutputFilter ¶
func (filter JSONRPCClientFilter) OutputFilter(data []byte, context Context) []byte
type JSONRPCServiceFilter ¶
type JSONRPCServiceFilter struct{}
func (JSONRPCServiceFilter) InputFilter ¶
func (filter JSONRPCServiceFilter) InputFilter(data []byte, context Context) []byte
func (JSONRPCServiceFilter) OutputFilter ¶
func (filter JSONRPCServiceFilter) OutputFilter(data []byte, context Context) []byte
type Methods ¶
func NewMethods ¶
func NewMethods() *Methods
func (*Methods) AddAllMethods ¶
func (methods *Methods) AddAllMethods(obj interface{}, options ...interface{})
AddAllMethods will publish all methods and non-nil function fields on the obj self and on its anonymous or non-anonymous struct fields (or pointer to pointer ... to pointer struct fields). This is a recursive operation. So it's a pit, if you do not know what you are doing, do not step on.
func (*Methods) AddFunction ¶
func (*Methods) AddFunctions ¶
func (*Methods) AddMethods ¶
func (methods *Methods) AddMethods(obj interface{}, options ...interface{})
func (*Methods) AddMissingMethod ¶
func (methods *Methods) AddMissingMethod(method MissingMethod, options ...interface{})
type MissingMethod ¶
type RawReader ¶
type RawReader struct {
// contains filtered or unexported fields
}
func NewRawReader ¶
type Reader ¶
type Reader struct { *RawReader // contains filtered or unexported fields }
func (*Reader) ReadBytesWithoutTag ¶
func (*Reader) ReadFloat32 ¶
func (*Reader) ReadFloat32WithoutTag ¶
func (*Reader) ReadFloat64 ¶
func (*Reader) ReadFloat64WithoutTag ¶
func (*Reader) ReadInt16WithoutTag ¶
func (*Reader) ReadInt32WithoutTag ¶
func (*Reader) ReadInt64WithoutTag ¶
func (*Reader) ReadInt8WithoutTag ¶
func (*Reader) ReadIntWithoutTag ¶
func (*Reader) ReadMapWithoutTag ¶
func (*Reader) ReadObject ¶
func (*Reader) ReadObjectWithoutTag ¶
func (*Reader) ReadSliceWithoutTag ¶
func (*Reader) ReadString ¶
func (*Reader) ReadStringWithoutTag ¶
func (*Reader) ReadUUIDWithoutTag ¶
func (*Reader) ReadUint16 ¶
func (*Reader) ReadUint16WithoutTag ¶
func (*Reader) ReadUint32 ¶
func (*Reader) ReadUint32WithoutTag ¶
func (*Reader) ReadUint64 ¶
func (*Reader) ReadUint64WithoutTag ¶
func (*Reader) ReadUint8WithoutTag ¶
func (*Reader) ReadUintWithoutTag ¶
func (*Reader) Unserialize ¶
type ResultMode ¶
type ResultMode int
func (ResultMode) String ¶
func (result_mode ResultMode) String() string
type ServiceEvent ¶
type StreamClient ¶
type StreamClient struct { *BaseClient // contains filtered or unexported fields }
func (*StreamClient) SetReadBuffer ¶
func (client *StreamClient) SetReadBuffer(bytes int)
func (*StreamClient) SetReadTimeout ¶
func (client *StreamClient) SetReadTimeout(d time.Duration)
func (*StreamClient) SetWriteBuffer ¶
func (client *StreamClient) SetWriteBuffer(bytes int)
func (*StreamClient) SetWriteTimeout ¶
func (client *StreamClient) SetWriteTimeout(d time.Duration)
type StreamConnEntry ¶
type StreamConnEntry struct {
// contains filtered or unexported fields
}
func (*StreamConnEntry) Close ¶
func (connEntry *StreamConnEntry) Close()
func (*StreamConnEntry) Get ¶
func (connEntry *StreamConnEntry) Get() net.Conn
func (*StreamConnEntry) Set ¶
func (connEntry *StreamConnEntry) Set(conn net.Conn)
type StreamConnPool ¶
func (*StreamConnPool) Close ¶
func (connPool *StreamConnPool) Close(uri string)
func (*StreamConnPool) Free ¶
func (connPool *StreamConnPool) Free(entry *StreamConnEntry)
func (*StreamConnPool) Get ¶
func (connPool *StreamConnPool) Get(uri string) *StreamConnEntry
func (*StreamConnPool) SetTimeout ¶
func (connPool *StreamConnPool) SetTimeout(d time.Duration)
func (*StreamConnPool) Timeout ¶
func (connPool *StreamConnPool) Timeout() time.Duration
type StreamContext ¶
type StreamContext struct { *BaseContext net.Conn }
type StreamService ¶
type StreamService struct { *BaseService // contains filtered or unexported fields }
func (*StreamService) SetReadBuffer ¶
func (service *StreamService) SetReadBuffer(bytes int)
func (*StreamService) SetReadTimeout ¶
func (service *StreamService) SetReadTimeout(d time.Duration)
func (*StreamService) SetTimeout ¶
func (service *StreamService) SetTimeout(d time.Duration)
func (*StreamService) SetWriteBuffer ¶
func (service *StreamService) SetWriteBuffer(bytes int)
func (*StreamService) SetWriteTimeout ¶
func (service *StreamService) SetWriteTimeout(d time.Duration)
type TcpClient ¶
type TcpClient struct { *StreamClient // contains filtered or unexported fields }
func (*TcpClient) SetKeepAlive ¶
func (*TcpClient) SetKeepAlivePeriod ¶
func (*TcpClient) SetNoDelay ¶
func (*TcpClient) SetTLSClientConfig ¶
func (*TcpClient) SetTimeout ¶
func (*TcpClient) TLSClientConfig ¶
type TcpContext ¶
type TcpContext StreamContext
type TcpServer ¶
type TcpServer struct { *TcpService URL string ThreadCount int // contains filtered or unexported fields }
func NewTcpServer ¶
type TcpService ¶
type TcpService struct { *StreamService // contains filtered or unexported fields }
func NewTcpService ¶
func NewTcpService() *TcpService
func (*TcpService) SetKeepAlive ¶
func (service *TcpService) SetKeepAlive(keepalive bool)
func (*TcpService) SetKeepAlivePeriod ¶
func (service *TcpService) SetKeepAlivePeriod(d time.Duration)
func (*TcpService) SetLinger ¶
func (service *TcpService) SetLinger(sec int)
func (*TcpService) SetNoDelay ¶
func (service *TcpService) SetNoDelay(noDelay bool)
func (*TcpService) SetTLSConfig ¶
func (service *TcpService) SetTLSConfig(config *tls.Config)
type TcpTransporter ¶
type TcpTransporter struct { *TcpClient // contains filtered or unexported fields }
func (*TcpTransporter) SendAndReceive ¶
func (t *TcpTransporter) SendAndReceive(uri string, odata []byte) (idata []byte, err error)
type Transporter ¶
type UUID ¶
type UUID []byte
This type is only a UUID wrapper for hprose serialize/unserialize, If you want to generate UUIDs, you should use other UUID package.
type UnixClient ¶
type UnixClient struct {
*StreamClient
}
func (*UnixClient) Close ¶
func (client *UnixClient) Close()
func (*UnixClient) SetTimeout ¶
func (client *UnixClient) SetTimeout(d time.Duration)
func (*UnixClient) SetUri ¶
func (client *UnixClient) SetUri(uri string)
func (*UnixClient) Timeout ¶
func (client *UnixClient) Timeout() time.Duration
type UnixContext ¶
type UnixContext StreamContext
type UnixServer ¶
type UnixServer struct { *UnixService URL string ThreadCount int // contains filtered or unexported fields }
func NewUnixServer ¶
func NewUnixServer(uri string) *UnixServer
func (*UnixServer) Start ¶
func (server *UnixServer) Start() (err error)
func (*UnixServer) Stop ¶
func (server *UnixServer) Stop()
type UnixService ¶
type UnixService StreamService
func NewUnixService ¶
func NewUnixService() *UnixService
type UnixTransporter ¶
type UnixTransporter struct { *UnixClient // contains filtered or unexported fields }
func (*UnixTransporter) SendAndReceive ¶
func (t *UnixTransporter) SendAndReceive(uri string, odata []byte) (idata []byte, err error)
type WebSocketContext ¶ added in v1.4.1
type WebSocketContext struct { *BaseContext WebSocket *websocket.Conn }
type WebSocketService ¶ added in v1.4.1
type WebSocketService struct { *BaseService Handler websocket.Handler Server websocket.Server }
func NewWebSocketService ¶ added in v1.4.1
func NewWebSocketService() *WebSocketService
func (*WebSocketService) ServeWebSocket ¶ added in v1.4.1
func (service *WebSocketService) ServeWebSocket(ws *websocket.Conn)
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) WriteBytes ¶
func (*Writer) WriteBytesWithRef ¶
func (*Writer) WriteFloat64 ¶
func (*Writer) WriteInt64 ¶
func (*Writer) WriteString ¶
func (*Writer) WriteStringWithRef ¶
func (*Writer) WriteUint64 ¶
Source Files
¶
- 1_1_compatible.go
- class_manager.go
- client.go
- context.go
- filter.go
- formatter.go
- http_client.go
- http_service.go
- jsonrpc_client_filter.go
- jsonrpc_service_filter.go
- raw_reader.go
- reader.go
- result_mode.go
- service.go
- stream_client.go
- stream_common.go
- stream_service.go
- tags.go
- tcp_client.go
- tcp_service.go
- unix_client.go
- unix_service.go
- uuid.go
- websocket_service.go
- writer.go
Click to show internal directories.
Click to hide internal directories.