Documentation ¶
Index ¶
- Variables
- func Now() *pb.Timestamp
- func Recycle(v interface{})
- type ComposedConn
- type Context
- type FramingReader
- func (f *FramingReader) BufReader() *bufio.Reader
- func (f *FramingReader) Next() (byte, int, error)
- func (f *FramingReader) Read(b []byte) (int, error)
- func (f *FramingReader) ReadAdapter() *ReadAdapter
- func (f *FramingReader) ReadMarshal(v Unmarshaller) (byte, int, error)
- func (f *FramingReader) Recycle()
- func (f *FramingReader) RecylableBufReader() io.Reader
- type FramingWriter
- type MarshalBytes
- type Marshaller
- type RPCClient
- type RPCContext
- type RPCHandler
- type RPCServer
- type ReadAdapter
- type ReadMarshaler
- type Recyclable
- type ULID
- func (u ULID) Bytes() []byte
- func (u ULID) Compare(other ULID) int
- func (u ULID) Equal(other ULID) bool
- func (u ULID) Marshal() ([]byte, error)
- func (u ULID) MarshalJSON() ([]byte, error)
- func (u ULID) MarshalTo(data []byte) (n int, err error)
- func (u *ULID) Size() int
- func (u *ULID) Unmarshal(data []byte) error
- func (u *ULID) UnmarshalJSON(data []byte) error
- type Unmarshaller
- type WriteAdapter
- type WriteMarshaler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidContext = errors.New("invalid context type")
View Source
var ErrProtocolError = errors.New("protocol error detected")
View Source
var ErrRemoteError = errors.New("remote error detected")
View Source
var ErrTooMuchData = errors.New("more data that expected passed in")
View Source
var ErrUnknownMethod = errors.New("unknown method requested")
Functions ¶
Types ¶
type ComposedConn ¶
func (*ComposedConn) BufioReader ¶
func (c *ComposedConn) BufioReader() *bufio.Reader
type Context ¶
type Context interface { Account() *pb.Account ReadMarshal(v Unmarshaller) (byte, error) WriteMarshal(tag byte, v Marshaller) error // Forwards any data between the 2 contexts BridgeTo(other Context) error // Returns a writer that will send traffic as framed messages Writer() io.WriteCloser // Returns a reader that recieves traffic as framed messages Reader() io.Reader // Returns the total number of messages and bytes, respectively, that the // context has transmitted. Accounting() (int64, int64) // Close the context and cleanup any resources. Does not close // any IOs though. Close() error }
func NewContext ¶
func NewContext(accountId *pb.Account, fr *FramingReader, fw *FramingWriter) Context
func WithCloser ¶
type FramingReader ¶
type FramingReader struct {
// contains filtered or unexported fields
}
func NewFramingReader ¶
func NewFramingReader(r io.Reader) (*FramingReader, error)
func (*FramingReader) BufReader ¶
func (f *FramingReader) BufReader() *bufio.Reader
func (*FramingReader) ReadAdapter ¶
func (f *FramingReader) ReadAdapter() *ReadAdapter
func (*FramingReader) ReadMarshal ¶
func (f *FramingReader) ReadMarshal(v Unmarshaller) (byte, int, error)
func (*FramingReader) Recycle ¶
func (f *FramingReader) Recycle()
func (*FramingReader) RecylableBufReader ¶
func (f *FramingReader) RecylableBufReader() io.Reader
type FramingWriter ¶
type FramingWriter struct {
// contains filtered or unexported fields
}
func NewFramingWriter ¶
func NewFramingWriter(w io.Writer) (*FramingWriter, error)
func (*FramingWriter) Recycle ¶
func (f *FramingWriter) Recycle()
func (*FramingWriter) WriteAdapter ¶
func (f *FramingWriter) WriteAdapter() *WriteAdapter
func (*FramingWriter) WriteFrame ¶
func (f *FramingWriter) WriteFrame(tag byte, size int) error
func (*FramingWriter) WriteMarshal ¶
func (f *FramingWriter) WriteMarshal(tag byte, v Marshaller) (int, error)
type MarshalBytes ¶
type MarshalBytes []byte
func (*MarshalBytes) Size ¶
func (m *MarshalBytes) Size() int
func (*MarshalBytes) Unmarshal ¶
func (m *MarshalBytes) Unmarshal(b []byte) error
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func NewRPCClient ¶
func (*RPCClient) Begin ¶
func (r *RPCClient) Begin(host, path string, req Marshaller) (RPCContext, error)
func (*RPCClient) Call ¶
func (r *RPCClient) Call(host, path string, req Marshaller, resp Unmarshaller) error
type RPCContext ¶
type RPCContext interface { Context ReadRequest(v Unmarshaller) error WriteResponse(v Marshaller) error }
type RPCHandler ¶
type RPCHandler interface {
HandleRPC(ctx context.Context, wctx RPCContext) error
}
type RPCServer ¶
type RPCServer struct {
// contains filtered or unexported fields
}
func (*RPCServer) AddMethod ¶
func (r *RPCServer) AddMethod(name string, h RPCHandler)
type ReadAdapter ¶
type ReadAdapter struct { FR *FramingReader // contains filtered or unexported fields }
type ReadMarshaler ¶
type ReadMarshaler interface {
ReadMarshal(Unmarshaller) (byte, int, error)
}
type Recyclable ¶
type Recyclable interface {
Recycle()
}
type Unmarshaller ¶
type WriteAdapter ¶
type WriteAdapter struct {
FW *FramingWriter
}
func (*WriteAdapter) Close ¶
func (f *WriteAdapter) Close() error
type WriteMarshaler ¶
type WriteMarshaler interface {
WriteMarshal(byte, Marshaller) (int, error)
}
Click to show internal directories.
Click to hide internal directories.