Documentation ¶
Overview ¶
Package thrift thrift parser and codec
Index ¶
- Variables
- func Parse(tree *parser.Thrift) (*descriptor.ServiceDescriptor, error)
- type Base
- func (p *Base) GetAddr() string
- func (p *Base) GetCaller() string
- func (p *Base) GetClient() string
- func (p *Base) GetExtra() map[string]string
- func (p *Base) GetLogID() string
- func (p *Base) GetTrafficEnv() *TrafficEnv
- func (p *Base) IsSetExtra() bool
- func (p *Base) IsSetTrafficEnv() bool
- func (p *Base) Read(iprot thrift.TProtocol) (err error)
- func (p *Base) ReadField1(iprot thrift.TProtocol) error
- func (p *Base) ReadField2(iprot thrift.TProtocol) error
- func (p *Base) ReadField3(iprot thrift.TProtocol) error
- func (p *Base) ReadField4(iprot thrift.TProtocol) error
- func (p *Base) ReadField5(iprot thrift.TProtocol) error
- func (p *Base) ReadField6(iprot thrift.TProtocol) error
- func (p *Base) SetAddr(val string)
- func (p *Base) SetCaller(val string)
- func (p *Base) SetClient(val string)
- func (p *Base) SetExtra(val map[string]string)
- func (p *Base) SetLogID(val string)
- func (p *Base) SetTrafficEnv(val *TrafficEnv)
- func (p *Base) String() string
- func (p *Base) Write(oprot thrift.TProtocol) (err error)
- type BaseResp
- func (p *BaseResp) GetExtra() map[string]string
- func (p *BaseResp) GetStatusCode() int32
- func (p *BaseResp) GetStatusMessage() string
- func (p *BaseResp) IsSetExtra() bool
- func (p *BaseResp) Read(iprot thrift.TProtocol) (err error)
- func (p *BaseResp) ReadField1(iprot thrift.TProtocol) error
- func (p *BaseResp) ReadField2(iprot thrift.TProtocol) error
- func (p *BaseResp) ReadField3(iprot thrift.TProtocol) error
- func (p *BaseResp) SetExtra(val map[string]string)
- func (p *BaseResp) SetStatusCode(val int32)
- func (p *BaseResp) SetStatusMessage(val string)
- func (p *BaseResp) String() string
- func (p *BaseResp) Write(oprot thrift.TProtocol) (err error)
- type MessageReader
- type MessageWriter
- type ReadHTTPResponse
- type ReadStruct
- type TrafficEnv
- func (p *TrafficEnv) GetEnv() string
- func (p *TrafficEnv) GetOpen() bool
- func (p *TrafficEnv) Read(iprot thrift.TProtocol) (err error)
- func (p *TrafficEnv) ReadField1(iprot thrift.TProtocol) error
- func (p *TrafficEnv) ReadField2(iprot thrift.TProtocol) error
- func (p *TrafficEnv) SetEnv(val string)
- func (p *TrafficEnv) SetOpen(val bool)
- func (p *TrafficEnv) String() string
- func (p *TrafficEnv) Write(oprot thrift.TProtocol) (err error)
- type WriteHTTPRequest
- type WriteStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var BaseResp_Extra_DEFAULT map[string]string
View Source
var Base_Extra_DEFAULT map[string]string
Functions ¶
func Parse ¶
func Parse(tree *parser.Thrift) (*descriptor.ServiceDescriptor, error)
Parse descriptor from parser.Thrift
Types ¶
type Base ¶
type Base struct { LogID string `thrift:"LogID,1" json:"LogID"` Caller string `thrift:"Caller,2" json:"Caller"` Addr string `thrift:"Addr,3" json:"Addr"` Client string `thrift:"Client,4" json:"Client"` TrafficEnv *TrafficEnv `thrift:"TrafficEnv,5" json:"TrafficEnv,omitempty"` Extra map[string]string `thrift:"Extra,6" json:"Extra,omitempty"` }
func (*Base) GetTrafficEnv ¶
func (p *Base) GetTrafficEnv() *TrafficEnv
func (*Base) IsSetExtra ¶
func (*Base) IsSetTrafficEnv ¶
func (*Base) SetTrafficEnv ¶
func (p *Base) SetTrafficEnv(val *TrafficEnv)
type BaseResp ¶
type BaseResp struct { StatusMessage string `thrift:"StatusMessage,1" json:"StatusMessage"` StatusCode int32 `thrift:"StatusCode,2" json:"StatusCode"` Extra map[string]string `thrift:"Extra,3" json:"Extra,omitempty"` }
func NewBaseResp ¶
func NewBaseResp() *BaseResp
func (*BaseResp) GetStatusCode ¶
func (*BaseResp) GetStatusMessage ¶
func (*BaseResp) IsSetExtra ¶
func (*BaseResp) SetStatusCode ¶
func (*BaseResp) SetStatusMessage ¶
type MessageReader ¶
type MessageReader interface {
Read(ctx context.Context, method string, in thrift.TProtocol) (interface{}, error)
}
MessageReader read from thrift.TProtocol with method
type MessageWriter ¶
type MessageWriter interface {
Write(ctx context.Context, out thrift.TProtocol, msg interface{}, requestBase *Base) error
}
MessageWriter write to thrift.TProtocol
type ReadHTTPResponse ¶
type ReadHTTPResponse struct {
// contains filtered or unexported fields
}
ReadHTTPResponse implement of MessageReaderWithMethod
func NewReadHTTPResponse ¶
func NewReadHTTPResponse(svc *descriptor.ServiceDescriptor) *ReadHTTPResponse
NewReadHTTPResponse ...
type ReadStruct ¶
type ReadStruct struct {
// contains filtered or unexported fields
}
ReadStruct implement of MessageReaderWithMethod
func NewReadStruct ¶
func NewReadStruct(svc *descriptor.ServiceDescriptor, isClient bool) *ReadStruct
NewReadStruct ...
type TrafficEnv ¶
type TrafficEnv struct { Open bool `thrift:"Open,1" json:"Open"` Env string `thrift:"Env,2" json:"Env"` }
var Base_TrafficEnv_DEFAULT *TrafficEnv
func NewTrafficEnv ¶
func NewTrafficEnv() *TrafficEnv
func (*TrafficEnv) GetEnv ¶
func (p *TrafficEnv) GetEnv() string
func (*TrafficEnv) GetOpen ¶
func (p *TrafficEnv) GetOpen() bool
func (*TrafficEnv) ReadField1 ¶
func (p *TrafficEnv) ReadField1(iprot thrift.TProtocol) error
func (*TrafficEnv) ReadField2 ¶
func (p *TrafficEnv) ReadField2(iprot thrift.TProtocol) error
func (*TrafficEnv) SetEnv ¶
func (p *TrafficEnv) SetEnv(val string)
func (*TrafficEnv) SetOpen ¶
func (p *TrafficEnv) SetOpen(val bool)
func (*TrafficEnv) String ¶
func (p *TrafficEnv) String() string
type WriteHTTPRequest ¶
type WriteHTTPRequest struct {
// contains filtered or unexported fields
}
WriteHTTPRequest implement of MessageWriter
func NewWriteHTTPRequest ¶
func NewWriteHTTPRequest(svc *descriptor.ServiceDescriptor) *WriteHTTPRequest
NewWriteHTTPRequest ...
type WriteStruct ¶
type WriteStruct struct {
// contains filtered or unexported fields
}
WriteStruct implement of MessageWriter
func NewWriteStruct ¶
func NewWriteStruct(svc *descriptor.ServiceDescriptor, method string, isClient bool) (*WriteStruct, error)
NewWriteStruct ...
Click to show internal directories.
Click to hide internal directories.