thrift

package
v0.0.0-...-b70e04c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2012 License: Apache-2.0, Zlib Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN_APPLICATION_EXCEPTION  = 0
	UNKNOWN_METHOD                 = 1
	INVALID_MESSAGE_TYPE_EXCEPTION = 2
	WRONG_METHOD_NAME              = 3
	BAD_SEQUENCE_ID                = 4
	MISSING_RESULT                 = 5
	INTERNAL_ERROR                 = 6
	PROTOCOL_ERROR                 = 7
)
View Source
const (
	COMPACT_PROTOCOL_ID       = 0x082
	COMPACT_VERSION           = 1
	COMPACT_VERSION_MASK      = 0x1f
	COMPACT_TYPE_MASK         = 0x0E0
	COMPACT_TYPE_SHIFT_AMOUNT = 5
)
View Source
const (
	COMPACT_BOOLEAN_TRUE  = 0x01
	COMPACT_BOOLEAN_FALSE = 0x02
	COMPACT_BYTE          = 0x03
	COMPACT_I16           = 0x04
	COMPACT_I32           = 0x05
	COMPACT_I64           = 0x06
	COMPACT_DOUBLE        = 0x07
	COMPACT_BINARY        = 0x08
	COMPACT_LIST          = 0x09
	COMPACT_SET           = 0x0A
	COMPACT_MAP           = 0x0B
	COMPACT_STRUCT        = 0x0C
)
View Source
const (
	VERSION_MASK = 0xffff0000
	VERSION_1    = 0x80010000
)
View Source
const (
	UNKNOWN_PROTOCOL_EXCEPTION = 0
	INVALID_DATA               = 1
	NEGATIVE_SIZE              = 2
	SIZE_LIMIT                 = 3
	BAD_VERSION                = 4
	NOT_IMPLEMENTED            = 5
)
View Source
const (
	UNKNOWN_TRANSPORT_EXCEPTION = 0
	NOT_OPEN                    = 1
	ALREADY_OPEN                = 2
	TIMED_OUT                   = 3
	END_OF_FILE                 = 4
)
View Source
const (
	STOP    = 0
	VOID    = 1
	BOOL    = 2
	BYTE    = 3
	I08     = 3
	DOUBLE  = 4
	I16     = 6
	I32     = 8
	I64     = 10
	STRING  = 11
	UTF7    = 11
	STRUCT  = 12
	MAP     = 13
	SET     = 14
	LIST    = 15
	ENUM    = 16
	UTF8    = 16
	UTF16   = 17
	GENERIC = 127
)
View Source
const (
	THRIFT_JSON_PROTOCOL_VERSION = 1
)

Variables

View Source
var (
	JSON_COMMA                   []byte
	JSON_COLON                   []byte
	JSON_LBRACE                  []byte
	JSON_RBRACE                  []byte
	JSON_LBRACKET                []byte
	JSON_RBRACKET                []byte
	JSON_QUOTE                   byte
	JSON_QUOTE_BYTES             []byte
	JSON_NULL                    []byte
	JSON_TRUE                    []byte
	JSON_FALSE                   []byte
	JSON_INFINITY                string
	JSON_NEGATIVE_INFINITY       string
	JSON_NAN                     string
	JSON_INFINITY_BYTES          []byte
	JSON_NEGATIVE_INFINITY_BYTES []byte
	JSON_NAN_BYTES               []byte
)
View Source
var (
	LOGGER *log.Logger
)
View Source
var (
	MaxSkipDepth = 1<<31 - 1
)

*

  • The maximum recursive depth the skip() function will traverse before
  • throwing a TException.

Functions

func CompareBool

func CompareBool(i, j bool) int

func CompareByte

func CompareByte(i, j byte) int

func CompareDouble

func CompareDouble(i, j float64) int

func CompareFloat

func CompareFloat(i, j float32) int

func CompareInt

func CompareInt(i, j int) int

func CompareInt16

func CompareInt16(i, j int16) int

func CompareInt32

func CompareInt32(i, j int32) int

func CompareInt64

func CompareInt64(i, j int32) int

func CompareString

func CompareString(i, j string) int

func CompareStringArray

func CompareStringArray(i, j []string) int

func JsonQuote

func JsonQuote(s string) string

func JsonUnquote

func JsonUnquote(s string) (string, bool)

func NewTNonblockingServerSocketAddr

func NewTNonblockingServerSocketAddr(addr net.Addr) (*TNonblockingServerSocket, TTransportException)

func NewTNonblockingServerSocketListener

func NewTNonblockingServerSocketListener(listener net.Listener) (*TNonblockingServerSocket, TTransportException)

func NewTNonblockingSocketAddr

func NewTNonblockingSocketAddr(addr net.Addr) (*TNonblockingSocket, TTransportException)

func NewTNonblockingSocketConn

func NewTNonblockingSocketConn(conn net.Conn) (*TNonblockingSocket, TTransportException)

func NewTServerSocketAddr

func NewTServerSocketAddr(addr net.Addr) (*TServerSocket, TTransportException)

func NewTServerSocketAddrTimeout

func NewTServerSocketAddrTimeout(addr net.Addr, nsecClientTimeout int64) (*TServerSocket, TTransportException)

func NewTSocketConn

func NewTSocketConn(connection net.Conn) (*TSocket, TTransportException)

*

  • Constructor that takes an already created socket. *
  • @param socket Already created socket object
  • @throws TTransportException if there is an error setting up the streams

func ReadAllTransport

func ReadAllTransport(p TTransport, buf []byte) (n int, err os.Error)

type TTransportBase struct { }

func (p* TTransportBase) IsOpen() bool {
  return false;
};
func (p* TTransportBase) Peek() bool {
  return p.IsOpen();
}
func (p* TTransportBase) Open() os.Error {
  return NewTTransportException(UNKNOWN, "Subclasses must implement TTransportBase.Open()");
}
func (p* TTransportBase) Close() os.Error {
  return NewTTransportException(UNKNOWN, "Subclasses must implement TTransportBase.Close()");
}
func (p* TTransportBase) Read(buf []byte) (int, os.Error) {
  return 0, NewTTransportExceptionDefaultString("Subclasses must implement TTransportBase.Read()");
}
func (p* TTransportBase) ReadAll(buf []byte) (n int, err os.Error){
  ret := 0;
  size := len(buf);
  for (n < size) {
    ret, err = p.Read(buf[n:]);
    if ret <= 0 {
      if err != nil {
        err = NewTTransportExceptionDefaultString("Cannot read. Remote side has closed. Tried to read " + string(size) + " bytes, but only got " + string(n) + " bytes.");
      }
      return ret, err;
    }
    n += ret;
  }
  return n, err;
}
func (p* TTransportBase) Write(buf []byte) (int, os.Error) {
  return 0, NewTTransportExceptionDefaultString("Subclasses must implement TTransportBase.Write()");
}
func (p* TTransportBase) Flush() os.Error {
  return nil;
}

*

  • Guarantees that all of len bytes are actually read off the transport. *
  • @param buf Array to read into
  • @param off Index to start reading at
  • @param len Maximum number of bytes to read
  • @return The number of bytes actually read, which must be equal to len
  • @return TTransportException if there was an error reading data

func SetMaxSkipDepth

func SetMaxSkipDepth(depth int)

*

  • Specifies the maximum recursive depth that the skip function will
  • traverse before throwing a TException. This is a global setting, so
  • any call to skip in this JVM will enforce this value. *
  • @param depth the maximum recursive depth. A value of 2 would allow
  • the skip function to skip a structure or collection with basic children,
  • but it would not permit skipping a struct that had a field containing
  • a child struct. A value of 1 would only allow skipping of simple
  • types and empty structs/collections.

Types

type EmptyInterface

type EmptyInterface interface{}

type Enumer

type Enumer interface {
	String() string
	Value() int
	IsEnum() bool
}

type EqualsList

type EqualsList interface {
	Equals(other TList) bool
}

type EqualsMap

type EqualsMap interface {
	Equals(other TMap) bool
}

type EqualsOtherInterface

type EqualsOtherInterface interface {
	Equals(other interface{}) bool
}

type EqualsSet

type EqualsSet interface {
	Equals(other TSet) bool
}

type EqualsStruct

type EqualsStruct interface {
	Equals(other TStruct) bool
}

type Flusher

type Flusher interface {
	Flush() (err os.Error)
}

type Numeric

type Numeric interface {
	Int64() int64
	Int32() int32
	Int16() int16
	Byte() byte
	Int() int
	Float64() float64
	Float32() float32
	String() string
	// contains filtered or unexported methods
}
var (
	INFINITY          Numeric
	NEGATIVE_INFINITY Numeric
	NAN               Numeric
	ZERO              Numeric
	NUMERIC_NULL      Numeric
)

func NewNullNumeric

func NewNullNumeric() Numeric

func NewNumericFromDouble

func NewNumericFromDouble(dValue float64) Numeric

func NewNumericFromI32

func NewNumericFromI32(iValue int32) Numeric

func NewNumericFromI64

func NewNumericFromI64(iValue int64) Numeric

func NewNumericFromJSONString

func NewNumericFromJSONString(sValue string, isNull bool) Numeric

func NewNumericFromString

func NewNumericFromString(sValue string) Numeric

type Stringer

type Stringer interface {
	String() string
}

type TApplicationException

type TApplicationException interface {
	TException
	TypeId() int32
	Read(iprot TProtocol) (TApplicationException, os.Error)
	Write(oprot TProtocol) os.Error
}

*

  • Application level exception *

func NewTApplicationException

func NewTApplicationException(type_ int32, message string) TApplicationException

func NewTApplicationExceptionDefault

func NewTApplicationExceptionDefault() TApplicationException

func NewTApplicationExceptionMessage

func NewTApplicationExceptionMessage(message string) TApplicationException

func NewTApplicationExceptionType

func NewTApplicationExceptionType(type_ int32) TApplicationException

type TBase

type TBase interface {

	/**
	 * Reads the TObject from the given input protocol
	 *
	 * @param iprot Input protocol
	 */
	Read(iprot TProtocol) (err TException)

	/**
	 * Writes the objects out to the protocol
	 *
	 * @param oprot Output protocol
	 */
	Write(oprot TProtocol) (err TException)

	/**
	 * Check if a field is currently set or unset.
	 *
	 * @param field
	 */
	IsSet(field TField) bool

	/**
	 * Get a field's value by field variable. Primitive types will be wrapped in
	 * the appropriate "boxed" types.
	 *
	 * @param field
	 */
	FieldValue(field TField) interface{}

	/**
	 * Set a field's value by field variable. Primitive types must be "boxed" in
	 * the appropriate object wrapper type.
	 *
	 * @param field
	 */
	SetFieldValue(field TField, value interface{})

	DeepCopy() TBase
}

*

  • Generic base interface for generated Thrift objects. *

type TBinaryProtocol

type TBinaryProtocol struct {
	// contains filtered or unexported fields
}

func NewTBinaryProtocol

func NewTBinaryProtocol(t TTransport, strictRead, strictWrite bool) *TBinaryProtocol

func NewTBinaryProtocolTransport

func NewTBinaryProtocolTransport(t TTransport) *TBinaryProtocol

func (*TBinaryProtocol) Flush

func (p *TBinaryProtocol) Flush() (err TProtocolException)

func (*TBinaryProtocol) ReadBinary

func (p *TBinaryProtocol) ReadBinary() ([]byte, TProtocolException)

func (*TBinaryProtocol) ReadBool

func (p *TBinaryProtocol) ReadBool() (bool, TProtocolException)

func (*TBinaryProtocol) ReadByte

func (p *TBinaryProtocol) ReadByte() (value byte, err TProtocolException)

func (*TBinaryProtocol) ReadDouble

func (p *TBinaryProtocol) ReadDouble() (value float64, err TProtocolException)

func (*TBinaryProtocol) ReadFieldBegin

func (p *TBinaryProtocol) ReadFieldBegin() (name string, typeId TType, seqId int16, err TProtocolException)

func (*TBinaryProtocol) ReadFieldEnd

func (p *TBinaryProtocol) ReadFieldEnd() TProtocolException

func (*TBinaryProtocol) ReadI16

func (p *TBinaryProtocol) ReadI16() (value int16, err TProtocolException)

func (*TBinaryProtocol) ReadI32

func (p *TBinaryProtocol) ReadI32() (value int32, err TProtocolException)

func (*TBinaryProtocol) ReadI64

func (p *TBinaryProtocol) ReadI64() (value int64, err TProtocolException)

func (*TBinaryProtocol) ReadListBegin

func (p *TBinaryProtocol) ReadListBegin() (elemType TType, size int, err TProtocolException)

func (*TBinaryProtocol) ReadListEnd

func (p *TBinaryProtocol) ReadListEnd() TProtocolException

func (*TBinaryProtocol) ReadMapBegin

func (p *TBinaryProtocol) ReadMapBegin() (kType, vType TType, size int, err TProtocolException)

func (*TBinaryProtocol) ReadMapEnd

func (p *TBinaryProtocol) ReadMapEnd() TProtocolException

func (*TBinaryProtocol) ReadMessageBegin

func (p *TBinaryProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err TProtocolException)

func (*TBinaryProtocol) ReadMessageEnd

func (p *TBinaryProtocol) ReadMessageEnd() TProtocolException

func (*TBinaryProtocol) ReadSetBegin

func (p *TBinaryProtocol) ReadSetBegin() (elemType TType, size int, err TProtocolException)

func (*TBinaryProtocol) ReadSetEnd

func (p *TBinaryProtocol) ReadSetEnd() TProtocolException

func (*TBinaryProtocol) ReadString

func (p *TBinaryProtocol) ReadString() (value string, err TProtocolException)

func (*TBinaryProtocol) ReadStructBegin

func (p *TBinaryProtocol) ReadStructBegin() (name string, err TProtocolException)

func (*TBinaryProtocol) ReadStructEnd

func (p *TBinaryProtocol) ReadStructEnd() TProtocolException

func (*TBinaryProtocol) Skip

func (p *TBinaryProtocol) Skip(fieldType TType) (err TProtocolException)

func (*TBinaryProtocol) Transport

func (p *TBinaryProtocol) Transport() TTransport

func (*TBinaryProtocol) WriteBinary

func (p *TBinaryProtocol) WriteBinary(value []byte) TProtocolException

func (*TBinaryProtocol) WriteBinaryFromReader

func (p *TBinaryProtocol) WriteBinaryFromReader(reader io.Reader, size int) TProtocolException

func (*TBinaryProtocol) WriteBool

func (p *TBinaryProtocol) WriteBool(value bool) TProtocolException

func (*TBinaryProtocol) WriteByte

func (p *TBinaryProtocol) WriteByte(value byte) TProtocolException

func (*TBinaryProtocol) WriteDouble

func (p *TBinaryProtocol) WriteDouble(value float64) TProtocolException

func (*TBinaryProtocol) WriteFieldBegin

func (p *TBinaryProtocol) WriteFieldBegin(name string, typeId TType, id int16) TProtocolException

func (*TBinaryProtocol) WriteFieldEnd

func (p *TBinaryProtocol) WriteFieldEnd() TProtocolException

func (*TBinaryProtocol) WriteFieldStop

func (p *TBinaryProtocol) WriteFieldStop() TProtocolException

func (*TBinaryProtocol) WriteI16

func (p *TBinaryProtocol) WriteI16(value int16) TProtocolException

func (*TBinaryProtocol) WriteI32

func (p *TBinaryProtocol) WriteI32(value int32) TProtocolException

func (*TBinaryProtocol) WriteI64

func (p *TBinaryProtocol) WriteI64(value int64) TProtocolException

func (*TBinaryProtocol) WriteListBegin

func (p *TBinaryProtocol) WriteListBegin(elemType TType, size int) TProtocolException

func (*TBinaryProtocol) WriteListEnd

func (p *TBinaryProtocol) WriteListEnd() TProtocolException

func (*TBinaryProtocol) WriteMapBegin

func (p *TBinaryProtocol) WriteMapBegin(keyType TType, valueType TType, size int) TProtocolException

func (*TBinaryProtocol) WriteMapEnd

func (p *TBinaryProtocol) WriteMapEnd() TProtocolException

func (*TBinaryProtocol) WriteMessageBegin

func (p *TBinaryProtocol) WriteMessageBegin(name string, typeId TMessageType, seqId int32) TProtocolException

func (*TBinaryProtocol) WriteMessageEnd

func (p *TBinaryProtocol) WriteMessageEnd() TProtocolException

func (*TBinaryProtocol) WriteSetBegin

func (p *TBinaryProtocol) WriteSetBegin(elemType TType, size int) TProtocolException

func (*TBinaryProtocol) WriteSetEnd

func (p *TBinaryProtocol) WriteSetEnd() TProtocolException

func (*TBinaryProtocol) WriteString

func (p *TBinaryProtocol) WriteString(value string) TProtocolException

func (*TBinaryProtocol) WriteStructBegin

func (p *TBinaryProtocol) WriteStructBegin(name string) TProtocolException

func (*TBinaryProtocol) WriteStructEnd

func (p *TBinaryProtocol) WriteStructEnd() TProtocolException

type TBinaryProtocolFactory

type TBinaryProtocolFactory struct {
	// contains filtered or unexported fields
}

func NewTBinaryProtocolFactory

func NewTBinaryProtocolFactory(strictRead, strictWrite bool) *TBinaryProtocolFactory

func NewTBinaryProtocolFactoryDefault

func NewTBinaryProtocolFactoryDefault() *TBinaryProtocolFactory

func (*TBinaryProtocolFactory) GetProtocol

func (p *TBinaryProtocolFactory) GetProtocol(t TTransport) TProtocol

type TCompactProtocol

type TCompactProtocol struct {
	// contains filtered or unexported fields
}

func NewTCompactProtocol

func NewTCompactProtocol(trans TTransport) *TCompactProtocol

*

  • Create a TCompactProtocol. *
  • @param transport the TTransport object to read from or write to.

func (*TCompactProtocol) Flush

func (p *TCompactProtocol) Flush() (err TProtocolException)

func (*TCompactProtocol) ReadBinary

func (p *TCompactProtocol) ReadBinary() (value []byte, err TProtocolException)

*

  • Read a []byte from the wire.

func (*TCompactProtocol) ReadBool

func (p *TCompactProtocol) ReadBool() (value bool, err TProtocolException)

*

  • Read a boolean off the wire. If this is a boolean field, the value should
  • already have been read during readFieldBegin, so we'll just consume the
  • pre-stored value. Otherwise, read a byte.

func (*TCompactProtocol) ReadByte

func (p *TCompactProtocol) ReadByte() (value byte, err TProtocolException)

*

  • Read a single byte off the wire. Nothing interesting here.

func (*TCompactProtocol) ReadDouble

func (p *TCompactProtocol) ReadDouble() (value float64, err TProtocolException)

*

  • No magic here - just read a double off the wire.

func (*TCompactProtocol) ReadFieldBegin

func (p *TCompactProtocol) ReadFieldBegin() (name string, typeId TType, id int16, err TProtocolException)

*

  • Read a field header off the wire.

func (*TCompactProtocol) ReadFieldEnd

func (p *TCompactProtocol) ReadFieldEnd() TProtocolException

func (*TCompactProtocol) ReadI16

func (p *TCompactProtocol) ReadI16() (value int16, err TProtocolException)

*

  • Read an i16 from the wire as a zigzag varint.

func (*TCompactProtocol) ReadI32

func (p *TCompactProtocol) ReadI32() (value int32, err TProtocolException)

*

  • Read an i32 from the wire as a zigzag varint.

func (*TCompactProtocol) ReadI64

func (p *TCompactProtocol) ReadI64() (value int64, err TProtocolException)

*

  • Read an i64 from the wire as a zigzag varint.

func (*TCompactProtocol) ReadListBegin

func (p *TCompactProtocol) ReadListBegin() (elemType TType, size int, err TProtocolException)

*

  • Read a list header off the wire. If the list size is 0-14, the size will
  • be packed into the element type header. If it's a longer list, the 4 MSB
  • of the element type header will be 0xF, and a varint will follow with the
  • true size.

func (*TCompactProtocol) ReadListEnd

func (p *TCompactProtocol) ReadListEnd() TProtocolException

func (*TCompactProtocol) ReadMapBegin

func (p *TCompactProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, err TProtocolException)

*

  • Read a map header off the wire. If the size is zero, skip reading the key
  • and value type. This means that 0-length maps will yield TMaps without the
  • "correct" types.

func (*TCompactProtocol) ReadMapEnd

func (p *TCompactProtocol) ReadMapEnd() TProtocolException

func (*TCompactProtocol) ReadMessageBegin

func (p *TCompactProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err TProtocolException)

*

  • Read a message header.

func (*TCompactProtocol) ReadMessageEnd

func (p *TCompactProtocol) ReadMessageEnd() TProtocolException

func (*TCompactProtocol) ReadSetBegin

func (p *TCompactProtocol) ReadSetBegin() (elemType TType, size int, err TProtocolException)

*

  • Read a set header off the wire. If the set size is 0-14, the size will
  • be packed into the element type header. If it's a longer set, the 4 MSB
  • of the element type header will be 0xF, and a varint will follow with the
  • true size.

func (*TCompactProtocol) ReadSetEnd

func (p *TCompactProtocol) ReadSetEnd() TProtocolException

func (*TCompactProtocol) ReadString

func (p *TCompactProtocol) ReadString() (value string, err TProtocolException)

*

  • Reads a []byte (via readBinary), and then UTF-8 decodes it.

func (*TCompactProtocol) ReadStructBegin

func (p *TCompactProtocol) ReadStructBegin() (name string, err TProtocolException)

*

  • Read a struct begin. There's nothing on the wire for this, but it is our
  • opportunity to push a new struct begin marker onto the field stack.

func (*TCompactProtocol) ReadStructEnd

func (p *TCompactProtocol) ReadStructEnd() TProtocolException

*

  • Doesn't actually consume any wire data, just removes the last field for
  • this struct from the field stack.

func (*TCompactProtocol) Skip

func (p *TCompactProtocol) Skip(fieldType TType) (err TProtocolException)

func (*TCompactProtocol) Transport

func (p *TCompactProtocol) Transport() TTransport

func (*TCompactProtocol) WriteBinary

func (p *TCompactProtocol) WriteBinary(bin []byte) TProtocolException

*

  • Write a byte array, using a varint for the size.

func (*TCompactProtocol) WriteBool

func (p *TCompactProtocol) WriteBool(value bool) TProtocolException

func (*TCompactProtocol) WriteByte

func (p *TCompactProtocol) WriteByte(value byte) TProtocolException

*

  • Write a byte. Nothing to see here!

func (*TCompactProtocol) WriteDouble

func (p *TCompactProtocol) WriteDouble(value float64) TProtocolException

*

  • Write a double to the wire as 8 bytes.

func (*TCompactProtocol) WriteFieldBegin

func (p *TCompactProtocol) WriteFieldBegin(name string, typeId TType, id int16) TProtocolException

func (*TCompactProtocol) WriteFieldEnd

func (p *TCompactProtocol) WriteFieldEnd() TProtocolException

func (*TCompactProtocol) WriteFieldStop

func (p *TCompactProtocol) WriteFieldStop() TProtocolException

func (*TCompactProtocol) WriteI16

func (p *TCompactProtocol) WriteI16(value int16) TProtocolException

*

  • Write an I16 as a zigzag varint.

func (*TCompactProtocol) WriteI32

func (p *TCompactProtocol) WriteI32(value int32) TProtocolException

*

  • Write an i32 as a zigzag varint.

func (*TCompactProtocol) WriteI64

func (p *TCompactProtocol) WriteI64(value int64) TProtocolException

*

  • Write an i64 as a zigzag varint.

func (*TCompactProtocol) WriteListBegin

func (p *TCompactProtocol) WriteListBegin(elemType TType, size int) TProtocolException

*

  • Write a list header.

func (*TCompactProtocol) WriteListEnd

func (p *TCompactProtocol) WriteListEnd() TProtocolException

func (*TCompactProtocol) WriteMapBegin

func (p *TCompactProtocol) WriteMapBegin(keyType TType, valueType TType, size int) TProtocolException

func (*TCompactProtocol) WriteMapEnd

func (p *TCompactProtocol) WriteMapEnd() TProtocolException

func (*TCompactProtocol) WriteMessageBegin

func (p *TCompactProtocol) WriteMessageBegin(name string, typeId TMessageType, seqid int32) TProtocolException

*

  • Write a message header to the wire. Compact Protocol messages contain the
  • protocol version so we can migrate forwards in the future if need be.

func (*TCompactProtocol) WriteMessageEnd

func (p *TCompactProtocol) WriteMessageEnd() TProtocolException

func (*TCompactProtocol) WriteSetBegin

func (p *TCompactProtocol) WriteSetBegin(elemType TType, size int) TProtocolException

*

  • Write a set header.

func (*TCompactProtocol) WriteSetEnd

func (p *TCompactProtocol) WriteSetEnd() TProtocolException

func (*TCompactProtocol) WriteString

func (p *TCompactProtocol) WriteString(value string) TProtocolException

*

  • Write a string to the wire with a varint size preceeding.

func (*TCompactProtocol) WriteStructBegin

func (p *TCompactProtocol) WriteStructBegin(name string) TProtocolException

*

  • Write a struct begin. This doesn't actually put anything on the wire. We
  • use it as an opportunity to put special placeholder markers on the field
  • stack so we can get the field id deltas correct.

func (*TCompactProtocol) WriteStructEnd

func (p *TCompactProtocol) WriteStructEnd() TProtocolException

*

  • Write a struct end. This doesn't actually put anything on the wire. We use
  • this as an opportunity to pop the last field from the current struct off
  • of the field stack.

type TCompactProtocolFactory

type TCompactProtocolFactory struct{}

func NewTCompactProtocolFactory

func NewTCompactProtocolFactory() *TCompactProtocolFactory

func (*TCompactProtocolFactory) GetProtocol

func (p *TCompactProtocolFactory) GetProtocol(trans TTransport) TProtocol

type TCompactType

type TCompactType byte

type TContainer

type TContainer interface {
	Len() int
	Contains(data interface{}) bool
	Equals(other interface{}) bool
	CompareTo(other interface{}) (int, bool)
}

type TException

type TException interface {
	String() string
}

func NewTException

func NewTException(m string) TException

func NewTExceptionFromOsError

func NewTExceptionFromOsError(e os.Error) TException

type TField

type TField interface {
	Name() string
	TypeId() TType
	Id() int
	String() string
	CompareTo(other interface{}) (int, bool)
	Equals(other interface{}) bool
}

*

  • Helper class that encapsulates field metadata. *
var ANONYMOUS_FIELD TField

func NewTField

func NewTField(n string, t TType, i int) TField

func NewTFieldDefault

func NewTFieldDefault() TField

type TFieldContainer

type TFieldContainer interface {
	TContainer
	FieldNameFromFieldId(id int) string
	FieldIdFromFieldName(name string) int
	FieldFromFieldId(id int) TField
	FieldFromFieldName(name string) TField
	At(i int) TField
	Iter() <-chan TField
}

func NewTFieldContainer

func NewTFieldContainer(fields []TField) TFieldContainer

type TFramedTransport

type TFramedTransport struct {
	// contains filtered or unexported fields
}

func NewTFramedTransport

func NewTFramedTransport(transport TTransport) *TFramedTransport

func (*TFramedTransport) Close

func (p *TFramedTransport) Close() os.Error

func (*TFramedTransport) Flush

func (p *TFramedTransport) Flush() os.Error

func (*TFramedTransport) IsOpen

func (p *TFramedTransport) IsOpen() bool

func (*TFramedTransport) Open

func (p *TFramedTransport) Open() os.Error

func (*TFramedTransport) Peek

func (p *TFramedTransport) Peek() bool

func (*TFramedTransport) Read

func (p *TFramedTransport) Read(buf []byte) (int, os.Error)

func (*TFramedTransport) ReadAll

func (p *TFramedTransport) ReadAll(buf []byte) (int, os.Error)

func (*TFramedTransport) Write

func (p *TFramedTransport) Write(buf []byte) (int, os.Error)

type THttpClient

type THttpClient struct {
	// contains filtered or unexported fields
}

func (*THttpClient) Close

func (p *THttpClient) Close() os.Error

func (*THttpClient) Flush

func (p *THttpClient) Flush() os.Error

func (*THttpClient) IsOpen

func (p *THttpClient) IsOpen() bool

func (*THttpClient) Open

func (p *THttpClient) Open() os.Error

func (*THttpClient) Peek

func (p *THttpClient) Peek() bool

func (*THttpClient) Read

func (p *THttpClient) Read(buf []byte) (int, os.Error)

func (*THttpClient) ReadAll

func (p *THttpClient) ReadAll(buf []byte) (int, os.Error)

func (*THttpClient) Write

func (p *THttpClient) Write(buf []byte) (int, os.Error)

type THttpClientTransportFactory

type THttpClientTransportFactory struct {
	// contains filtered or unexported fields
}

func NewTHttpClientTransportFactory

func NewTHttpClientTransportFactory(url string) *THttpClientTransportFactory

func NewTHttpPostClientTransportFactory

func NewTHttpPostClientTransportFactory(url string) *THttpClientTransportFactory

func (*THttpClientTransportFactory) GetTransport

func (p *THttpClientTransportFactory) GetTransport(trans TTransport) TTransport

type TIOStreamTransport

type TIOStreamTransport struct {
	Reader       io.Reader
	Writer       io.Writer
	IsReadWriter bool
}

*

  • This is the most commonly used base transport. It takes an InputStream
  • and an OutputStream and uses those to perform all transport operations.
  • This allows for compatibility with all the nice constructs Java already
  • has to provide a variety of types of streams. *

func NewTIOStreamTransportDefault

func NewTIOStreamTransportDefault() *TIOStreamTransport

*

  • Subclasses can invoke the default constructor and then assign the input
  • streams in the open method.

func NewTIOStreamTransportR

func NewTIOStreamTransportR(r io.Reader) *TIOStreamTransport

*

  • Input stream constructor. *
  • @param is Input stream to read from

func NewTIOStreamTransportRAndW

func NewTIOStreamTransportRAndW(r io.Reader, w io.Writer) *TIOStreamTransport

*

  • Two-way stream constructor. *
  • @param is Input stream to read from
  • @param os Output stream to read from

func NewTIOStreamTransportRW

func NewTIOStreamTransportRW(rw io.ReadWriter) *TIOStreamTransport

*

  • Two-way stream constructor. *
  • @param is Input stream to read from
  • @param os Output stream to read from

func NewTIOStreamTransportW

func NewTIOStreamTransportW(w io.Writer) *TIOStreamTransport

*

  • Output stream constructor. *
  • @param os Output stream to read from

func (*TIOStreamTransport) Close

func (p *TIOStreamTransport) Close() os.Error

*

  • Closes both the input and output streams.

func (*TIOStreamTransport) Flush

func (p *TIOStreamTransport) Flush() os.Error

*

  • Flushes the underlying output stream if not null.

func (*TIOStreamTransport) IsOpen

func (p *TIOStreamTransport) IsOpen() bool

*

  • The streams must already be open at construction time, so this should
  • always return true. *
  • @return true

func (*TIOStreamTransport) Open

func (p *TIOStreamTransport) Open() os.Error

*

  • The streams must already be open. This method does nothing.

func (*TIOStreamTransport) Peek

func (p *TIOStreamTransport) Peek() bool

func (*TIOStreamTransport) Read

func (p *TIOStreamTransport) Read(buf []byte) (int, os.Error)

*

  • Reads from the underlying input stream if not null.

func (*TIOStreamTransport) ReadAll

func (p *TIOStreamTransport) ReadAll(buf []byte) (int, os.Error)

func (*TIOStreamTransport) Write

func (p *TIOStreamTransport) Write(buf []byte) (int, os.Error)

*

  • Writes to the underlying output stream if not null.

type TIOStreamTransportFactory

type TIOStreamTransportFactory struct {
	Reader       io.Reader
	Writer       io.Writer
	IsReadWriter bool
}

func NewTIOStreamTransportFactory

func NewTIOStreamTransportFactory(reader io.Reader, writer io.Writer, isReadWriter bool) *TIOStreamTransportFactory

func (*TIOStreamTransportFactory) GetTransport

func (p *TIOStreamTransportFactory) GetTransport(trans TTransport) TTransport

type TJSONProtocol

type TJSONProtocol struct {
	*TSimpleJSONProtocol
}

*

  • JSON protocol implementation for thrift. *
  • This protocol produces/consumes a simple output format
  • suitable for parsing by scripting languages. It should not be
  • confused with the full-featured TJSONProtocol. *

func NewTJSONProtocol

func NewTJSONProtocol(t TTransport) *TJSONProtocol

*

  • Constructor

func (*TJSONProtocol) Flush

func (p *TJSONProtocol) Flush() (err TProtocolException)

func (*TJSONProtocol) ReadBinary

func (p *TJSONProtocol) ReadBinary() ([]byte, TProtocolException)

func (*TJSONProtocol) ReadBool

func (p *TJSONProtocol) ReadBool() (bool, TProtocolException)

func (*TJSONProtocol) ReadByte

func (p *TJSONProtocol) ReadByte() (byte, TProtocolException)

func (*TJSONProtocol) ReadDouble

func (p *TJSONProtocol) ReadDouble() (float64, TProtocolException)

func (*TJSONProtocol) ReadFieldBegin

func (p *TJSONProtocol) ReadFieldBegin() (string, TType, int16, TProtocolException)

func (*TJSONProtocol) ReadFieldEnd

func (p *TJSONProtocol) ReadFieldEnd() TProtocolException

func (*TJSONProtocol) ReadI16

func (p *TJSONProtocol) ReadI16() (int16, TProtocolException)

func (*TJSONProtocol) ReadI32

func (p *TJSONProtocol) ReadI32() (int32, TProtocolException)

func (*TJSONProtocol) ReadI64

func (p *TJSONProtocol) ReadI64() (int64, TProtocolException)

func (*TJSONProtocol) ReadListBegin

func (p *TJSONProtocol) ReadListBegin() (elemType TType, size int, e TProtocolException)

func (*TJSONProtocol) ReadListEnd

func (p *TJSONProtocol) ReadListEnd() TProtocolException

func (*TJSONProtocol) ReadMapBegin

func (p *TJSONProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, e TProtocolException)

func (*TJSONProtocol) ReadMapEnd

func (p *TJSONProtocol) ReadMapEnd() TProtocolException

func (*TJSONProtocol) ReadMessageBegin

func (p *TJSONProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err TProtocolException)

func (*TJSONProtocol) ReadMessageEnd

func (p *TJSONProtocol) ReadMessageEnd() TProtocolException

func (*TJSONProtocol) ReadSetBegin

func (p *TJSONProtocol) ReadSetBegin() (elemType TType, size int, e TProtocolException)

func (*TJSONProtocol) ReadSetEnd

func (p *TJSONProtocol) ReadSetEnd() TProtocolException

func (*TJSONProtocol) ReadString

func (p *TJSONProtocol) ReadString() (string, TProtocolException)

func (*TJSONProtocol) ReadStructBegin

func (p *TJSONProtocol) ReadStructBegin() (name string, err TProtocolException)

func (*TJSONProtocol) ReadStructEnd

func (p *TJSONProtocol) ReadStructEnd() TProtocolException

func (*TJSONProtocol) Skip

func (p *TJSONProtocol) Skip(fieldType TType) (err TProtocolException)

func (*TJSONProtocol) StringToTypeId

func (p *TJSONProtocol) StringToTypeId(fieldType string) TType

func (*TJSONProtocol) Transport

func (p *TJSONProtocol) Transport() TTransport

func (*TJSONProtocol) TypeIdToString

func (p *TJSONProtocol) TypeIdToString(fieldType TType) string

func (*TJSONProtocol) WriteBinary

func (p *TJSONProtocol) WriteBinary(v []byte) TProtocolException

func (*TJSONProtocol) WriteBool

func (p *TJSONProtocol) WriteBool(b bool) TProtocolException

func (*TJSONProtocol) WriteByte

func (p *TJSONProtocol) WriteByte(b byte) TProtocolException

func (*TJSONProtocol) WriteDouble

func (p *TJSONProtocol) WriteDouble(v float64) TProtocolException

func (*TJSONProtocol) WriteFieldBegin

func (p *TJSONProtocol) WriteFieldBegin(name string, typeId TType, id int16) TProtocolException

func (*TJSONProtocol) WriteFieldEnd

func (p *TJSONProtocol) WriteFieldEnd() TProtocolException

func (*TJSONProtocol) WriteFieldStop

func (p *TJSONProtocol) WriteFieldStop() TProtocolException

func (*TJSONProtocol) WriteI16

func (p *TJSONProtocol) WriteI16(v int16) TProtocolException

func (*TJSONProtocol) WriteI32

func (p *TJSONProtocol) WriteI32(v int32) TProtocolException

func (*TJSONProtocol) WriteI64

func (p *TJSONProtocol) WriteI64(v int64) TProtocolException

func (*TJSONProtocol) WriteListBegin

func (p *TJSONProtocol) WriteListBegin(elemType TType, size int) TProtocolException

func (*TJSONProtocol) WriteListEnd

func (p *TJSONProtocol) WriteListEnd() TProtocolException

func (*TJSONProtocol) WriteMapBegin

func (p *TJSONProtocol) WriteMapBegin(keyType TType, valueType TType, size int) TProtocolException

func (*TJSONProtocol) WriteMapEnd

func (p *TJSONProtocol) WriteMapEnd() TProtocolException

func (*TJSONProtocol) WriteMessageBegin

func (p *TJSONProtocol) WriteMessageBegin(name string, typeId TMessageType, seqId int32) TProtocolException

func (*TJSONProtocol) WriteMessageEnd

func (p *TJSONProtocol) WriteMessageEnd() TProtocolException

func (*TJSONProtocol) WriteSetBegin

func (p *TJSONProtocol) WriteSetBegin(elemType TType, size int) TProtocolException

func (*TJSONProtocol) WriteSetEnd

func (p *TJSONProtocol) WriteSetEnd() TProtocolException

func (*TJSONProtocol) WriteString

func (p *TJSONProtocol) WriteString(v string) TProtocolException

func (*TJSONProtocol) WriteStructBegin

func (p *TJSONProtocol) WriteStructBegin(name string) TProtocolException

func (*TJSONProtocol) WriteStructEnd

func (p *TJSONProtocol) WriteStructEnd() TProtocolException

type TJSONProtocolFactory

type TJSONProtocolFactory struct{}

*

  • Factory

func NewTJSONProtocolFactory

func NewTJSONProtocolFactory() *TJSONProtocolFactory

func (*TJSONProtocolFactory) GetProtocol

func (p *TJSONProtocolFactory) GetProtocol(trans TTransport) TProtocol

type TList

type TList interface {
	TContainer
	ElemType() TType
	At(i int) interface{}
	Set(i int, data interface{})
	Push(data interface{})
	Pop() interface{}
	Swap(i, j int)
	Insert(i int, data interface{})
	Delete(i int)
	Less(i, j int) bool
	Iter() <-chan interface{}
}

*

  • Helper class that encapsulates list metadata. *

func NewTList

func NewTList(t TType, s int) TList

func NewTListDefault

func NewTListDefault() TList

type TMap

type TMap interface {
	KeyType() TType
	ValueType() TType
	Len() int
	Set(key, value interface{})
	Get(key interface{}) (interface{}, bool)
	Contains(key interface{}) bool
	Iter() <-chan TMapElem
	KeyIter() <-chan interface{}
	ValueIter() <-chan interface{}
	Keys() []interface{}
	Values() []interface{}
	Less(other interface{}) bool
	Equals(other interface{}) bool
	CompareTo(other interface{}) (int, bool)
}

*

  • Helper class that encapsulates map metadata. *

func NewTMap

func NewTMap(k, v TType, s int) TMap

func NewTMapDefault

func NewTMapDefault() TMap

type TMapElem

type TMapElem interface {
	Key() interface{}
	Value() interface{}
}

func NewTMapElem

func NewTMapElem(k, v interface{}) TMapElem

type TMemoryBuffer

type TMemoryBuffer struct {
	// contains filtered or unexported fields
}

*

  • Memory buffer-based implementation of the TTransport interface. *

func NewTMemoryBuffer

func NewTMemoryBuffer() *TMemoryBuffer

func NewTMemoryBufferLen

func NewTMemoryBufferLen(size int) *TMemoryBuffer

func (*TMemoryBuffer) Bytes

func (p *TMemoryBuffer) Bytes() []byte

func (*TMemoryBuffer) Close

func (p *TMemoryBuffer) Close() os.Error

func (*TMemoryBuffer) Flush

func (p *TMemoryBuffer) Flush() os.Error

func (*TMemoryBuffer) IsOpen

func (p *TMemoryBuffer) IsOpen() bool

func (*TMemoryBuffer) Len

func (p *TMemoryBuffer) Len() int

func (*TMemoryBuffer) Open

func (p *TMemoryBuffer) Open() os.Error

func (*TMemoryBuffer) Peek

func (p *TMemoryBuffer) Peek() bool

func (*TMemoryBuffer) Read

func (p *TMemoryBuffer) Read(buf []byte) (int, os.Error)

func (*TMemoryBuffer) ReadAll

func (p *TMemoryBuffer) ReadAll(buf []byte) (int, os.Error)

func (*TMemoryBuffer) ReadByte

func (p *TMemoryBuffer) ReadByte() (byte, os.Error)

func (*TMemoryBuffer) ReadFrom

func (p *TMemoryBuffer) ReadFrom(r io.Reader) (int64, os.Error)

func (*TMemoryBuffer) Reset

func (p *TMemoryBuffer) Reset()

func (*TMemoryBuffer) String

func (p *TMemoryBuffer) String() string

func (*TMemoryBuffer) Write

func (p *TMemoryBuffer) Write(buf []byte) (int, os.Error)

func (*TMemoryBuffer) WriteString

func (p *TMemoryBuffer) WriteString(buf string) (int, os.Error)

func (*TMemoryBuffer) WriteTo

func (p *TMemoryBuffer) WriteTo(w io.Writer) (int64, os.Error)

type TMemoryBufferTransportFactory

type TMemoryBufferTransportFactory struct {
	// contains filtered or unexported fields
}

func NewTMemoryBufferTransportFactory

func NewTMemoryBufferTransportFactory(size int) *TMemoryBufferTransportFactory

func (*TMemoryBufferTransportFactory) GetTransport

func (p *TMemoryBufferTransportFactory) GetTransport(trans TTransport) TTransport

type TMessage

type TMessage interface {
	Name() string
	TypeId() TMessageType
	SeqId() int
	Equals(other TMessage) bool
}

*

  • Helper class that encapsulates struct metadata. *
var EMPTY_MESSAGE TMessage

func NewTMessage

func NewTMessage(n string, t TMessageType, s int) TMessage

func NewTMessageDefault

func NewTMessageDefault() TMessage

type TMessageType

type TMessageType int32

*

  • Message type constants in the Thrift protocol. *
const (
	INVALID_TMESSAGE_TYPE TMessageType = 0
	CALL                  TMessageType = 1
	REPLY                 TMessageType = 2
	EXCEPTION             TMessageType = 3
	ONEWAY                TMessageType = 4
)

type TNonblockingServer

type TNonblockingServer struct {
	// contains filtered or unexported fields
}

*

  • A nonblocking TServer implementation. This allows for fairness amongst all
  • connected clients in terms of invocations. *
  • This server is inherently single-threaded. If you want a limited thread pool
  • coupled with invocation-fairness, see THsHaServer. *
  • To use this server, you MUST use a TFramedTransport at the outermost
  • transport, otherwise this server will be unable to determine when a whole
  • method call has been read off the wire. Clients must also use TFramedTransport.

func NewTNonblockingServer2

func NewTNonblockingServer2(processor TProcessor, serverTransport TServerTransport) *TNonblockingServer

func NewTNonblockingServer4

func NewTNonblockingServer4(processor TProcessor, serverTransport TServerTransport, transportFactory TTransportFactory, protocolFactory TProtocolFactory) *TNonblockingServer

func NewTNonblockingServer6

func NewTNonblockingServer6(processor TProcessor, serverTransport TServerTransport, inputTransportFactory TTransportFactory, outputTransportFactory TTransportFactory, inputProtocolFactory TProtocolFactory, outputProtocolFactory TProtocolFactory) *TNonblockingServer

func NewTNonblockingServerFactory2

func NewTNonblockingServerFactory2(processorFactory TProcessorFactory, serverTransport TServerTransport) *TNonblockingServer

func NewTNonblockingServerFactory4

func NewTNonblockingServerFactory4(processorFactory TProcessorFactory, serverTransport TServerTransport, transportFactory TTransportFactory, protocolFactory TProtocolFactory) *TNonblockingServer

func NewTNonblockingServerFactory6

func NewTNonblockingServerFactory6(processorFactory TProcessorFactory, serverTransport TServerTransport, inputTransportFactory TTransportFactory, outputTransportFactory TTransportFactory, inputProtocolFactory TProtocolFactory, outputProtocolFactory TProtocolFactory) *TNonblockingServer

func (*TNonblockingServer) InputProtocolFactory

func (p *TNonblockingServer) InputProtocolFactory() TProtocolFactory

func (*TNonblockingServer) InputTransportFactory

func (p *TNonblockingServer) InputTransportFactory() TTransportFactory

func (*TNonblockingServer) IsStopped

func (p *TNonblockingServer) IsStopped() bool

func (*TNonblockingServer) OutputProtocolFactory

func (p *TNonblockingServer) OutputProtocolFactory() TProtocolFactory

func (*TNonblockingServer) OutputTransportFactory

func (p *TNonblockingServer) OutputTransportFactory() TTransportFactory

func (*TNonblockingServer) ProcessorFactory

func (p *TNonblockingServer) ProcessorFactory() TProcessorFactory

func (*TNonblockingServer) Serve

func (p *TNonblockingServer) Serve() os.Error

func (*TNonblockingServer) ServerTransport

func (p *TNonblockingServer) ServerTransport() TServerTransport

func (*TNonblockingServer) Stop

func (p *TNonblockingServer) Stop() os.Error

type TNonblockingServerSocket

type TNonblockingServerSocket struct {
	// contains filtered or unexported fields
}

*

  • Socket implementation of the TTransport interface. To be commented soon!

func (*TNonblockingServerSocket) Accept

func (*TNonblockingServerSocket) Addr

func (p *TNonblockingServerSocket) Addr() net.Addr

func (*TNonblockingServerSocket) Close

func (p *TNonblockingServerSocket) Close() (err os.Error)

*

  • Closes the socket.

func (*TNonblockingServerSocket) Flush

func (p *TNonblockingServerSocket) Flush() os.Error

*

  • Flushes the underlying output stream if not null.

func (*TNonblockingServerSocket) Interrupt

func (p *TNonblockingServerSocket) Interrupt() os.Error

func (*TNonblockingServerSocket) IsOpen

func (p *TNonblockingServerSocket) IsOpen() bool

*

  • Checks whether the socket is connected.

func (*TNonblockingServerSocket) Listen

func (p *TNonblockingServerSocket) Listen() os.Error

func (*TNonblockingServerSocket) Open

func (p *TNonblockingServerSocket) Open() os.Error

*

  • Connects the socket, creating a new socket object if necessary.

func (*TNonblockingServerSocket) Peek

func (p *TNonblockingServerSocket) Peek() bool

func (*TNonblockingServerSocket) Read

func (p *TNonblockingServerSocket) Read(buf []byte) (int, os.Error)

*

  • Perform a nonblocking read into buffer.

func (*TNonblockingServerSocket) ReadAll

func (p *TNonblockingServerSocket) ReadAll(buf []byte) (int, os.Error)

func (*TNonblockingServerSocket) SetTimeout

func (p *TNonblockingServerSocket) SetTimeout(nsecTimeout int64) os.Error

*

  • Sets the socket timeout *
  • @param timeout Nanoseconds timeout

func (*TNonblockingServerSocket) Write

func (p *TNonblockingServerSocket) Write(buf []byte) (int, os.Error)

*

  • Perform a nonblocking write of the data in buffer;

type TNonblockingServerSocketTransportFactory

type TNonblockingServerSocketTransportFactory struct {
	// contains filtered or unexported fields
}

func NewTNonblockingServerSocketTransportFactory

func NewTNonblockingServerSocketTransportFactory(addr net.Addr) *TNonblockingServerSocketTransportFactory

func (*TNonblockingServerSocketTransportFactory) GetTransport

type TNonblockingSocket

type TNonblockingSocket struct {
	// contains filtered or unexported fields
}

*

  • Socket implementation of the TTransport interface. To be commented soon!

func (*TNonblockingSocket) Addr

func (p *TNonblockingSocket) Addr() net.Addr

func (*TNonblockingSocket) Close

func (p *TNonblockingSocket) Close() os.Error

*

  • Closes the socket.

func (*TNonblockingSocket) Flush

func (p *TNonblockingSocket) Flush() os.Error

*

  • Flushes the underlying output stream if not null.

func (*TNonblockingSocket) Interrupt

func (p *TNonblockingSocket) Interrupt() os.Error

func (*TNonblockingSocket) IsOpen

func (p *TNonblockingSocket) IsOpen() bool

*

  • Checks whether the socket is connected.

func (*TNonblockingSocket) Open

func (p *TNonblockingSocket) Open() os.Error

*

  • Connects the socket, creating a new socket object if necessary.

func (*TNonblockingSocket) Peek

func (p *TNonblockingSocket) Peek() bool

func (*TNonblockingSocket) Read

func (p *TNonblockingSocket) Read(buf []byte) (int, os.Error)

*

  • Perform a nonblocking read into buffer.

func (*TNonblockingSocket) ReadAll

func (p *TNonblockingSocket) ReadAll(buf []byte) (int, os.Error)

func (*TNonblockingSocket) SetTimeout

func (p *TNonblockingSocket) SetTimeout(nsecTimeout int64) os.Error

*

  • Sets the socket timeout *
  • @param nsecTimeout Nanoseconds timeout

func (*TNonblockingSocket) Write

func (p *TNonblockingSocket) Write(buf []byte) (int, os.Error)

*

  • Perform a nonblocking write of the data in buffer;

type TNonblockingSocketTransportFactory

type TNonblockingSocketTransportFactory struct {
	// contains filtered or unexported fields
}

func NewTNonblockingSocketTransportFactory

func NewTNonblockingSocketTransportFactory(addr net.Addr) *TNonblockingSocketTransportFactory

func (*TNonblockingSocketTransportFactory) GetTransport

type TNonblockingTransport

type TNonblockingTransport interface {
	TTransport
}

type TProcessor

type TProcessor interface {
	Process(in, out TProtocol) (bool, TException)
}

*

  • A processor is a generic object which operates upon an input stream and
  • writes to some output stream. *

type TProcessorFactory

type TProcessorFactory interface {
	GetProcessor(trans TTransport) TProcessor
}

*

  • The default processor factory just returns a singleton
  • instance.

func NewTProcessorFactory

func NewTProcessorFactory(p TProcessor) TProcessorFactory

type TProcessorFunction

type TProcessorFunction interface {
	Process(seqId int32, in, out TProtocol) (bool, TException)
}

type TProcessorFunctionFactory

type TProcessorFunctionFactory interface {
	GetProcessorFunction(trans TTransport) TProcessorFunction
}

*

  • The default processor factory just returns a singleton
  • instance.

type TProtocol

type TProtocol interface {
	WriteMessageBegin(name string, typeId TMessageType, seqid int32) TProtocolException
	WriteMessageEnd() TProtocolException
	WriteStructBegin(name string) TProtocolException
	WriteStructEnd() TProtocolException
	WriteFieldBegin(name string, typeId TType, id int16) TProtocolException
	WriteFieldEnd() TProtocolException
	WriteFieldStop() TProtocolException
	WriteMapBegin(keyType TType, valueType TType, size int) TProtocolException
	WriteMapEnd() TProtocolException
	WriteListBegin(elemType TType, size int) TProtocolException
	WriteListEnd() TProtocolException
	WriteSetBegin(elemType TType, size int) TProtocolException
	WriteSetEnd() TProtocolException
	WriteBool(value bool) TProtocolException
	WriteByte(value byte) TProtocolException
	WriteI16(value int16) TProtocolException
	WriteI32(value int32) TProtocolException
	WriteI64(value int64) TProtocolException
	WriteDouble(value float64) TProtocolException
	WriteString(value string) TProtocolException
	WriteBinary(value []byte) TProtocolException

	ReadMessageBegin() (name string, typeId TMessageType, seqid int32, err TProtocolException)
	ReadMessageEnd() TProtocolException
	ReadStructBegin() (name string, err TProtocolException)
	ReadStructEnd() TProtocolException
	ReadFieldBegin() (name string, typeId TType, id int16, err TProtocolException)
	ReadFieldEnd() TProtocolException
	ReadMapBegin() (keyType TType, valueType TType, size int, err TProtocolException)
	ReadMapEnd() TProtocolException
	ReadListBegin() (elemType TType, size int, err TProtocolException)
	ReadListEnd() TProtocolException
	ReadSetBegin() (elemType TType, size int, err TProtocolException)
	ReadSetEnd() TProtocolException
	ReadBool() (value bool, err TProtocolException)
	ReadByte() (value byte, err TProtocolException)
	ReadI16() (value int16, err TProtocolException)
	ReadI32() (value int32, err TProtocolException)
	ReadI64() (value int64, err TProtocolException)
	ReadDouble() (value float64, err TProtocolException)
	ReadString() (value string, err TProtocolException)
	ReadBinary() (value []byte, err TProtocolException)

	Skip(fieldType TType) (err TProtocolException)
	Flush() (err TProtocolException)

	Transport() TTransport
}

type TProtocolException

type TProtocolException interface {
	TException
	TypeId() int
}

*

  • Protocol exceptions. *

func NewTProtocolException

func NewTProtocolException(t int, m string) TProtocolException

func NewTProtocolExceptionDefault

func NewTProtocolExceptionDefault() TProtocolException

func NewTProtocolExceptionDefaultString

func NewTProtocolExceptionDefaultString(m string) TProtocolException

func NewTProtocolExceptionDefaultType

func NewTProtocolExceptionDefaultType(t int) TProtocolException

func NewTProtocolExceptionFromOsError

func NewTProtocolExceptionFromOsError(e os.Error) TProtocolException

func NewTProtocolExceptionFromTransportException

func NewTProtocolExceptionFromTransportException(e TTransportException) TProtocolException

func NewTProtocolExceptionReadField

func NewTProtocolExceptionReadField(fieldId int, fieldName string, structName string, e TProtocolException) TProtocolException

func NewTProtocolExceptionReadStruct

func NewTProtocolExceptionReadStruct(structName string, e TProtocolException) TProtocolException

func NewTProtocolExceptionWriteField

func NewTProtocolExceptionWriteField(fieldId int, fieldName string, structName string, e TProtocolException) TProtocolException

func NewTProtocolExceptionWriteStruct

func NewTProtocolExceptionWriteStruct(structName string, e TProtocolException) TProtocolException

func Skip

func Skip(self TProtocol, fieldType TType, maxDepth int) (err TProtocolException)

*

  • Skips over the next data element from the provided input TProtocol object. *
  • @param prot the protocol object to read from
  • @param type the next value will be intepreted as this TType value.
  • @param maxDepth this function will only skip complex objects to this
  • recursive depth, to prevent Java stack overflow.

func SkipDefaultDepth

func SkipDefaultDepth(prot TProtocol, typeId TType) (err TProtocolException)

*

  • Skips over the next data element from the provided input TProtocol object. *
  • @param prot the protocol object to read from
  • @param type the next value will be intepreted as this TType value.

type TProtocolFactory

type TProtocolFactory interface {
	GetProtocol(trans TTransport) TProtocol
}

*

  • Factory interface for constructing protocol instances. *

type TServer

type TServer interface {
	/**
	 * Core processor
	 */
	ProcessorFactory() TProcessorFactory
	/**
	 * Server transport
	 */
	ServerTransport() TServerTransport
	/**
	 * Input Transport Factory
	 */
	InputTransportFactory() TTransportFactory
	/**
	 * Output Transport Factory
	 */
	OutputTransportFactory() TTransportFactory
	/**
	 * Input Protocol Factory
	 */
	InputProtocolFactory() TProtocolFactory
	/**
	 * Output Protocol Factory
	 */
	OutputProtocolFactory() TProtocolFactory

	/**
	 * The run method fires up the server and gets things going.
	 */
	Serve() os.Error
	/**
	 * Stop the server. This is optional on a per-implementation basis. Not
	 * all servers are required to be cleanly stoppable.
	 */
	Stop() os.Error
}

type TServerSocket

type TServerSocket struct {
	// contains filtered or unexported fields
}

func NewTServerSocketConn

func NewTServerSocketConn(conn net.Conn) *TServerSocket

func NewTServerSocketConnTimeout

func NewTServerSocketConnTimeout(conn net.Conn, nsecClientTimeout int64) *TServerSocket

func (*TServerSocket) Accept

func (p *TServerSocket) Accept() (TTransport, os.Error)

func (*TServerSocket) Addr

func (p *TServerSocket) Addr() net.Addr

func (*TServerSocket) Close

func (p *TServerSocket) Close() (err os.Error)

*

  • Closes the socket.

func (*TServerSocket) Flush

func (p *TServerSocket) Flush() os.Error

*

  • Flushes the underlying output stream if not null.

func (*TServerSocket) Interrupt

func (p *TServerSocket) Interrupt() os.Error

func (*TServerSocket) IsOpen

func (p *TServerSocket) IsOpen() bool

*

  • Checks whether the socket is connected.

func (*TServerSocket) Listen

func (p *TServerSocket) Listen() (err os.Error)

func (*TServerSocket) Open

func (p *TServerSocket) Open() os.Error

*

  • Connects the socket, creating a new socket object if necessary.

func (*TServerSocket) Peek

func (p *TServerSocket) Peek() bool

func (*TServerSocket) Read

func (p *TServerSocket) Read(buf []byte) (int, os.Error)

*

  • Perform a nonblocking read into buffer.

func (*TServerSocket) ReadAll

func (p *TServerSocket) ReadAll(buf []byte) (int, os.Error)

func (*TServerSocket) Write

func (p *TServerSocket) Write(buf []byte) (int, os.Error)

*

  • Perform a nonblocking write of the data in buffer;

type TServerSocketTransportFactory

type TServerSocketTransportFactory struct {
	// contains filtered or unexported fields
}

func NewTServerSocketTransportFactory

func NewTServerSocketTransportFactory(addr net.Addr, nsecClientTimeout int64) *TServerSocketTransportFactory

func (*TServerSocketTransportFactory) GetTransport

func (p *TServerSocketTransportFactory) GetTransport(trans TTransport) TTransport

type TServerTransport

type TServerTransport interface {
	Listen() os.Error
	Accept() (TTransport, os.Error)
	Close() os.Error

	/**
	 * Optional method implementation. This signals to the server transport
	 * that it should break out of any accept() or listen() that it is currently
	 * blocked on. This method, if implemented, MUST be thread safe, as it may
	 * be called from a different thread context than the other TServerTransport
	 * methods.
	 */
	Interrupt() os.Error
}

*

  • Server transport. Object which provides client transports. *

type TSet

type TSet interface {
	TContainer
	ElemType() TType
	Add(data interface{})
	Remove(data interface{})
	Less(other interface{}) bool
	Front() *list.Element
	Back() *list.Element
	Values() []interface{}
}

*

  • Helper class that encapsulates set metadata. *

func NewTSet

func NewTSet(t TType, s int) TSet

func NewTSetDefault

func NewTSetDefault() TSet

type TSimpleJSONProtocol

type TSimpleJSONProtocol struct {
	// contains filtered or unexported fields
}

*

  • JSON protocol implementation for thrift. *
  • This protocol produces/consumes a simple output format
  • suitable for parsing by scripting languages. It should not be
  • confused with the full-featured TJSONProtocol. *

func NewTSimpleJSONProtocol

func NewTSimpleJSONProtocol(t TTransport) *TSimpleJSONProtocol

*

  • Constructor

func (*TSimpleJSONProtocol) Flush

func (p *TSimpleJSONProtocol) Flush() (err TProtocolException)

func (*TSimpleJSONProtocol) OutputBool

func (p *TSimpleJSONProtocol) OutputBool(value bool) TProtocolException

func (*TSimpleJSONProtocol) OutputElemListBegin

func (p *TSimpleJSONProtocol) OutputElemListBegin(elemType TType, size int) TProtocolException

func (*TSimpleJSONProtocol) OutputF64

func (p *TSimpleJSONProtocol) OutputF64(value float64) TProtocolException

func (*TSimpleJSONProtocol) OutputI64

func (p *TSimpleJSONProtocol) OutputI64(value int64) TProtocolException

func (*TSimpleJSONProtocol) OutputListBegin

func (p *TSimpleJSONProtocol) OutputListBegin() TProtocolException

func (*TSimpleJSONProtocol) OutputListEnd

func (p *TSimpleJSONProtocol) OutputListEnd() TProtocolException

func (*TSimpleJSONProtocol) OutputNull

func (p *TSimpleJSONProtocol) OutputNull() TProtocolException

func (*TSimpleJSONProtocol) OutputObjectBegin

func (p *TSimpleJSONProtocol) OutputObjectBegin() TProtocolException

func (*TSimpleJSONProtocol) OutputObjectEnd

func (p *TSimpleJSONProtocol) OutputObjectEnd() TProtocolException

func (*TSimpleJSONProtocol) OutputPostValue

func (p *TSimpleJSONProtocol) OutputPostValue() TProtocolException

func (*TSimpleJSONProtocol) OutputPreValue

func (p *TSimpleJSONProtocol) OutputPreValue() TProtocolException

func (*TSimpleJSONProtocol) OutputString

func (p *TSimpleJSONProtocol) OutputString(s string) TProtocolException

func (*TSimpleJSONProtocol) OutputStringData

func (p *TSimpleJSONProtocol) OutputStringData(s string) TProtocolException

func (*TSimpleJSONProtocol) ParseBase64EncodedBody

func (p *TSimpleJSONProtocol) ParseBase64EncodedBody() ([]byte, TProtocolException)

func (*TSimpleJSONProtocol) ParseElemListBegin

func (p *TSimpleJSONProtocol) ParseElemListBegin() (elemType TType, size int, e TProtocolException)

func (*TSimpleJSONProtocol) ParseF64

func (*TSimpleJSONProtocol) ParseI64

func (*TSimpleJSONProtocol) ParseListBegin

func (p *TSimpleJSONProtocol) ParseListBegin() (bool, TProtocolException)

func (*TSimpleJSONProtocol) ParseListEnd

func (p *TSimpleJSONProtocol) ParseListEnd() TProtocolException

func (*TSimpleJSONProtocol) ParseObjectEnd

func (p *TSimpleJSONProtocol) ParseObjectEnd() TProtocolException

func (*TSimpleJSONProtocol) ParseObjectStart

func (p *TSimpleJSONProtocol) ParseObjectStart() (bool, TProtocolException)

func (*TSimpleJSONProtocol) ParsePostValue

func (p *TSimpleJSONProtocol) ParsePostValue() TProtocolException

func (*TSimpleJSONProtocol) ParsePreValue

func (p *TSimpleJSONProtocol) ParsePreValue() TProtocolException

func (*TSimpleJSONProtocol) ParseQuotedStringBody

func (p *TSimpleJSONProtocol) ParseQuotedStringBody() (string, TProtocolException)

func (*TSimpleJSONProtocol) ParseStringBody

func (p *TSimpleJSONProtocol) ParseStringBody() (string, TProtocolException)

func (*TSimpleJSONProtocol) ReadBinary

func (p *TSimpleJSONProtocol) ReadBinary() ([]byte, TProtocolException)

func (*TSimpleJSONProtocol) ReadBool

func (p *TSimpleJSONProtocol) ReadBool() (bool, TProtocolException)

func (*TSimpleJSONProtocol) ReadByte

func (p *TSimpleJSONProtocol) ReadByte() (byte, TProtocolException)

func (*TSimpleJSONProtocol) ReadDouble

func (p *TSimpleJSONProtocol) ReadDouble() (float64, TProtocolException)

func (*TSimpleJSONProtocol) ReadFieldBegin

func (p *TSimpleJSONProtocol) ReadFieldBegin() (string, TType, int16, TProtocolException)

func (*TSimpleJSONProtocol) ReadFieldEnd

func (p *TSimpleJSONProtocol) ReadFieldEnd() TProtocolException

func (*TSimpleJSONProtocol) ReadI16

func (*TSimpleJSONProtocol) ReadI32

func (*TSimpleJSONProtocol) ReadI64

func (*TSimpleJSONProtocol) ReadListBegin

func (p *TSimpleJSONProtocol) ReadListBegin() (elemType TType, size int, e TProtocolException)

func (*TSimpleJSONProtocol) ReadListEnd

func (p *TSimpleJSONProtocol) ReadListEnd() TProtocolException

func (*TSimpleJSONProtocol) ReadMapBegin

func (p *TSimpleJSONProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, e TProtocolException)

func (*TSimpleJSONProtocol) ReadMapEnd

func (p *TSimpleJSONProtocol) ReadMapEnd() TProtocolException

func (*TSimpleJSONProtocol) ReadMessageBegin

func (p *TSimpleJSONProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err TProtocolException)

func (*TSimpleJSONProtocol) ReadMessageEnd

func (p *TSimpleJSONProtocol) ReadMessageEnd() TProtocolException

func (*TSimpleJSONProtocol) ReadSetBegin

func (p *TSimpleJSONProtocol) ReadSetBegin() (elemType TType, size int, e TProtocolException)

func (*TSimpleJSONProtocol) ReadSetEnd

func (p *TSimpleJSONProtocol) ReadSetEnd() TProtocolException

func (*TSimpleJSONProtocol) ReadString

func (p *TSimpleJSONProtocol) ReadString() (string, TProtocolException)

func (*TSimpleJSONProtocol) ReadStructBegin

func (p *TSimpleJSONProtocol) ReadStructBegin() (name string, err TProtocolException)

func (*TSimpleJSONProtocol) ReadStructEnd

func (p *TSimpleJSONProtocol) ReadStructEnd() TProtocolException

func (*TSimpleJSONProtocol) Skip

func (p *TSimpleJSONProtocol) Skip(fieldType TType) (err TProtocolException)

func (*TSimpleJSONProtocol) Transport

func (p *TSimpleJSONProtocol) Transport() TTransport

func (*TSimpleJSONProtocol) WriteBinary

func (p *TSimpleJSONProtocol) WriteBinary(v []byte) TProtocolException

func (*TSimpleJSONProtocol) WriteBool

func (*TSimpleJSONProtocol) WriteByte

func (*TSimpleJSONProtocol) WriteDouble

func (*TSimpleJSONProtocol) WriteFieldBegin

func (p *TSimpleJSONProtocol) WriteFieldBegin(name string, typeId TType, id int16) TProtocolException

func (*TSimpleJSONProtocol) WriteFieldEnd

func (p *TSimpleJSONProtocol) WriteFieldEnd() TProtocolException

func (*TSimpleJSONProtocol) WriteFieldStop

func (p *TSimpleJSONProtocol) WriteFieldStop() TProtocolException

func (*TSimpleJSONProtocol) WriteI16

func (*TSimpleJSONProtocol) WriteI32

func (*TSimpleJSONProtocol) WriteI64

func (*TSimpleJSONProtocol) WriteListBegin

func (p *TSimpleJSONProtocol) WriteListBegin(elemType TType, size int) TProtocolException

func (*TSimpleJSONProtocol) WriteListEnd

func (p *TSimpleJSONProtocol) WriteListEnd() TProtocolException

func (*TSimpleJSONProtocol) WriteMapBegin

func (p *TSimpleJSONProtocol) WriteMapBegin(keyType TType, valueType TType, size int) TProtocolException

func (*TSimpleJSONProtocol) WriteMapEnd

func (p *TSimpleJSONProtocol) WriteMapEnd() TProtocolException

func (*TSimpleJSONProtocol) WriteMessageBegin

func (p *TSimpleJSONProtocol) WriteMessageBegin(name string, typeId TMessageType, seqId int32) TProtocolException

func (*TSimpleJSONProtocol) WriteMessageEnd

func (p *TSimpleJSONProtocol) WriteMessageEnd() TProtocolException

func (*TSimpleJSONProtocol) WriteSetBegin

func (p *TSimpleJSONProtocol) WriteSetBegin(elemType TType, size int) TProtocolException

func (*TSimpleJSONProtocol) WriteSetEnd

func (p *TSimpleJSONProtocol) WriteSetEnd() TProtocolException

func (*TSimpleJSONProtocol) WriteString

func (p *TSimpleJSONProtocol) WriteString(v string) TProtocolException

func (*TSimpleJSONProtocol) WriteStructBegin

func (p *TSimpleJSONProtocol) WriteStructBegin(name string) TProtocolException

func (*TSimpleJSONProtocol) WriteStructEnd

func (p *TSimpleJSONProtocol) WriteStructEnd() TProtocolException

type TSimpleJSONProtocolFactory

type TSimpleJSONProtocolFactory struct{}

*

  • Factory

func NewTSimpleJSONProtocolFactory

func NewTSimpleJSONProtocolFactory() *TSimpleJSONProtocolFactory

func (*TSimpleJSONProtocolFactory) GetProtocol

func (p *TSimpleJSONProtocolFactory) GetProtocol(trans TTransport) TProtocol

type TSimpleServer

type TSimpleServer struct {
	// contains filtered or unexported fields
}

*

  • Simple singlethreaded server for testing. *

func NewTSimpleServer2

func NewTSimpleServer2(processor TProcessor, serverTransport TServerTransport) *TSimpleServer

func NewTSimpleServer4

func NewTSimpleServer4(processor TProcessor, serverTransport TServerTransport, transportFactory TTransportFactory, protocolFactory TProtocolFactory) *TSimpleServer

func NewTSimpleServer6

func NewTSimpleServer6(processor TProcessor, serverTransport TServerTransport, inputTransportFactory TTransportFactory, outputTransportFactory TTransportFactory, inputProtocolFactory TProtocolFactory, outputProtocolFactory TProtocolFactory) *TSimpleServer

func NewTSimpleServerFactory2

func NewTSimpleServerFactory2(processorFactory TProcessorFactory, serverTransport TServerTransport) *TSimpleServer

func NewTSimpleServerFactory4

func NewTSimpleServerFactory4(processorFactory TProcessorFactory, serverTransport TServerTransport, transportFactory TTransportFactory, protocolFactory TProtocolFactory) *TSimpleServer

func NewTSimpleServerFactory6

func NewTSimpleServerFactory6(processorFactory TProcessorFactory, serverTransport TServerTransport, inputTransportFactory TTransportFactory, outputTransportFactory TTransportFactory, inputProtocolFactory TProtocolFactory, outputProtocolFactory TProtocolFactory) *TSimpleServer

func (*TSimpleServer) InputProtocolFactory

func (p *TSimpleServer) InputProtocolFactory() TProtocolFactory

func (*TSimpleServer) InputTransportFactory

func (p *TSimpleServer) InputTransportFactory() TTransportFactory

func (*TSimpleServer) OutputProtocolFactory

func (p *TSimpleServer) OutputProtocolFactory() TProtocolFactory

func (*TSimpleServer) OutputTransportFactory

func (p *TSimpleServer) OutputTransportFactory() TTransportFactory

func (*TSimpleServer) ProcessorFactory

func (p *TSimpleServer) ProcessorFactory() TProcessorFactory

func (*TSimpleServer) Serve

func (p *TSimpleServer) Serve() os.Error

func (*TSimpleServer) ServerTransport

func (p *TSimpleServer) ServerTransport() TServerTransport

func (*TSimpleServer) Stop

func (p *TSimpleServer) Stop() os.Error

type TSocket

type TSocket struct {
	// contains filtered or unexported fields
}

*

  • Socket implementation of the TTransport interface. To be commented soon! *

func NewTSocket

func NewTSocket(address net.Addr, nsecTimeout int64) *TSocket

*

  • Creates a new unconnected socket that will connect to the given host
  • on the given port. *
  • @param host Remote host
  • @param port Remote port
  • @param nsecTimeout Socket timeout

func NewTSocketAddr

func NewTSocketAddr(address net.Addr) *TSocket

*

  • Creates a new unconnected socket that will connect to the given host
  • on the given port. *
  • @param host Remote host
  • @param port Remote port

func (*TSocket) Close

func (p *TSocket) Close() os.Error

*

  • Closes the socket.

func (*TSocket) Conn

func (p *TSocket) Conn() net.Conn

*

  • Returns a reference to the underlying socket.

func (*TSocket) Flush

func (p *TSocket) Flush() os.Error

func (*TSocket) Interrupt

func (p *TSocket) Interrupt() os.Error

func (*TSocket) IsOpen

func (p *TSocket) IsOpen() bool

*

  • Checks whether the socket is connected.

func (*TSocket) Open

func (p *TSocket) Open() os.Error

*

  • Connects the socket, creating a new socket object if necessary.

func (*TSocket) Peek

func (p *TSocket) Peek() bool

func (*TSocket) Read

func (p *TSocket) Read(buf []byte) (int, os.Error)

func (*TSocket) ReadAll

func (p *TSocket) ReadAll(buf []byte) (int, os.Error)

func (*TSocket) SetTimeout

func (p *TSocket) SetTimeout(nsecTimeout int64) os.Error

*

  • Sets the socket timeout *
  • @param timeout Nanoseconds timeout

func (*TSocket) Write

func (p *TSocket) Write(buf []byte) (int, os.Error)

type TStruct

type TStruct interface {
	TFieldContainer
	TStructName() string
	ThriftName() string
	TStructFields() TFieldContainer
	String() string
	AttributeFromFieldId(fieldId int) interface{}
	AttributeFromFieldName(fieldName string) interface{}
}

*

  • Helper class that encapsulates struct metadata. *
var ANONYMOUS_STRUCT TStruct

func NewTStruct

func NewTStruct(name string, fields []TField) TStruct

func NewTStructEmpty

func NewTStructEmpty(name string) TStruct

type TTransport

type TTransport interface {
	/**
	 * Queries whether the transport is open.
	 *
	 * @return True if the transport is open.
	 */
	IsOpen() bool

	/**
	 * Opens the transport for reading/writing.
	 *
	 * @returns TTransportException if the transport could not be opened
	 */
	Open() (err os.Error)

	/**
	 * Closes the transport.
	 */
	Close() (err os.Error)

	/**
	 * Reads up to len bytes into buffer buf, starting att offset off.
	 *
	 * @param buf Array to read into
	 * @param off Index to start reading at
	 * @param len Maximum number of bytes to read
	 * @return The number of bytes actually read
	 * @return TTransportException if there was an error reading data
	 */
	Read(buf []byte) (n int, err os.Error)

	/**
	 * Guarantees that all of len bytes are actually read off the transport.
	 *
	 * @param buf Array to read into
	 * @param off Index to start reading at
	 * @param len Maximum number of bytes to read
	 * @return The number of bytes actually read, which must be equal to len
	 * @return TTransportException if there was an error reading data
	 */
	ReadAll(buf []byte) (n int, err os.Error)

	/**
	 * Writes the buffer to the output
	 *
	 * @param buf The output data buffer
	 * @return Number of bytes written
	 * @return TTransportException if an error occurs writing data
	 */
	Write(buf []byte) (n int, err os.Error)

	/**
	 * Flush any pending data out of a transport buffer.
	 *
	 * @return TTransportException if there was an error writing out data.
	 */
	Flush() (err os.Error)

	/**
	 * Is there more data to be read?
	 *
	 * @return True if the remote side is still alive and feeding us
	 */
	Peek() bool
}

*

  • Generic class that encapsulates the I/O layer. This is basically a thin
  • wrapper around the combined functionality of Java input/output streams. *

func NewTHttpClient

func NewTHttpClient(urlstr string) (TTransport, os.Error)

func NewTHttpPostClient

func NewTHttpPostClient(urlstr string) (TTransport, os.Error)

type TTransportException

type TTransportException interface {
	TException
	TypeId() int
}

*

  • Transport exceptions. *

func NewTTransportException

func NewTTransportException(t int, m string) TTransportException

func NewTTransportExceptionDefault

func NewTTransportExceptionDefault() TTransportException

func NewTTransportExceptionDefaultString

func NewTTransportExceptionDefaultString(m string) TTransportException

func NewTTransportExceptionDefaultType

func NewTTransportExceptionDefaultType(t int) TTransportException

func NewTTransportExceptionFromOsError

func NewTTransportExceptionFromOsError(e os.Error) TTransportException

type TTransportFactory

type TTransportFactory interface {
	GetTransport(trans TTransport) TTransport
}

*

  • Factory class used to create wrapped instance of Transports.
  • This is used primarily in servers, which get Transports from
  • a ServerTransport and then may want to mutate them (i.e. create
  • a BufferedTransport from the underlying base transport) *

func NewTFramedTransportFactory

func NewTFramedTransportFactory(factory TTransportFactory) TTransportFactory

func NewTTransportFactory

func NewTTransportFactory() TTransportFactory

type TType

type TType byte

*

  • Type constants in the Thrift protocol.

func TypeFromValue

func TypeFromValue(data interface{}) TType

func (TType) Coerce

func (p TType) Coerce(other interface{}) TType

func (TType) CoerceData

func (p TType) CoerceData(data interface{}) (interface{}, bool)

func (TType) Compare

func (p TType) Compare(i, j interface{}) (int, bool)

func (TType) CompareValueArrays

func (p TType) CompareValueArrays(li, lj []interface{}) (int, bool)

func (TType) Equals

func (p TType) Equals(other interface{}) bool

func (TType) IsBaseType

func (p TType) IsBaseType() bool

func (TType) IsContainer

func (p TType) IsContainer() bool

func (TType) IsEmptyType

func (p TType) IsEmptyType() bool

func (TType) IsEnum

func (p TType) IsEnum() bool

func (TType) IsInt

func (p TType) IsInt() bool

func (TType) IsList

func (p TType) IsList() bool

func (TType) IsMap

func (p TType) IsMap() bool

func (TType) IsNumericType

func (p TType) IsNumericType() bool

func (TType) IsSet

func (p TType) IsSet() bool

func (TType) IsStringType

func (p TType) IsStringType() bool

func (TType) IsStruct

func (p TType) IsStruct() bool

func (TType) Less

func (p TType) Less(i, j interface{}) bool

func (TType) LessType

func (p TType) LessType(other interface{}) bool

func (TType) String

func (p TType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL