Пример #1
0
 * Attributes:
 *  - Num1
 *  - Num2
 *  - Op
 *  - Comment
 */
type Work struct {
	Num1    int32     "num1"    // 1
	Num2    int32     "num2"    // 2
	Op      Operation "op"      // 3
	Comment string    "comment" // 4
}

var tstructWork = thrift.NewTStruct("Work", []thrift.TField{
	thrift.NewTField("num1", thrift.I32, 1),
	thrift.NewTField("num2", thrift.I32, 2),
	thrift.NewTField("op", thrift.I32, 3),
	thrift.NewTField("comment", thrift.STRING, 4),
})

func (*Work) GetTStruct() thrift.TStruct { return tstructWork }
func NewWork() *Work {
	output := &Work{}
	{
		output.Num1 = 0
		output.Op = math.MinInt32 - 1
	}
	return output
}

func (p *Work) IsSetOp() bool {
	return int64(p.Op) != math.MinInt32-1
Пример #2
0
 * Attributes:
 *  - First
 *  - Second
 *  - Third
 *  - Fourth
 */
type MyMethodArgs struct {
	Fourth int64  "fourth" // 1
	Third  int32  "third"  // 2
	Second int16  "second" // 3
	First  string "first"  // 4
}

var tstructMyMethodArgs = thrift.NewTStruct("myMethod_args", []thrift.TField{
	thrift.NewTField("first", thrift.STRING, 4),
	thrift.NewTField("second", thrift.I16, 3),
	thrift.NewTField("third", thrift.I32, 2),
	thrift.NewTField("fourth", thrift.I64, 1),
})

func (*MyMethodArgs) GetTStruct() thrift.TStruct { return tstructMyMethodArgs }
func NewMyMethodArgs() *MyMethodArgs {
	output := &MyMethodArgs{}
	{
	}
	return output
}

func (p *MyMethodArgs) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
Пример #3
0
// happen to use the math import due to not having emited enums.
//
// Future clean-ups will deprecate the need for this.
var _ = fmt.Print
var _ = math.MinInt32

/**
 * Attributes:
 *  - Timestamp
 */
type Ping struct {
	Timestamp int32 "timestamp" // 1
}

var tstructPing = thrift.NewTStruct("Ping", []thrift.TField{
	thrift.NewTField("timestamp", thrift.I32, 1),
})

func (*Ping) GetTStruct() thrift.TStruct { return tstructPing }
func NewPing() *Ping {
	output := &Ping{}
	{
		output.Timestamp = 0
	}
	return output
}

func (p *Ping) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
Пример #4
0
// happen to use the math import due to not having emited enums.
//
// Future clean-ups will deprecate the need for this.
var _ = fmt.Print
var _ = math.MinInt32

/**
 * Attributes:
 *  - Ifield
 */
type Intstruct struct {
	Ifield int32 "ifield" // 1
}

var tstructIntstruct = thrift.NewTStruct("intstruct", []thrift.TField{
	thrift.NewTField("ifield", thrift.I32, 1),
})

func (*Intstruct) GetTStruct() thrift.TStruct { return tstructIntstruct }
func NewIntstruct() *Intstruct {
	output := &Intstruct{}
	{
	}
	return output
}

func (p *Intstruct) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
Пример #5
0
// happen to use the math import due to not having emited enums.
//
// Future clean-ups will deprecate the need for this.
var _ = fmt.Print
var _ = math.MinInt32

/**
 * Attributes:
 *  - Ifield
 */
type Intstruct struct {
	Ifield int32 "ifield" // 1
}

var tstructIntstruct = thrift.NewTStruct("intstruct", []thrift.TField{
	thrift.NewTField("ifield", thrift.I32, 1),
})

func (*Intstruct) GetTStruct() thrift.TStruct { return tstructIntstruct }
func NewIntstruct() *Intstruct {
	output := &Intstruct{}
	{
	}
	return output
}

func (p *Intstruct) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
Пример #6
0
	}
	if err2 := oprot.Transport().Flush(); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

// HELPER FUNCTIONS AND STRUCTURES

type PingArgs struct {
}

var tstructPingArgs = thrift.NewTStruct("ping_args", []thrift.TField{})

func (*PingArgs) GetTStruct() thrift.TStruct { return tstructPingArgs }
func NewPingArgs() *PingArgs {
	output := &PingArgs{}
	{
	}
	return output
}

func (p *PingArgs) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	for {
Пример #7
0
	}
	return true, err
}

// HELPER FUNCTIONS AND STRUCTURES

/**
 * Attributes:
 *  - Ts
 */
type PingArgs struct {
	Ts *Ping "ts" // 1
}

var tstructPingArgs = thrift.NewTStruct("ping_args", []thrift.TField{
	thrift.NewTField("ts", thrift.STRUCT, 1),
})

func (*PingArgs) GetTStruct() thrift.TStruct { return tstructPingArgs }
func NewPingArgs() *PingArgs {
	output := &PingArgs{}
	{
	}
	return output
}

func (p *PingArgs) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
Пример #8
0
	}
	if err2 := oprot.Transport().Flush(); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

// HELPER FUNCTIONS AND STRUCTURES

type MethodThatThrowsAnExceptionArgs struct {
}

var tstructMethodThatThrowsAnExceptionArgs = thrift.NewTStruct("methodThatThrowsAnException_args", []thrift.TField{})

func (*MethodThatThrowsAnExceptionArgs) GetTStruct() thrift.TStruct {
	return tstructMethodThatThrowsAnExceptionArgs
}
func NewMethodThatThrowsAnExceptionArgs() *MethodThatThrowsAnExceptionArgs {
	output := &MethodThatThrowsAnExceptionArgs{}
	{
	}
	return output
}

func (p *MethodThatThrowsAnExceptionArgs) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)