Versions in this module Expand all Collapse all v1 v1.4.1 May 1, 2015 Changes in this version + type WebSocketContext struct + WebSocket *websocket.Conn + type WebSocketService struct + Handler websocket.Handler + Server websocket.Server + func NewWebSocketService() *WebSocketService + func (service *WebSocketService) ServeWebSocket(ws *websocket.Conn) v1.4.0 Mar 10, 2015 Changes in this version + const Normal + const Raw + const RawWithEndTag + const Serialized + const TagArgument + const TagBytes + const TagCall + const TagClass + const TagClosebrace + const TagDate + const TagDouble + const TagEmpty + const TagEnd + const TagError + const TagFalse + const TagFunctions + const TagGuid + const TagInfinity + const TagInteger + const TagList + const TagLong + const TagMap + const TagNaN + const TagNeg + const TagNull + const TagObject + const TagOpenbrace + const TagPoint + const TagPos + const TagQuote + const TagRef + const TagResult + const TagSemicolon + const TagString + const TagTime + const TagTrue + const TagUTC + const TagUTF8Char + var ClassManager = initClassManager() + var DisableGlobalCookie = false + var NilError = errors.New("nil") + 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 interface + FixArgs func(args []reflect.Value, lastParamType reflect.Type, context Context) []reflect.Value + type BaseClient struct + ByRef bool + DebugEnabled bool + SimpleMode bool + func NewBaseClient(trans Transporter) *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 struct + func NewBaseContext() *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 struct + DebugEnabled bool + func NewBaseService() *BaseService + func (service *BaseService) AddFilter(filter Filter) + func (service *BaseService) GetFilter() Filter + func (service *BaseService) Handle(data []byte, context Context) (output []byte) + func (service *BaseService) RemoveFilter(filter Filter) + func (service *BaseService) SetFilter(filter Filter) + type BufReader interface + Read func(p []byte) (n int, err error) + ReadByte func() (c byte, err error) + ReadRune func() (r rune, size int, err error) + ReadString func(delim byte) (line string, err error) + type BufWriter interface + Write func(p []byte) (n int, err error) + WriteByte func(c byte) error + WriteRune func(r rune) (n int, err error) + WriteString func(s string) (n int, err error) + type BytesReader struct + func NewBytesReader(b []byte) *BytesReader + func (r *BytesReader) Read(b []byte) (n int, err error) + func (r *BytesReader) ReadByte() (b byte, err error) + func (r *BytesReader) ReadRune() (ch rune, size int, err error) + func (r *BytesReader) ReadString(delim byte) (line string, err error) + type Client interface + AddFilter func(filter Filter) + Close func() + GetFilter func() Filter + Invoke func(string, []interface{}, *InvokeOptions, interface{}) <-chan error + RemoveFilter func(filter Filter) + SetFilter func(filter Filter) + SetKeepAlive func(enable bool) + SetTLSClientConfig func(config *tls.Config) + SetUri func(string) + TLSClientConfig func() *tls.Config + Uri func() string + UseService func(...interface{}) + func NewClient(uri string) Client + func NewHttpClient(uri string) Client + func NewTcpClient(uri string) Client + func NewUnixClient(uri string) Client + type ClientContext struct + type Context interface + GetBool func(key string) (value bool, ok bool) + GetFloat func(key string) (value float64, ok bool) + GetInt func(key string) (value int, ok bool) + GetInt64 func(key string) (value int64, ok bool) + GetInterface func(key string) (value interface{}, ok bool) + GetString func(key string) (value string, ok bool) + GetUInt func(key string) (value uint, ok bool) + GetUInt64 func(key string) (value uint64, ok bool) + SetBool func(key string, value bool) + SetFloat func(key string, value float64) + SetInt func(key string, value int) + SetInt64 func(key string, value int64) + SetInterface func(key string, value interface{}) + SetString func(key string, value string) + SetUInt func(key string, value uint) + SetUInt64 func(key string, value uint64) + UserData func() map[string]interface{} + type Filter interface + InputFilter func(data []byte, context Context) []byte + OutputFilter func(data []byte, context Context) []byte + type HttpClient struct + 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 struct + Request *http.Request + Response http.ResponseWriter + type HttpService struct + CrossDomainEnabled bool + GetEnabled bool + P3PEnabled bool + func NewHttpService() *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 interface + OnSendHeader func(context *HttpContext) + type HttpTransporter struct + func (h *HttpTransporter) SendAndReceive(uri string, data []byte) ([]byte, error) + type InvokeOptions struct + ByRef interface{} + ResultMode ResultMode + SimpleMode interface{} + type JSONRPCClientFilter struct + Version string + func NewJSONRPCClientFilter(version string) JSONRPCClientFilter + func (filter JSONRPCClientFilter) InputFilter(data []byte, context Context) []byte + func (filter JSONRPCClientFilter) OutputFilter(data []byte, context Context) []byte + type JSONRPCServiceFilter struct + func (filter JSONRPCServiceFilter) InputFilter(data []byte, context Context) []byte + func (filter JSONRPCServiceFilter) OutputFilter(data []byte, context Context) []byte + type Method struct + Function reflect.Value + ResultMode ResultMode + SimpleMode bool + type Methods struct + MethodNames []string + RemoteMethods map[string]*Method + func NewMethods() *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 func(name string, args []reflect.Value) (result []reflect.Value) + type RawReader struct + func NewRawReader(stream BufReader) *RawReader + func (r *RawReader) ReadRaw() (raw []byte, err error) + func (r *RawReader) ReadRawTo(ostream BufWriter) (err error) + type Reader struct + func NewReader(stream BufReader, simple bool) *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 int + func (result_mode ResultMode) String() string + type ServiceEvent interface + OnAfterInvoke func(name string, args []reflect.Value, byref bool, result []reflect.Value, ...) + OnBeforeInvoke func(name string, args []reflect.Value, byref bool, context Context) + OnSendError func(err error, context Context) + type StreamClient struct + func (client *StreamClient) SetReadBuffer(bytes int) + func (client *StreamClient) SetReadTimeout(d time.Duration) + func (client *StreamClient) SetWriteBuffer(bytes int) + func (client *StreamClient) SetWriteTimeout(d time.Duration) + type StreamConnEntry struct + func (connEntry *StreamConnEntry) Close() + func (connEntry *StreamConnEntry) Get() net.Conn + func (connEntry *StreamConnEntry) Set(conn net.Conn) + type StreamConnPool struct + func (connPool *StreamConnPool) Close(uri string) + func (connPool *StreamConnPool) Free(entry *StreamConnEntry) + func (connPool *StreamConnPool) Get(uri string) *StreamConnEntry + func (connPool *StreamConnPool) SetTimeout(d time.Duration) + func (connPool *StreamConnPool) Timeout() time.Duration + type StreamContext struct + type StreamService struct + func (service *StreamService) SetReadBuffer(bytes int) + func (service *StreamService) SetReadTimeout(d time.Duration) + func (service *StreamService) SetTimeout(d time.Duration) + func (service *StreamService) SetWriteBuffer(bytes int) + func (service *StreamService) SetWriteTimeout(d time.Duration) + type TcpClient struct + 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 StreamContext + type TcpServer struct + ThreadCount int + URL string + func NewTcpServer(uri string) *TcpServer + func (server *TcpServer) Start() (err error) + func (server *TcpServer) Stop() + type TcpService struct + func NewTcpService() *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 struct + func (t *TcpTransporter) SendAndReceive(uri string, odata []byte) (idata []byte, err error) + type Transporter interface + SendAndReceive func(uri string, data []byte) ([]byte, error) + type UUID []byte + func ToUUID(s string) UUID + func (uuid UUID) String() string + type UnixClient struct + func (client *UnixClient) Close() + func (client *UnixClient) SetTimeout(d time.Duration) + func (client *UnixClient) SetUri(uri string) + func (client *UnixClient) Timeout() time.Duration + type UnixContext StreamContext + type UnixServer struct + ThreadCount int + URL string + func NewUnixServer(uri string) *UnixServer + func (server *UnixServer) Start() (err error) + func (server *UnixServer) Stop() + type UnixService StreamService + func NewUnixService() *UnixService + func (service *UnixService) ServeUnix(conn *net.UnixConn) (err error) + type UnixTransporter struct + func (t *UnixTransporter) SendAndReceive(uri string, odata []byte) (idata []byte, err error) + type Writer struct + func NewWriter(stream BufWriter, simple bool) *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)