Documentation ¶
Index ¶
- Variables
- func Marshal(obj interface{}) ([]byte, error)
- func MarshalMessage(msg general.Message) ([]byte, error)
- func NewIterator(reader io.Reader, buf []byte) spi.Iterator
- func NewStream(writer io.Writer, buf []byte) spi.Stream
- func ToJSON(buf []byte) (string, error)
- func Unmarshal(buf []byte, obj interface{}) error
- func UnmarshalMessage(buf []byte) (general.Message, error)
- type API
- type Config
- type Decoder
- func (decoder *Decoder) Decode(val interface{}) error
- func (decoder *Decoder) DecodeMessage() (general.Message, error)
- func (decoder *Decoder) DecodeMessageArguments() (general.Struct, error)
- func (decoder *Decoder) DecodeMessageHeader() (protocol.MessageHeader, error)
- func (decoder *Decoder) Reset(reader io.Reader, buf []byte)
- type Encoder
- func (encoder *Encoder) Buffer() []byte
- func (encoder *Encoder) Encode(val interface{}) error
- func (encoder *Encoder) EncodeMessage(msg general.Message) error
- func (encoder *Encoder) EncodeMessageArguments(msgArgs general.Struct) error
- func (encoder *Encoder) EncodeMessageHeader(msgHeader protocol.MessageHeader) error
- func (encoder *Encoder) Reset(writer io.Writer)
- type Protocol
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{Protocol: ProtocolBinary, StaticCodegen: false}.Froze()
Functions ¶
func MarshalMessage ¶
MarshalMessage is just a shortcut to demonstrate message decoded by UnmarshalMessage can be encoded back
Types ¶
type API ¶
type API interface { // NewStream is low level streaming api NewStream(writer io.Writer, buf []byte) spi.Stream // NewIterator is low level streaming api NewIterator(reader io.Reader, buf []byte) spi.Iterator // Unmarshal from []byte Unmarshal(buf []byte, obj interface{}) error // UnmarshalMessage from []byte UnmarshalMessage(buf []byte) (general.Message, error) // Marshal to []byte Marshal(obj interface{}) ([]byte, error) // ToJSON convert thrift message to JSON string ToJSON(buf []byte) (string, error) // MarshalMessage to []byte MarshalMessage(msg general.Message) ([]byte, error) // NewDecoder to unmarshal from []byte or io.Reader NewDecoder(reader io.Reader, buf []byte) *Decoder // NewEncoder to marshal to io.Writer NewEncoder(writer io.Writer) *Encoder // WillDecodeFromBuffer should only be used in generic.Declare WillDecodeFromBuffer(sample ...interface{}) // WillDecodeFromReader should only be used in generic.Declare WillDecodeFromReader(sample ...interface{}) // WillEncode should only be used in generic.Declare WillEncode(sample ...interface{}) }
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func (*Decoder) DecodeMessageArguments ¶
func (*Decoder) DecodeMessageHeader ¶
func (decoder *Decoder) DecodeMessageHeader() (protocol.MessageHeader, error)
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func (*Encoder) EncodeMessageArguments ¶
func (*Encoder) EncodeMessageHeader ¶
func (encoder *Encoder) EncodeMessageHeader(msgHeader protocol.MessageHeader) error
Click to show internal directories.
Click to hide internal directories.