Documentation ¶
Index ¶
- Constants
- Variables
- type AddArgs
- func (p *AddArgs) GetNum1() int32
- func (p *AddArgs) GetNum2() int32
- func (p *AddArgs) Read(iprot thrift.TProtocol) error
- func (p *AddArgs) ReadField1(iprot thrift.TProtocol) error
- func (p *AddArgs) ReadField2(iprot thrift.TProtocol) error
- func (p *AddArgs) String() string
- func (p *AddArgs) Write(oprot thrift.TProtocol) error
- type AddResult
- type CalculateArgs
- func (p *CalculateArgs) GetLogid() int32
- func (p *CalculateArgs) GetW() *Work
- func (p *CalculateArgs) IsSetW() bool
- func (p *CalculateArgs) Read(iprot thrift.TProtocol) error
- func (p *CalculateArgs) ReadField1(iprot thrift.TProtocol) error
- func (p *CalculateArgs) ReadField2(iprot thrift.TProtocol) error
- func (p *CalculateArgs) String() string
- func (p *CalculateArgs) Write(oprot thrift.TProtocol) error
- type CalculateResult
- func (p *CalculateResult) GetOuch() *InvalidOperation
- func (p *CalculateResult) GetSuccess() int32
- func (p *CalculateResult) IsSetOuch() bool
- func (p *CalculateResult) IsSetSuccess() bool
- func (p *CalculateResult) Read(iprot thrift.TProtocol) error
- func (p *CalculateResult) ReadField0(iprot thrift.TProtocol) error
- func (p *CalculateResult) ReadField1(iprot thrift.TProtocol) error
- func (p *CalculateResult) String() string
- func (p *CalculateResult) Write(oprot thrift.TProtocol) error
- type Calculator
- type CalculatorClient
- type CalculatorProcessor
- type InvalidOperation
- func (p *InvalidOperation) Error() string
- func (p *InvalidOperation) GetWhatOp() int32
- func (p *InvalidOperation) GetWhy() string
- func (p *InvalidOperation) Read(iprot thrift.TProtocol) error
- func (p *InvalidOperation) ReadField1(iprot thrift.TProtocol) error
- func (p *InvalidOperation) ReadField2(iprot thrift.TProtocol) error
- func (p *InvalidOperation) String() string
- func (p *InvalidOperation) Write(oprot thrift.TProtocol) error
- type MyInteger
- type Operation
- type PingArgs
- type PingResult
- type Work
- func (p *Work) GetComment() string
- func (p *Work) GetNum1() int32
- func (p *Work) GetNum2() int32
- func (p *Work) GetOp() Operation
- func (p *Work) IsSetComment() bool
- func (p *Work) Read(iprot thrift.TProtocol) error
- func (p *Work) ReadField1(iprot thrift.TProtocol) error
- func (p *Work) ReadField2(iprot thrift.TProtocol) error
- func (p *Work) ReadField3(iprot thrift.TProtocol) error
- func (p *Work) ReadField4(iprot thrift.TProtocol) error
- func (p *Work) String() string
- func (p *Work) Write(oprot thrift.TProtocol) error
- type ZipArgs
Constants ¶
const INT32CONSTANT = 9853
Variables ¶
var AddResult_Success_DEFAULT int32
var CalculateResult_Success_DEFAULT int32
var GoUnusedProtection__ int
var MAPCONSTANT map[string]string
var Work_Comment_DEFAULT string
Functions ¶
This section is empty.
Types ¶
type AddArgs ¶
type AddArgs struct { Num1 int32 `thrift:"num1,1" json:"num1"` Num2 int32 `thrift:"num2,2" json:"num2"` }
func NewAddArgs ¶
func NewAddArgs() *AddArgs
type AddResult ¶
type AddResult struct {
Success *int32 `thrift:"success,0" json:"success"`
}
func NewAddResult ¶
func NewAddResult() *AddResult
func (*AddResult) GetSuccess ¶
func (*AddResult) IsSetSuccess ¶
type CalculateArgs ¶
type CalculateArgs struct { Logid int32 `thrift:"logid,1" json:"logid"` W *Work `thrift:"w,2" json:"w"` }
func NewCalculateArgs ¶
func NewCalculateArgs() *CalculateArgs
func (*CalculateArgs) GetLogid ¶
func (p *CalculateArgs) GetLogid() int32
func (*CalculateArgs) GetW ¶
func (p *CalculateArgs) GetW() *Work
func (*CalculateArgs) IsSetW ¶
func (p *CalculateArgs) IsSetW() bool
func (*CalculateArgs) ReadField1 ¶
func (p *CalculateArgs) ReadField1(iprot thrift.TProtocol) error
func (*CalculateArgs) ReadField2 ¶
func (p *CalculateArgs) ReadField2(iprot thrift.TProtocol) error
func (*CalculateArgs) String ¶
func (p *CalculateArgs) String() string
type CalculateResult ¶
type CalculateResult struct { Success *int32 `thrift:"success,0" json:"success"` Ouch *InvalidOperation `thrift:"ouch,1" json:"ouch"` }
func NewCalculateResult ¶
func NewCalculateResult() *CalculateResult
func (*CalculateResult) GetOuch ¶
func (p *CalculateResult) GetOuch() *InvalidOperation
func (*CalculateResult) GetSuccess ¶
func (p *CalculateResult) GetSuccess() int32
func (*CalculateResult) IsSetOuch ¶
func (p *CalculateResult) IsSetOuch() bool
func (*CalculateResult) IsSetSuccess ¶
func (p *CalculateResult) IsSetSuccess() bool
func (*CalculateResult) ReadField0 ¶
func (p *CalculateResult) ReadField0(iprot thrift.TProtocol) error
func (*CalculateResult) ReadField1 ¶
func (p *CalculateResult) ReadField1(iprot thrift.TProtocol) error
func (*CalculateResult) String ¶
func (p *CalculateResult) String() string
type Calculator ¶
type Calculator interface { shared.SharedService // A method definition looks like C code. It has a return type, arguments, // and optionally a list of exceptions that it may throw. Note that argument // lists and exception lists are specified using the exact same syntax as // field lists in struct or exception definitions. Ping() (err error) // Parameters: // - Num1 // - Num2 Add(num1 int32, num2 int32) (r int32, err error) // Parameters: // - Logid // - W Calculate(logid int32, w *Work) (r int32, err error) // This method has a oneway modifier. That means the client only makes // a request and does not listen for any response at all. Oneway methods // must be void. Zip() (err error) }
type CalculatorClient ¶
type CalculatorClient struct {
}Ahh, now onto the cool part, defining a service. Services just need a name and can optionally inherit from another service using the extends keyword.
func NewCalculatorClientFactory ¶
func NewCalculatorClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CalculatorClient
func NewCalculatorClientProtocol ¶
func NewCalculatorClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CalculatorClient
func (*CalculatorClient) Add ¶
func (p *CalculatorClient) Add(num1 int32, num2 int32) (r int32, err error)
Parameters:
- Num1
- Num2
func (*CalculatorClient) Calculate ¶
func (p *CalculatorClient) Calculate(logid int32, w *Work) (r int32, err error)
Parameters:
- Logid
- W
func (*CalculatorClient) Ping ¶
func (p *CalculatorClient) Ping() (err error)
A method definition looks like C code. It has a return type, arguments, and optionally a list of exceptions that it may throw. Note that argument lists and exception lists are specified using the exact same syntax as field lists in struct or exception definitions.
func (*CalculatorClient) Zip ¶
func (p *CalculatorClient) Zip() (err error)
This method has a oneway modifier. That means the client only makes a request and does not listen for any response at all. Oneway methods must be void.
type CalculatorProcessor ¶
type CalculatorProcessor struct {
}func NewCalculatorProcessor ¶
func NewCalculatorProcessor(handler Calculator) *CalculatorProcessor
type InvalidOperation ¶
type InvalidOperation struct { WhatOp int32 `thrift:"whatOp,1" json:"whatOp"` Why string `thrift:"why,2" json:"why"` }
var CalculateResult_Ouch_DEFAULT *InvalidOperation
func NewInvalidOperation ¶
func NewInvalidOperation() *InvalidOperation
func (*InvalidOperation) Error ¶
func (p *InvalidOperation) Error() string
func (*InvalidOperation) GetWhatOp ¶
func (p *InvalidOperation) GetWhatOp() int32
func (*InvalidOperation) GetWhy ¶
func (p *InvalidOperation) GetWhy() string
func (*InvalidOperation) ReadField1 ¶
func (p *InvalidOperation) ReadField1(iprot thrift.TProtocol) error
func (*InvalidOperation) ReadField2 ¶
func (p *InvalidOperation) ReadField2(iprot thrift.TProtocol) error
func (*InvalidOperation) String ¶
func (p *InvalidOperation) String() string
type MyInteger ¶
type MyInteger int32
Thrift lets you do typedefs to get pretty names for your types. Standard C style here.
func MyIntegerPtr ¶
type Operation ¶
type Operation int64
You can define enums, which are just 32 bit integers. Values are optional and start at 1 if not supplied, C style again.
func OperationFromString ¶
func OperationPtr ¶
type PingResult ¶
type PingResult struct { }
func NewPingResult ¶
func NewPingResult() *PingResult
func (*PingResult) String ¶
func (p *PingResult) String() string