Ejemplo n.º 1
0
func (p *Work) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]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),
	})
}
Ejemplo n.º 2
0
func (p *MyMethodArgs) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]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),
	})
}
Ejemplo n.º 3
0
func (p *Manylists) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("bytelist", thrift.LIST, 1),
		thrift.NewTField("i16list", thrift.LIST, 2),
		thrift.NewTField("i32list", thrift.LIST, 3),
		thrift.NewTField("stringlist", thrift.LIST, 4),
		thrift.NewTField("structlist", thrift.LIST, 5),
		thrift.NewTField("listoflist", thrift.LIST, 6),
		thrift.NewTField("optionalint", thrift.I32, 7),
	})
}
Ejemplo n.º 4
0
func (p *Manymaps) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("bytemap", thrift.MAP, 1),
		thrift.NewTField("i16map", thrift.MAP, 2),
		thrift.NewTField("i32map", thrift.MAP, 3),
		thrift.NewTField("stringmap", thrift.MAP, 4),
		thrift.NewTField("binarymap", thrift.MAP, 5),
		thrift.NewTField("binarstructymap", thrift.MAP, 6),
	})
}
Ejemplo n.º 5
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()
Ejemplo n.º 6
0
func (p *Intstruct) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("ifield", thrift.I32, 1),
	})
}
Ejemplo n.º 7
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)
	}
Ejemplo n.º 8
0
func (p *MethodThatThrowsAnExceptionResult) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("xwamap", thrift.STRUCT, 1),
	})
}
Ejemplo n.º 9
0
func (p *Ping) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("timestamp", thrift.I32, 1),
	})
}
Ejemplo n.º 10
0
func (p *CalculateResult) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("success", thrift.I32, 0),
		thrift.NewTField("ouch", thrift.STRUCT, 1),
	})
}
Ejemplo n.º 11
0
func (p *CalculateArgs) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("logid", thrift.I32, 1),
		thrift.NewTField("w", thrift.STRUCT, 2),
	})
}
Ejemplo n.º 12
0
func (p *AddResult) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("success", thrift.I32, 0),
	})
}
Ejemplo n.º 13
0
func (p *PingResult) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{})
}

/**
 * Attributes:
 *  - Num1
 *  - Num2
 */
type AddArgs struct {
	Num1 int32 "num1" // 1
	Num2 int32 "num2" // 2
}

var tstructAddArgs = thrift.NewTStruct("add_args", []thrift.TField{
	thrift.NewTField("num1", thrift.I32, 1),
	thrift.NewTField("num2", thrift.I32, 2),
})

func (*AddArgs) GetTStruct() thrift.TStruct { return tstructAddArgs }
func NewAddArgs() *AddArgs {
	output := &AddArgs{}
	{
	}
	return output
}

func (p *AddArgs) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
Ejemplo n.º 14
0
func (p *PingArgs) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("ts", thrift.STRUCT, 1),
	})
}
Ejemplo n.º 15
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)
	}
Ejemplo n.º 16
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)
Ejemplo n.º 17
0
func (p *AddArgs) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("num1", thrift.I32, 1),
		thrift.NewTField("num2", thrift.I32, 2),
	})
}
Ejemplo n.º 18
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
}
Ejemplo n.º 19
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)
	}
Ejemplo n.º 20
0
func (p *InvalidOperation) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{
		thrift.NewTField("what", thrift.I32, 1),
		thrift.NewTField("why", thrift.STRING, 2),
	})
}
Ejemplo n.º 21
0
}

func (p *MethodThatThrowsAnExceptionArgs) TStructFields() thrift.TFieldContainer {
	return thrift.NewTFieldContainer([]thrift.TField{})
}

/**
 * Attributes:
 *  - Xwamap
 */
type MethodThatThrowsAnExceptionResult struct {
	Xwamap *ExceptionWithAMap "xwamap" // 1
}

var tstructMethodThatThrowsAnExceptionResult = thrift.NewTStruct("methodThatThrowsAnException_result", []thrift.TField{
	thrift.NewTField("xwamap", thrift.STRUCT, 1),
})

func (*MethodThatThrowsAnExceptionResult) GetTStruct() thrift.TStruct {
	return tstructMethodThatThrowsAnExceptionResult
}
func NewMethodThatThrowsAnExceptionResult() *MethodThatThrowsAnExceptionResult {
	output := &MethodThatThrowsAnExceptionResult{}
	{
	}
	return output
}

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