Documentation ¶
Index ¶
- Constants
- Variables
- type Calculator
- type CalculatorAddArgs
- func (p *CalculatorAddArgs) GetNum1() int32
- func (p *CalculatorAddArgs) GetNum2() int32
- func (p *CalculatorAddArgs) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorAddArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorAddArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorAddArgs) String() string
- func (p *CalculatorAddArgs) Write(ctx context.Context, oprot thrift.TProtocol) error
- type CalculatorAddResult
- func (p *CalculatorAddResult) GetSuccess() int32
- func (p *CalculatorAddResult) IsSetSuccess() bool
- func (p *CalculatorAddResult) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorAddResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorAddResult) String() string
- func (p *CalculatorAddResult) Write(ctx context.Context, oprot thrift.TProtocol) error
- type CalculatorCalculateArgs
- func (p *CalculatorCalculateArgs) GetLogid() int32
- func (p *CalculatorCalculateArgs) GetW() *Work
- func (p *CalculatorCalculateArgs) IsSetW() bool
- func (p *CalculatorCalculateArgs) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorCalculateArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorCalculateArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorCalculateArgs) String() string
- func (p *CalculatorCalculateArgs) Write(ctx context.Context, oprot thrift.TProtocol) error
- type CalculatorCalculateResult
- func (p *CalculatorCalculateResult) GetOuch() *InvalidOperation
- func (p *CalculatorCalculateResult) GetSuccess() int32
- func (p *CalculatorCalculateResult) IsSetOuch() bool
- func (p *CalculatorCalculateResult) IsSetSuccess() bool
- func (p *CalculatorCalculateResult) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorCalculateResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorCalculateResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *CalculatorCalculateResult) String() string
- func (p *CalculatorCalculateResult) Write(ctx context.Context, oprot thrift.TProtocol) error
- type CalculatorClient
- func (p *CalculatorClient) Add(ctx context.Context, num1 int32, num2 int32) (_r int32, _err error)
- func (p *CalculatorClient) Calculate(ctx context.Context, logid int32, w *Work) (_r int32, _err error)
- func (p *CalculatorClient) Ping(ctx context.Context) (_err error)
- func (p *CalculatorClient) Zip(ctx context.Context) (_err error)
- type CalculatorPingArgs
- type CalculatorPingResult
- type CalculatorProcessor
- type CalculatorZipArgs
- type InvalidOperation
- func (p *InvalidOperation) Equals(other *InvalidOperation) bool
- func (p *InvalidOperation) Error() string
- func (p *InvalidOperation) GetWhatOp() int32
- func (p *InvalidOperation) GetWhy() string
- func (p *InvalidOperation) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *InvalidOperation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *InvalidOperation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *InvalidOperation) String() string
- func (InvalidOperation) TExceptionType() thrift.TExceptionType
- func (p *InvalidOperation) Validate() error
- func (p *InvalidOperation) Write(ctx context.Context, oprot thrift.TProtocol) error
- type MyInteger
- type Operation
- type Work
- func (p *Work) Equals(other *Work) bool
- 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(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Work) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Work) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Work) ReadField3(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Work) ReadField4(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Work) String() string
- func (p *Work) Validate() error
- func (p *Work) Write(ctx context.Context, oprot thrift.TProtocol) error
Constants ¶
const INT32CONSTANT = 9853
Variables ¶
var CalculatorAddResult_Success_DEFAULT int32
var CalculatorCalculateResult_Success_DEFAULT int32
var GoUnusedProtection__ int
var MAPCONSTANT map[string]string
var Work_Comment_DEFAULT string
Functions ¶
This section is empty.
Types ¶
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(ctx context.Context) (_err error) // Parameters: // - Num1 // - Num2 Add(ctx context.Context, num1 int32, num2 int32) (_r int32, _err error) // Parameters: // - Logid // - W Calculate(ctx context.Context, 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(ctx context.Context) (_err error) }
type CalculatorAddArgs ¶
type CalculatorAddArgs struct { Num1 int32 `thrift:"num1,1" db:"num1" json:"num1"` Num2 int32 `thrift:"num2,2" db:"num2" json:"num2"` }
Attributes:
- Num1
- Num2
func NewCalculatorAddArgs ¶
func NewCalculatorAddArgs() *CalculatorAddArgs
func (*CalculatorAddArgs) GetNum1 ¶
func (p *CalculatorAddArgs) GetNum1() int32
func (*CalculatorAddArgs) GetNum2 ¶
func (p *CalculatorAddArgs) GetNum2() int32
func (*CalculatorAddArgs) ReadField1 ¶
func (*CalculatorAddArgs) ReadField2 ¶
func (*CalculatorAddArgs) String ¶
func (p *CalculatorAddArgs) String() string
type CalculatorAddResult ¶
type CalculatorAddResult struct {
Success *int32 `thrift:"success,0" db:"success" json:"success,omitempty"`
}
Attributes:
- Success
func NewCalculatorAddResult ¶
func NewCalculatorAddResult() *CalculatorAddResult
func (*CalculatorAddResult) GetSuccess ¶
func (p *CalculatorAddResult) GetSuccess() int32
func (*CalculatorAddResult) IsSetSuccess ¶
func (p *CalculatorAddResult) IsSetSuccess() bool
func (*CalculatorAddResult) ReadField0 ¶
func (*CalculatorAddResult) String ¶
func (p *CalculatorAddResult) String() string
type CalculatorCalculateArgs ¶
type CalculatorCalculateArgs struct { Logid int32 `thrift:"logid,1" db:"logid" json:"logid"` W *Work `thrift:"w,2" db:"w" json:"w"` }
Attributes:
- Logid
- W
func NewCalculatorCalculateArgs ¶
func NewCalculatorCalculateArgs() *CalculatorCalculateArgs
func (*CalculatorCalculateArgs) GetLogid ¶
func (p *CalculatorCalculateArgs) GetLogid() int32
func (*CalculatorCalculateArgs) GetW ¶
func (p *CalculatorCalculateArgs) GetW() *Work
func (*CalculatorCalculateArgs) IsSetW ¶
func (p *CalculatorCalculateArgs) IsSetW() bool
func (*CalculatorCalculateArgs) ReadField1 ¶
func (*CalculatorCalculateArgs) ReadField2 ¶
func (*CalculatorCalculateArgs) String ¶
func (p *CalculatorCalculateArgs) String() string
type CalculatorCalculateResult ¶
type CalculatorCalculateResult struct { Success *int32 `thrift:"success,0" db:"success" json:"success,omitempty"` Ouch *InvalidOperation `thrift:"ouch,1" db:"ouch" json:"ouch,omitempty"` }
Attributes:
- Success
- Ouch
func NewCalculatorCalculateResult ¶
func NewCalculatorCalculateResult() *CalculatorCalculateResult
func (*CalculatorCalculateResult) GetOuch ¶
func (p *CalculatorCalculateResult) GetOuch() *InvalidOperation
func (*CalculatorCalculateResult) GetSuccess ¶
func (p *CalculatorCalculateResult) GetSuccess() int32
func (*CalculatorCalculateResult) IsSetOuch ¶
func (p *CalculatorCalculateResult) IsSetOuch() bool
func (*CalculatorCalculateResult) IsSetSuccess ¶
func (p *CalculatorCalculateResult) IsSetSuccess() bool
func (*CalculatorCalculateResult) ReadField0 ¶
func (*CalculatorCalculateResult) ReadField1 ¶
func (*CalculatorCalculateResult) String ¶
func (p *CalculatorCalculateResult) String() string
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 NewCalculatorClient ¶
func NewCalculatorClient(c thrift.TClient) *CalculatorClient
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) Calculate ¶
func (p *CalculatorClient) Calculate(ctx context.Context, logid int32, w *Work) (_r int32, _err error)
Parameters:
- Logid
- W
func (*CalculatorClient) Ping ¶
func (p *CalculatorClient) Ping(ctx context.Context) (_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.
type CalculatorPingArgs ¶
type CalculatorPingArgs struct { }
func NewCalculatorPingArgs ¶
func NewCalculatorPingArgs() *CalculatorPingArgs
func (*CalculatorPingArgs) String ¶
func (p *CalculatorPingArgs) String() string
type CalculatorPingResult ¶
type CalculatorPingResult struct { }
func NewCalculatorPingResult ¶
func NewCalculatorPingResult() *CalculatorPingResult
func (*CalculatorPingResult) String ¶
func (p *CalculatorPingResult) String() string
type CalculatorProcessor ¶
type CalculatorProcessor struct {
}func NewCalculatorProcessor ¶
func NewCalculatorProcessor(handler Calculator) *CalculatorProcessor
type CalculatorZipArgs ¶
type CalculatorZipArgs struct { }
func NewCalculatorZipArgs ¶
func NewCalculatorZipArgs() *CalculatorZipArgs
func (*CalculatorZipArgs) String ¶
func (p *CalculatorZipArgs) String() string
type InvalidOperation ¶
type InvalidOperation struct { WhatOp int32 `thrift:"whatOp,1" db:"whatOp" json:"whatOp"` Why string `thrift:"why,2" db:"why" json:"why"` }
Structs can also be exceptions, if they are nasty.
Attributes:
- WhatOp
- Why
var CalculatorCalculateResult_Ouch_DEFAULT *InvalidOperation
func NewInvalidOperation ¶
func NewInvalidOperation() *InvalidOperation
func (*InvalidOperation) Equals ¶
func (p *InvalidOperation) Equals(other *InvalidOperation) bool
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 (*InvalidOperation) ReadField2 ¶
func (*InvalidOperation) String ¶
func (p *InvalidOperation) String() string
func (InvalidOperation) TExceptionType ¶
func (InvalidOperation) TExceptionType() thrift.TExceptionType
func (*InvalidOperation) Validate ¶
func (p *InvalidOperation) Validate() error
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 ¶
func (Operation) MarshalText ¶
func (*Operation) UnmarshalText ¶
type Work ¶
type Work struct { Num1 int32 `thrift:"num1,1" db:"num1" json:"num1"` Num2 int32 `thrift:"num2,2" db:"num2" json:"num2"` Op Operation `thrift:"op,3" db:"op" json:"op"` Comment *string `thrift:"comment,4" db:"comment" json:"comment,omitempty"` }
Structs are the basic complex data structures. They are comprised of fields which each have an integer identifier, a type, a symbolic name, and an optional default value.
Fields can be declared "optional", which ensures they will not be included in the serialized output if they aren't set. Note that this requires some manual management in some languages.
Attributes:
- Num1
- Num2
- Op
- Comment
var CalculatorCalculateArgs_W_DEFAULT *Work