Documentation ¶
Index ¶
- Constants
- Variables
- type Argument
- func (v *Argument) Decode(sr stream.Reader) error
- func (v *Argument) Encode(sw stream.Writer) error
- func (v *Argument) Equals(rhs *Argument) bool
- func (v *Argument) FromWire(w wire.Value) error
- func (v *Argument) GetAnnotations() (o map[string]string)
- func (v *Argument) GetName() (o string)
- func (v *Argument) GetType() (o *Type)
- func (v *Argument) IsSetAnnotations() bool
- func (v *Argument) IsSetType() bool
- func (v *Argument) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Argument) String() string
- func (v *Argument) ToWire() (wire.Value, error)
- type Feature
- func (v *Feature) Decode(sr stream.Reader) error
- func (v Feature) Encode(sw stream.Writer) error
- func (v Feature) Equals(rhs Feature) bool
- func (v *Feature) FromWire(w wire.Value) error
- func (v Feature) MarshalJSON() ([]byte, error)
- func (v Feature) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (v Feature) MarshalText() ([]byte, error)
- func (v Feature) Ptr() *Feature
- func (v Feature) String() string
- func (v Feature) ToWire() (wire.Value, error)
- func (v *Feature) UnmarshalJSON(text []byte) error
- func (v *Feature) UnmarshalText(value []byte) error
- type Function
- func (v *Function) Decode(sr stream.Reader) error
- func (v *Function) Encode(sw stream.Writer) error
- func (v *Function) Equals(rhs *Function) bool
- func (v *Function) FromWire(w wire.Value) error
- func (v *Function) GetAnnotations() (o map[string]string)
- func (v *Function) GetArguments() (o []*Argument)
- func (v *Function) GetExceptions() (o []*Argument)
- func (v *Function) GetName() (o string)
- func (v *Function) GetOneWay() (o bool)
- func (v *Function) GetReturnType() (o *Type)
- func (v *Function) GetThriftName() (o string)
- func (v *Function) IsSetAnnotations() bool
- func (v *Function) IsSetArguments() bool
- func (v *Function) IsSetExceptions() bool
- func (v *Function) IsSetOneWay() bool
- func (v *Function) IsSetReturnType() bool
- func (v *Function) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Function) String() string
- func (v *Function) ToWire() (wire.Value, error)
- type GenerateServiceRequest
- func (v *GenerateServiceRequest) Decode(sr stream.Reader) error
- func (v *GenerateServiceRequest) Encode(sw stream.Writer) error
- func (v *GenerateServiceRequest) Equals(rhs *GenerateServiceRequest) bool
- func (v *GenerateServiceRequest) FromWire(w wire.Value) error
- func (v *GenerateServiceRequest) GetModules() (o map[ModuleID]*Module)
- func (v *GenerateServiceRequest) GetPackagePrefix() (o string)
- func (v *GenerateServiceRequest) GetRootModules() (o []ModuleID)
- func (v *GenerateServiceRequest) GetRootServices() (o []ServiceID)
- func (v *GenerateServiceRequest) GetServices() (o map[ServiceID]*Service)
- func (v *GenerateServiceRequest) GetThriftRoot() (o string)
- func (v *GenerateServiceRequest) IsSetModules() bool
- func (v *GenerateServiceRequest) IsSetRootModules() bool
- func (v *GenerateServiceRequest) IsSetRootServices() bool
- func (v *GenerateServiceRequest) IsSetServices() bool
- func (v *GenerateServiceRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *GenerateServiceRequest) String() string
- func (v *GenerateServiceRequest) ToWire() (wire.Value, error)
- type GenerateServiceResponse
- func (v *GenerateServiceResponse) Decode(sr stream.Reader) error
- func (v *GenerateServiceResponse) Encode(sw stream.Writer) error
- func (v *GenerateServiceResponse) Equals(rhs *GenerateServiceResponse) bool
- func (v *GenerateServiceResponse) FromWire(w wire.Value) error
- func (v *GenerateServiceResponse) GetFiles() (o map[string][]byte)
- func (v *GenerateServiceResponse) IsSetFiles() bool
- func (v *GenerateServiceResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *GenerateServiceResponse) String() string
- func (v *GenerateServiceResponse) ToWire() (wire.Value, error)
- type HandshakeRequest
- func (v *HandshakeRequest) Decode(sr stream.Reader) error
- func (v *HandshakeRequest) Encode(sw stream.Writer) error
- func (v *HandshakeRequest) Equals(rhs *HandshakeRequest) bool
- func (v *HandshakeRequest) FromWire(w wire.Value) error
- func (v *HandshakeRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *HandshakeRequest) String() string
- func (v *HandshakeRequest) ToWire() (wire.Value, error)
- type HandshakeResponse
- func (v *HandshakeResponse) Decode(sr stream.Reader) error
- func (v *HandshakeResponse) Encode(sw stream.Writer) error
- func (v *HandshakeResponse) Equals(rhs *HandshakeResponse) bool
- func (v *HandshakeResponse) FromWire(w wire.Value) error
- func (v *HandshakeResponse) GetAPIVersion() (o int32)
- func (v *HandshakeResponse) GetFeatures() (o []Feature)
- func (v *HandshakeResponse) GetLibraryVersion() (o string)
- func (v *HandshakeResponse) GetName() (o string)
- func (v *HandshakeResponse) IsSetFeatures() bool
- func (v *HandshakeResponse) IsSetLibraryVersion() bool
- func (v *HandshakeResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *HandshakeResponse) String() string
- func (v *HandshakeResponse) ToWire() (wire.Value, error)
- type Module
- func (v *Module) Decode(sr stream.Reader) error
- func (v *Module) Encode(sw stream.Writer) error
- func (v *Module) Equals(rhs *Module) bool
- func (v *Module) FromWire(w wire.Value) error
- func (v *Module) GetDirectory() (o string)
- func (v *Module) GetImportPath() (o string)
- func (v *Module) GetThriftFilePath() (o string)
- func (v *Module) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Module) String() string
- func (v *Module) ToWire() (wire.Value, error)
- type ModuleID
- func (v *ModuleID) Decode(sr stream.Reader) error
- func (v ModuleID) Encode(sw stream.Writer) error
- func (lhs ModuleID) Equals(rhs ModuleID) bool
- func (v *ModuleID) FromWire(w wire.Value) error
- func (v ModuleID) Ptr() *ModuleID
- func (v ModuleID) String() string
- func (v ModuleID) ToWire() (wire.Value, error)
- type Plugin
- type PluginHandler
- type Plugin_Goodbye_Args
- func (v *Plugin_Goodbye_Args) Decode(sr stream.Reader) error
- func (v *Plugin_Goodbye_Args) Encode(sw stream.Writer) error
- func (v *Plugin_Goodbye_Args) EnvelopeType() wire.EnvelopeType
- func (v *Plugin_Goodbye_Args) Equals(rhs *Plugin_Goodbye_Args) bool
- func (v *Plugin_Goodbye_Args) FromWire(w wire.Value) error
- func (v *Plugin_Goodbye_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Plugin_Goodbye_Args) MethodName() string
- func (v *Plugin_Goodbye_Args) String() string
- func (v *Plugin_Goodbye_Args) ToWire() (wire.Value, error)
- type Plugin_Goodbye_Result
- func (v *Plugin_Goodbye_Result) Decode(sr stream.Reader) error
- func (v *Plugin_Goodbye_Result) Encode(sw stream.Writer) error
- func (v *Plugin_Goodbye_Result) EnvelopeType() wire.EnvelopeType
- func (v *Plugin_Goodbye_Result) Equals(rhs *Plugin_Goodbye_Result) bool
- func (v *Plugin_Goodbye_Result) FromWire(w wire.Value) error
- func (v *Plugin_Goodbye_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Plugin_Goodbye_Result) MethodName() string
- func (v *Plugin_Goodbye_Result) String() string
- func (v *Plugin_Goodbye_Result) ToWire() (wire.Value, error)
- type Plugin_Handshake_Args
- func (v *Plugin_Handshake_Args) Decode(sr stream.Reader) error
- func (v *Plugin_Handshake_Args) Encode(sw stream.Writer) error
- func (v *Plugin_Handshake_Args) EnvelopeType() wire.EnvelopeType
- func (v *Plugin_Handshake_Args) Equals(rhs *Plugin_Handshake_Args) bool
- func (v *Plugin_Handshake_Args) FromWire(w wire.Value) error
- func (v *Plugin_Handshake_Args) GetRequest() (o *HandshakeRequest)
- func (v *Plugin_Handshake_Args) IsSetRequest() bool
- func (v *Plugin_Handshake_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Plugin_Handshake_Args) MethodName() string
- func (v *Plugin_Handshake_Args) String() string
- func (v *Plugin_Handshake_Args) ToWire() (wire.Value, error)
- type Plugin_Handshake_Result
- func (v *Plugin_Handshake_Result) Decode(sr stream.Reader) error
- func (v *Plugin_Handshake_Result) Encode(sw stream.Writer) error
- func (v *Plugin_Handshake_Result) EnvelopeType() wire.EnvelopeType
- func (v *Plugin_Handshake_Result) Equals(rhs *Plugin_Handshake_Result) bool
- func (v *Plugin_Handshake_Result) FromWire(w wire.Value) error
- func (v *Plugin_Handshake_Result) GetSuccess() (o *HandshakeResponse)
- func (v *Plugin_Handshake_Result) IsSetSuccess() bool
- func (v *Plugin_Handshake_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Plugin_Handshake_Result) MethodName() string
- func (v *Plugin_Handshake_Result) String() string
- func (v *Plugin_Handshake_Result) ToWire() (wire.Value, error)
- type Service
- func (v *Service) Decode(sr stream.Reader) error
- func (v *Service) Encode(sw stream.Writer) error
- func (v *Service) Equals(rhs *Service) bool
- func (v *Service) FromWire(w wire.Value) error
- func (v *Service) GetAnnotations() (o map[string]string)
- func (v *Service) GetFunctions() (o []*Function)
- func (v *Service) GetModuleID() (o ModuleID)
- func (v *Service) GetName() (o string)
- func (v *Service) GetParentID() (o ServiceID)
- func (v *Service) GetThriftName() (o string)
- func (v *Service) IsSetAnnotations() bool
- func (v *Service) IsSetFunctions() bool
- func (v *Service) IsSetParentID() bool
- func (v *Service) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Service) String() string
- func (v *Service) ToWire() (wire.Value, error)
- type ServiceGenerator
- type ServiceGeneratorHandler
- type ServiceGenerator_Generate_Args
- func (v *ServiceGenerator_Generate_Args) Decode(sr stream.Reader) error
- func (v *ServiceGenerator_Generate_Args) Encode(sw stream.Writer) error
- func (v *ServiceGenerator_Generate_Args) EnvelopeType() wire.EnvelopeType
- func (v *ServiceGenerator_Generate_Args) Equals(rhs *ServiceGenerator_Generate_Args) bool
- func (v *ServiceGenerator_Generate_Args) FromWire(w wire.Value) error
- func (v *ServiceGenerator_Generate_Args) GetRequest() (o *GenerateServiceRequest)
- func (v *ServiceGenerator_Generate_Args) IsSetRequest() bool
- func (v *ServiceGenerator_Generate_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *ServiceGenerator_Generate_Args) MethodName() string
- func (v *ServiceGenerator_Generate_Args) String() string
- func (v *ServiceGenerator_Generate_Args) ToWire() (wire.Value, error)
- type ServiceGenerator_Generate_Result
- func (v *ServiceGenerator_Generate_Result) Decode(sr stream.Reader) error
- func (v *ServiceGenerator_Generate_Result) Encode(sw stream.Writer) error
- func (v *ServiceGenerator_Generate_Result) EnvelopeType() wire.EnvelopeType
- func (v *ServiceGenerator_Generate_Result) Equals(rhs *ServiceGenerator_Generate_Result) bool
- func (v *ServiceGenerator_Generate_Result) FromWire(w wire.Value) error
- func (v *ServiceGenerator_Generate_Result) GetSuccess() (o *GenerateServiceResponse)
- func (v *ServiceGenerator_Generate_Result) IsSetSuccess() bool
- func (v *ServiceGenerator_Generate_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *ServiceGenerator_Generate_Result) MethodName() string
- func (v *ServiceGenerator_Generate_Result) String() string
- func (v *ServiceGenerator_Generate_Result) ToWire() (wire.Value, error)
- type ServiceID
- func (v *ServiceID) Decode(sr stream.Reader) error
- func (v ServiceID) Encode(sw stream.Writer) error
- func (lhs ServiceID) Equals(rhs ServiceID) bool
- func (v *ServiceID) FromWire(w wire.Value) error
- func (v ServiceID) Ptr() *ServiceID
- func (v ServiceID) String() string
- func (v ServiceID) ToWire() (wire.Value, error)
- type SimpleType
- func (v *SimpleType) Decode(sr stream.Reader) error
- func (v SimpleType) Encode(sw stream.Writer) error
- func (v SimpleType) Equals(rhs SimpleType) bool
- func (v *SimpleType) FromWire(w wire.Value) error
- func (v SimpleType) MarshalJSON() ([]byte, error)
- func (v SimpleType) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (v SimpleType) MarshalText() ([]byte, error)
- func (v SimpleType) Ptr() *SimpleType
- func (v SimpleType) String() string
- func (v SimpleType) ToWire() (wire.Value, error)
- func (v *SimpleType) UnmarshalJSON(text []byte) error
- func (v *SimpleType) UnmarshalText(value []byte) error
- type Type
- func (v *Type) Decode(sr stream.Reader) error
- func (v *Type) Encode(sw stream.Writer) error
- func (v *Type) Equals(rhs *Type) bool
- func (v *Type) FromWire(w wire.Value) error
- func (v *Type) GetKeyValueSliceType() (o *TypePair)
- func (v *Type) GetMapType() (o *TypePair)
- func (v *Type) GetPointerType() (o *Type)
- func (v *Type) GetReferenceType() (o *TypeReference)
- func (v *Type) GetSimpleType() (o SimpleType)
- func (v *Type) GetSliceType() (o *Type)
- func (v *Type) IsSetKeyValueSliceType() bool
- func (v *Type) IsSetMapType() bool
- func (v *Type) IsSetPointerType() bool
- func (v *Type) IsSetReferenceType() bool
- func (v *Type) IsSetSimpleType() bool
- func (v *Type) IsSetSliceType() bool
- func (v *Type) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Type) String() string
- func (v *Type) ToWire() (wire.Value, error)
- type TypePair
- func (v *TypePair) Decode(sr stream.Reader) error
- func (v *TypePair) Encode(sw stream.Writer) error
- func (v *TypePair) Equals(rhs *TypePair) bool
- func (v *TypePair) FromWire(w wire.Value) error
- func (v *TypePair) GetLeft() (o *Type)
- func (v *TypePair) GetRight() (o *Type)
- func (v *TypePair) IsSetLeft() bool
- func (v *TypePair) IsSetRight() bool
- func (v *TypePair) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *TypePair) String() string
- func (v *TypePair) ToWire() (wire.Value, error)
- type TypeReference
- func (v *TypeReference) Decode(sr stream.Reader) error
- func (v *TypeReference) Encode(sw stream.Writer) error
- func (v *TypeReference) Equals(rhs *TypeReference) bool
- func (v *TypeReference) FromWire(w wire.Value) error
- func (v *TypeReference) GetAnnotations() (o map[string]string)
- func (v *TypeReference) GetImportPath() (o string)
- func (v *TypeReference) GetName() (o string)
- func (v *TypeReference) IsSetAnnotations() bool
- func (v *TypeReference) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *TypeReference) String() string
- func (v *TypeReference) ToWire() (wire.Value, error)
Constants ¶
const APIVersion int32 = 4
API_VERSION is the version of the plugin API.
This MUST be provided in the HandshakeResponse.
Variables ¶
var Plugin_Goodbye_Helper = struct { // Args accepts the parameters of goodbye in-order and returns // the arguments struct for the function. Args func() *Plugin_Goodbye_Args // IsException returns true if the given error can be thrown // by goodbye. // // An error can be thrown by goodbye only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool // WrapResponse returns the result struct for goodbye // given the error returned by it. The provided error may // be nil if goodbye did not fail. // // This allows mapping errors returned by goodbye into a // serializable result struct. WrapResponse returns a // non-nil error if the provided error cannot be thrown by // goodbye // // err := goodbye(args) // result, err := Plugin_Goodbye_Helper.WrapResponse(err) // if err != nil { // return fmt.Errorf("unexpected error from goodbye: %v", err) // } // serialize(result) WrapResponse func(error) (*Plugin_Goodbye_Result, error) // UnwrapResponse takes the result struct for goodbye // and returns the erorr returned by it (if any). // // The error is non-nil only if goodbye threw an // exception. // // result := deserialize(bytes) // err := Plugin_Goodbye_Helper.UnwrapResponse(result) UnwrapResponse func(*Plugin_Goodbye_Result) error }{}
Plugin_Goodbye_Helper provides functions that aid in handling the parameters and return values of the Plugin.goodbye function.
var Plugin_Handshake_Helper = struct { // Args accepts the parameters of handshake in-order and returns // the arguments struct for the function. Args func( request *HandshakeRequest, ) *Plugin_Handshake_Args // IsException returns true if the given error can be thrown // by handshake. // // An error can be thrown by handshake only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool // WrapResponse returns the result struct for handshake // given its return value and error. // // This allows mapping values and errors returned by // handshake into a serializable result struct. // WrapResponse returns a non-nil error if the provided // error cannot be thrown by handshake // // value, err := handshake(args) // result, err := Plugin_Handshake_Helper.WrapResponse(value, err) // if err != nil { // return fmt.Errorf("unexpected error from handshake: %v", err) // } // serialize(result) WrapResponse func(*HandshakeResponse, error) (*Plugin_Handshake_Result, error) // UnwrapResponse takes the result struct for handshake // and returns the value or error returned by it. // // The error is non-nil only if handshake threw an // exception. // // result := deserialize(bytes) // value, err := Plugin_Handshake_Helper.UnwrapResponse(result) UnwrapResponse func(*Plugin_Handshake_Result) (*HandshakeResponse, error) }{}
Plugin_Handshake_Helper provides functions that aid in handling the parameters and return values of the Plugin.handshake function.
var ServiceGenerator_Generate_Helper = struct { // Args accepts the parameters of generate in-order and returns // the arguments struct for the function. Args func( request *GenerateServiceRequest, ) *ServiceGenerator_Generate_Args // IsException returns true if the given error can be thrown // by generate. // // An error can be thrown by generate only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool // WrapResponse returns the result struct for generate // given its return value and error. // // This allows mapping values and errors returned by // generate into a serializable result struct. // WrapResponse returns a non-nil error if the provided // error cannot be thrown by generate // // value, err := generate(args) // result, err := ServiceGenerator_Generate_Helper.WrapResponse(value, err) // if err != nil { // return fmt.Errorf("unexpected error from generate: %v", err) // } // serialize(result) WrapResponse func(*GenerateServiceResponse, error) (*ServiceGenerator_Generate_Result, error) // UnwrapResponse takes the result struct for generate // and returns the value or error returned by it. // // The error is non-nil only if generate threw an // exception. // // result := deserialize(bytes) // value, err := ServiceGenerator_Generate_Helper.UnwrapResponse(result) UnwrapResponse func(*ServiceGenerator_Generate_Result) (*GenerateServiceResponse, error) }{}
ServiceGenerator_Generate_Helper provides functions that aid in handling the parameters and return values of the ServiceGenerator.generate function.
var ThriftModule = &thriftreflect.ThriftModule{
Name: "api",
Package: "go.uber.org/thriftrw/plugin/api",
FilePath: "api.thrift",
SHA1: "f7eeea00e3002a17188f595c7117b9359ab244d3",
Raw: rawIDL,
}
ThriftModule represents the IDL file used to generate this package.
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument struct { // Name of the argument. This is also the name of the argument field // inside the args/result struct for that function. Name string `json:"name,required"` // Argument type. Type *Type `json:"type,required"` // Annotations defined on this argument. // // Given, // // void setValue( // 1: SetValueRequest req // ) throws ( // 1: BadRequestError badRequestError (cache = "false") // ) // // The annotations for the Argument representing badRequestError will be, // // { // "cache": "false", // } Annotations map[string]string `json:"annotations,omitempty"` }
Argument is a single Argument inside a Function. For,
void setValue(1: string key, 2: string value)
You get the arguments,
Argument{Name: "Key", Type: Type{SimpleType: SimpleTypeString}} Argument{Name: "Value", Type: Type{SimpleType: SimpleTypeString}}
func (*Argument) Decode ¶ added in v1.29.0
Decode deserializes a Argument struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Argument struct could not be generated from the wire representation.
func (*Argument) Encode ¶ added in v1.29.0
Encode serializes a Argument struct directly into bytes, without going through an intermediary type.
An error is returned if a Argument struct could not be encoded.
func (*Argument) Equals ¶ added in v1.2.0
Equals returns true if all the fields of this Argument match the provided Argument.
This function performs a deep comparison.
func (*Argument) FromWire ¶
FromWire deserializes a Argument struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Argument struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Argument if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Argument) GetAnnotations ¶ added in v1.22.0
GetAnnotations returns the value of Annotations if it is set or its zero value if it is unset.
func (*Argument) GetName ¶ added in v1.13.0
GetName returns the value of Name if it is set or its zero value if it is unset.
func (*Argument) GetType ¶ added in v1.13.0
GetType returns the value of Type if it is set or its zero value if it is unset.
func (*Argument) IsSetAnnotations ¶ added in v1.22.0
IsSetAnnotations returns true if Annotations is not nil.
func (*Argument) MarshalLogObject ¶ added in v1.13.0
func (v *Argument) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Argument.
func (*Argument) ToWire ¶
ToWire translates a Argument struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type Feature ¶
type Feature int32
Feature is a functionality offered by a ThriftRW plugin.
const ( // SERVICE_GENERATOR specifies that the plugin may generate arbitrary code // for services defined in the Thrift file. // // If a plugin provides this, it MUST implement the ServiceGenerator // service. FeatureServiceGenerator Feature = 1 )
func Feature_Values ¶ added in v1.3.0
func Feature_Values() []Feature
Feature_Values returns all recognized values of Feature.
func (*Feature) Decode ¶ added in v1.29.0
Decode reads off the encoded Feature directly off of the wire.
sReader := BinaryStreamer.Reader(reader) var v Feature if err := v.Decode(sReader); err != nil { return Feature(0), err } return v, nil
func (Feature) Encode ¶ added in v1.29.0
Encode encodes Feature directly to bytes.
sWriter := BinaryStreamer.Writer(writer) var v Feature return v.Encode(sWriter)
func (Feature) Equals ¶ added in v1.2.0
Equals returns true if this Feature value matches the provided value.
func (*Feature) FromWire ¶
FromWire deserializes Feature from its Thrift-level representation.
x, err := binaryProtocol.Decode(reader, wire.TI32) if err != nil { return Feature(0), err } var v Feature if err := v.FromWire(x); err != nil { return Feature(0), err } return v, nil
func (Feature) MarshalJSON ¶ added in v0.5.0
MarshalJSON serializes Feature into JSON.
If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.
This implements json.Marshaler.
func (Feature) MarshalLogObject ¶ added in v1.13.0
func (v Feature) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Feature. Enums are logged as objects, where the value is logged with key "value", and if this value's name is known, the name is logged with key "name".
func (Feature) MarshalText ¶ added in v1.13.0
MarshalText encodes Feature to text.
If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.
This implements the TextMarshaler interface.
func (Feature) ToWire ¶
ToWire translates Feature into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
Enums are represented as 32-bit integers over the wire.
func (*Feature) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON attempts to decode Feature from its JSON representation.
This implementation supports both, numeric and string inputs. If a string is provided, it must be a known enum name.
This implements json.Unmarshaler.
func (*Feature) UnmarshalText ¶ added in v1.3.0
UnmarshalText tries to decode Feature from a byte slice containing its name.
var v Feature err := v.UnmarshalText([]byte("SERVICE_GENERATOR"))
type Function ¶
type Function struct { // Name of the Go function. Name string `json:"name,required"` // Name of the function as defined in the Thrift file. ThriftName string `json:"thriftName,required"` // List of arguments accepted by the function. // // This list is in the order specified by the user in the Thrift file. Arguments []*Argument `json:"arguments,required"` // Return type of the function, if any. If this is not set, the function // is a void function. ReturnType *Type `json:"returnType,omitempty"` // List of exceptions raised by the function. // // This list is in the order specified by the user in the Thrift file. Exceptions []*Argument `json:"exceptions,omitempty"` // Whether this function is oneway or not. This should be assumed to be // false unless explicitly stated otherwise. If this is true, the // returnType and exceptions will be null or empty. OneWay *bool `json:"oneWay,omitempty"` // Annotations defined on this function. // // Given, // // void setValue(1: SetValueRequest req) (cache = "false") // // The annotations will be, // // { // "cache": "false", // } Annotations map[string]string `json:"annotations,omitempty"` }
Function is a single function on a Thrift service.
func (*Function) Decode ¶ added in v1.29.0
Decode deserializes a Function struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Function struct could not be generated from the wire representation.
func (*Function) Encode ¶ added in v1.29.0
Encode serializes a Function struct directly into bytes, without going through an intermediary type.
An error is returned if a Function struct could not be encoded.
func (*Function) Equals ¶ added in v1.2.0
Equals returns true if all the fields of this Function match the provided Function.
This function performs a deep comparison.
func (*Function) FromWire ¶
FromWire deserializes a Function struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Function struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Function if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Function) GetAnnotations ¶ added in v1.13.0
GetAnnotations returns the value of Annotations if it is set or its zero value if it is unset.
func (*Function) GetArguments ¶ added in v1.13.0
GetArguments returns the value of Arguments if it is set or its zero value if it is unset.
func (*Function) GetExceptions ¶ added in v1.13.0
GetExceptions returns the value of Exceptions if it is set or its zero value if it is unset.
func (*Function) GetName ¶ added in v1.13.0
GetName returns the value of Name if it is set or its zero value if it is unset.
func (*Function) GetOneWay ¶ added in v1.7.0
GetOneWay returns the value of OneWay if it is set or its zero value if it is unset.
func (*Function) GetReturnType ¶ added in v1.13.0
GetReturnType returns the value of ReturnType if it is set or its zero value if it is unset.
func (*Function) GetThriftName ¶ added in v1.13.0
GetThriftName returns the value of ThriftName if it is set or its zero value if it is unset.
func (*Function) IsSetAnnotations ¶ added in v1.14.0
IsSetAnnotations returns true if Annotations is not nil.
func (*Function) IsSetArguments ¶ added in v1.14.0
IsSetArguments returns true if Arguments is not nil.
func (*Function) IsSetExceptions ¶ added in v1.14.0
IsSetExceptions returns true if Exceptions is not nil.
func (*Function) IsSetOneWay ¶ added in v1.14.0
IsSetOneWay returns true if OneWay is not nil.
func (*Function) IsSetReturnType ¶ added in v1.14.0
IsSetReturnType returns true if ReturnType is not nil.
func (*Function) MarshalLogObject ¶ added in v1.13.0
func (v *Function) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Function.
func (*Function) ToWire ¶
ToWire translates a Function struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type GenerateServiceRequest ¶
type GenerateServiceRequest struct { // IDs of services for which code should be generated. // // Note that the services map contains information about both, the // services being generated and their transitive dependencies. Code should // only be generated for service IDs listed here. RootServices []ServiceID `json:"rootServices,required"` // Map of service ID to service. // // Any service IDs present in this request will have a corresponding // service definition in this map, including services for which code does // not need to be generated. Services map[ServiceID]*Service `json:"services,required"` // Map of module ID to module. // // Any module IDs present in the request will have a corresponding module // definition in this map. Modules map[ModuleID]*Module `json:"modules,required"` // Prefix for import paths of generated module. In general, plugins should // not need to use the package prefix unless instantiating a new // Generator for more custom plugin generation. PackagePrefix string `json:"packagePrefix,required"` // Directory whose descendants contain all Thrift files. In general, // plugins should not need to use the thrift root unless instantiating a // new Generator for more custom plugin generation. ThriftRoot string `json:"thriftRoot,required"` // IDs of Modules for which code should be generated. // // Note that the modules map contains information about both, the // modules being generated and their transitive dependencies. Code should // only be generated for module IDs listed here. RootModules []ModuleID `json:"rootModules,omitempty"` }
GenerateServiceRequest is a request to generate code for zero or more Thrift services.
func (*GenerateServiceRequest) Decode ¶ added in v1.29.0
func (v *GenerateServiceRequest) Decode(sr stream.Reader) error
Decode deserializes a GenerateServiceRequest struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a GenerateServiceRequest struct could not be generated from the wire representation.
func (*GenerateServiceRequest) Encode ¶ added in v1.29.0
func (v *GenerateServiceRequest) Encode(sw stream.Writer) error
Encode serializes a GenerateServiceRequest struct directly into bytes, without going through an intermediary type.
An error is returned if a GenerateServiceRequest struct could not be encoded.
func (*GenerateServiceRequest) Equals ¶ added in v1.2.0
func (v *GenerateServiceRequest) Equals(rhs *GenerateServiceRequest) bool
Equals returns true if all the fields of this GenerateServiceRequest match the provided GenerateServiceRequest.
This function performs a deep comparison.
func (*GenerateServiceRequest) FromWire ¶
func (v *GenerateServiceRequest) FromWire(w wire.Value) error
FromWire deserializes a GenerateServiceRequest struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a GenerateServiceRequest struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v GenerateServiceRequest if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*GenerateServiceRequest) GetModules ¶ added in v1.13.0
func (v *GenerateServiceRequest) GetModules() (o map[ModuleID]*Module)
GetModules returns the value of Modules if it is set or its zero value if it is unset.
func (*GenerateServiceRequest) GetPackagePrefix ¶ added in v1.16.0
func (v *GenerateServiceRequest) GetPackagePrefix() (o string)
GetPackagePrefix returns the value of PackagePrefix if it is set or its zero value if it is unset.
func (*GenerateServiceRequest) GetRootModules ¶ added in v1.25.0
func (v *GenerateServiceRequest) GetRootModules() (o []ModuleID)
GetRootModules returns the value of RootModules if it is set or its zero value if it is unset.
func (*GenerateServiceRequest) GetRootServices ¶ added in v1.13.0
func (v *GenerateServiceRequest) GetRootServices() (o []ServiceID)
GetRootServices returns the value of RootServices if it is set or its zero value if it is unset.
func (*GenerateServiceRequest) GetServices ¶ added in v1.13.0
func (v *GenerateServiceRequest) GetServices() (o map[ServiceID]*Service)
GetServices returns the value of Services if it is set or its zero value if it is unset.
func (*GenerateServiceRequest) GetThriftRoot ¶ added in v1.16.0
func (v *GenerateServiceRequest) GetThriftRoot() (o string)
GetThriftRoot returns the value of ThriftRoot if it is set or its zero value if it is unset.
func (*GenerateServiceRequest) IsSetModules ¶ added in v1.14.0
func (v *GenerateServiceRequest) IsSetModules() bool
IsSetModules returns true if Modules is not nil.
func (*GenerateServiceRequest) IsSetRootModules ¶ added in v1.25.0
func (v *GenerateServiceRequest) IsSetRootModules() bool
IsSetRootModules returns true if RootModules is not nil.
func (*GenerateServiceRequest) IsSetRootServices ¶ added in v1.14.0
func (v *GenerateServiceRequest) IsSetRootServices() bool
IsSetRootServices returns true if RootServices is not nil.
func (*GenerateServiceRequest) IsSetServices ¶ added in v1.14.0
func (v *GenerateServiceRequest) IsSetServices() bool
IsSetServices returns true if Services is not nil.
func (*GenerateServiceRequest) MarshalLogObject ¶ added in v1.13.0
func (v *GenerateServiceRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of GenerateServiceRequest.
func (*GenerateServiceRequest) String ¶
func (v *GenerateServiceRequest) String() string
String returns a readable string representation of a GenerateServiceRequest struct.
func (*GenerateServiceRequest) ToWire ¶
func (v *GenerateServiceRequest) ToWire() (wire.Value, error)
ToWire translates a GenerateServiceRequest struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type GenerateServiceResponse ¶
type GenerateServiceResponse struct { // Map of file path to file contents. // // All paths MUST be relative to the output directory into which ThriftRW // is generating code. Plugins SHOULD NOT make any assumptions about the // absolute location of the directory. // // The paths MUST NOT contain the string ".." or the request will fail. Files map[string][]byte `json:"files,omitempty"` }
GenerateServiceResponse is response to a GenerateServiceRequest.
func (*GenerateServiceResponse) Decode ¶ added in v1.29.0
func (v *GenerateServiceResponse) Decode(sr stream.Reader) error
Decode deserializes a GenerateServiceResponse struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a GenerateServiceResponse struct could not be generated from the wire representation.
func (*GenerateServiceResponse) Encode ¶ added in v1.29.0
func (v *GenerateServiceResponse) Encode(sw stream.Writer) error
Encode serializes a GenerateServiceResponse struct directly into bytes, without going through an intermediary type.
An error is returned if a GenerateServiceResponse struct could not be encoded.
func (*GenerateServiceResponse) Equals ¶ added in v1.2.0
func (v *GenerateServiceResponse) Equals(rhs *GenerateServiceResponse) bool
Equals returns true if all the fields of this GenerateServiceResponse match the provided GenerateServiceResponse.
This function performs a deep comparison.
func (*GenerateServiceResponse) FromWire ¶
func (v *GenerateServiceResponse) FromWire(w wire.Value) error
FromWire deserializes a GenerateServiceResponse struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a GenerateServiceResponse struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v GenerateServiceResponse if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*GenerateServiceResponse) GetFiles ¶ added in v1.13.0
func (v *GenerateServiceResponse) GetFiles() (o map[string][]byte)
GetFiles returns the value of Files if it is set or its zero value if it is unset.
func (*GenerateServiceResponse) IsSetFiles ¶ added in v1.14.0
func (v *GenerateServiceResponse) IsSetFiles() bool
IsSetFiles returns true if Files is not nil.
func (*GenerateServiceResponse) MarshalLogObject ¶ added in v1.13.0
func (v *GenerateServiceResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of GenerateServiceResponse.
func (*GenerateServiceResponse) String ¶
func (v *GenerateServiceResponse) String() string
String returns a readable string representation of a GenerateServiceResponse struct.
func (*GenerateServiceResponse) ToWire ¶
func (v *GenerateServiceResponse) ToWire() (wire.Value, error)
ToWire translates a GenerateServiceResponse struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type HandshakeRequest ¶
type HandshakeRequest struct { }
HandshakeRequest is the initial request sent to the plugin as part of establishing communication and feature negotiation.
func (*HandshakeRequest) Decode ¶ added in v1.29.0
func (v *HandshakeRequest) Decode(sr stream.Reader) error
Decode deserializes a HandshakeRequest struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a HandshakeRequest struct could not be generated from the wire representation.
func (*HandshakeRequest) Encode ¶ added in v1.29.0
func (v *HandshakeRequest) Encode(sw stream.Writer) error
Encode serializes a HandshakeRequest struct directly into bytes, without going through an intermediary type.
An error is returned if a HandshakeRequest struct could not be encoded.
func (*HandshakeRequest) Equals ¶ added in v1.2.0
func (v *HandshakeRequest) Equals(rhs *HandshakeRequest) bool
Equals returns true if all the fields of this HandshakeRequest match the provided HandshakeRequest.
This function performs a deep comparison.
func (*HandshakeRequest) FromWire ¶
func (v *HandshakeRequest) FromWire(w wire.Value) error
FromWire deserializes a HandshakeRequest struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a HandshakeRequest struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v HandshakeRequest if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*HandshakeRequest) MarshalLogObject ¶ added in v1.13.0
func (v *HandshakeRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of HandshakeRequest.
func (*HandshakeRequest) String ¶
func (v *HandshakeRequest) String() string
String returns a readable string representation of a HandshakeRequest struct.
func (*HandshakeRequest) ToWire ¶
func (v *HandshakeRequest) ToWire() (wire.Value, error)
ToWire translates a HandshakeRequest struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type HandshakeResponse ¶
type HandshakeResponse struct { // Name of the plugin. This MUST match the name of the plugin specified // over the command line or the program will fail. Name string `json:"name,required"` // Version of the plugin API. // // This MUST be set to API_VERSION by the plugin. APIVersion int32 `json:"apiVersion,required"` // List of features the plugin provides. Features []Feature `json:"features,required"` // Version of ThriftRW with which the plugin was built. // // This MUST be set to go.uber.org/thriftrw/version.Version by the plugin // explicitly. LibraryVersion *string `json:"libraryVersion,omitempty"` }
HandshakeResponse is the response from the plugin for a HandshakeRequest.
func (*HandshakeResponse) Decode ¶ added in v1.29.0
func (v *HandshakeResponse) Decode(sr stream.Reader) error
Decode deserializes a HandshakeResponse struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a HandshakeResponse struct could not be generated from the wire representation.
func (*HandshakeResponse) Encode ¶ added in v1.29.0
func (v *HandshakeResponse) Encode(sw stream.Writer) error
Encode serializes a HandshakeResponse struct directly into bytes, without going through an intermediary type.
An error is returned if a HandshakeResponse struct could not be encoded.
func (*HandshakeResponse) Equals ¶ added in v1.2.0
func (v *HandshakeResponse) Equals(rhs *HandshakeResponse) bool
Equals returns true if all the fields of this HandshakeResponse match the provided HandshakeResponse.
This function performs a deep comparison.
func (*HandshakeResponse) FromWire ¶
func (v *HandshakeResponse) FromWire(w wire.Value) error
FromWire deserializes a HandshakeResponse struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a HandshakeResponse struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v HandshakeResponse if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*HandshakeResponse) GetAPIVersion ¶ added in v1.13.0
func (v *HandshakeResponse) GetAPIVersion() (o int32)
GetAPIVersion returns the value of APIVersion if it is set or its zero value if it is unset.
func (*HandshakeResponse) GetFeatures ¶ added in v1.13.0
func (v *HandshakeResponse) GetFeatures() (o []Feature)
GetFeatures returns the value of Features if it is set or its zero value if it is unset.
func (*HandshakeResponse) GetLibraryVersion ¶ added in v1.7.0
func (v *HandshakeResponse) GetLibraryVersion() (o string)
GetLibraryVersion returns the value of LibraryVersion if it is set or its zero value if it is unset.
func (*HandshakeResponse) GetName ¶ added in v1.13.0
func (v *HandshakeResponse) GetName() (o string)
GetName returns the value of Name if it is set or its zero value if it is unset.
func (*HandshakeResponse) IsSetFeatures ¶ added in v1.14.0
func (v *HandshakeResponse) IsSetFeatures() bool
IsSetFeatures returns true if Features is not nil.
func (*HandshakeResponse) IsSetLibraryVersion ¶ added in v1.14.0
func (v *HandshakeResponse) IsSetLibraryVersion() bool
IsSetLibraryVersion returns true if LibraryVersion is not nil.
func (*HandshakeResponse) MarshalLogObject ¶ added in v1.13.0
func (v *HandshakeResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of HandshakeResponse.
func (*HandshakeResponse) String ¶
func (v *HandshakeResponse) String() string
String returns a readable string representation of a HandshakeResponse struct.
func (*HandshakeResponse) ToWire ¶
func (v *HandshakeResponse) ToWire() (wire.Value, error)
ToWire translates a HandshakeResponse struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type Module ¶
type Module struct { // Import path for the package defining the types for this module. ImportPath string `json:"importPath,required"` // Path to the directory containing the code for this module. // // The path is relative to the output directory into which ThriftRW is // generating code. Plugins SHOULD NOT make any assumptions about the // absolute location of the directory. Directory string `json:"directory,required"` // Path to the Thrift file from which this module was generated. ThriftFilePath string `json:"thriftFilePath,required"` }
Module is a module generated from a single Thrift file. Each module corresponds to exactly one Thrift file and contains all the types and constants defined in that Thrift file.
func (*Module) Decode ¶ added in v1.29.0
Decode deserializes a Module struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Module struct could not be generated from the wire representation.
func (*Module) Encode ¶ added in v1.29.0
Encode serializes a Module struct directly into bytes, without going through an intermediary type.
An error is returned if a Module struct could not be encoded.
func (*Module) Equals ¶ added in v1.2.0
Equals returns true if all the fields of this Module match the provided Module.
This function performs a deep comparison.
func (*Module) FromWire ¶
FromWire deserializes a Module struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Module struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Module if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Module) GetDirectory ¶ added in v1.13.0
GetDirectory returns the value of Directory if it is set or its zero value if it is unset.
func (*Module) GetImportPath ¶ added in v1.13.0
GetImportPath returns the value of ImportPath if it is set or its zero value if it is unset.
func (*Module) GetThriftFilePath ¶ added in v1.16.0
GetThriftFilePath returns the value of ThriftFilePath if it is set or its zero value if it is unset.
func (*Module) MarshalLogObject ¶ added in v1.13.0
func (v *Module) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Module.
func (*Module) ToWire ¶
ToWire translates a Module struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type ModuleID ¶
type ModuleID int32
ModuleID is an arbitrary unique identifier to reference the different modules in this request.
func (ModuleID) Equals ¶ added in v1.2.0
Equals returns true if this ModuleID is equal to the provided ModuleID.
func (*ModuleID) FromWire ¶
FromWire deserializes ModuleID from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
type Plugin ¶
type Plugin interface { Goodbye() error Handshake( Request *HandshakeRequest, ) (*HandshakeResponse, error) }
func NewPluginClient ¶ added in v0.5.0
NewPluginClient builds a new Plugin client.
type PluginHandler ¶ added in v0.5.0
type PluginHandler struct {
// contains filtered or unexported fields
}
PluginHandler serves an implementation of the Plugin service.
func NewPluginHandler ¶ added in v0.5.0
func NewPluginHandler(service Plugin) PluginHandler
NewPluginHandler builds a new Plugin handler.
type Plugin_Goodbye_Args ¶ added in v0.5.0
type Plugin_Goodbye_Args struct { }
Plugin_Goodbye_Args represents the arguments for the Plugin.goodbye function.
The arguments for goodbye are sent and received over the wire as this struct.
func (*Plugin_Goodbye_Args) Decode ¶ added in v1.29.0
func (v *Plugin_Goodbye_Args) Decode(sr stream.Reader) error
Decode deserializes a Plugin_Goodbye_Args struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Plugin_Goodbye_Args struct could not be generated from the wire representation.
func (*Plugin_Goodbye_Args) Encode ¶ added in v1.29.0
func (v *Plugin_Goodbye_Args) Encode(sw stream.Writer) error
Encode serializes a Plugin_Goodbye_Args struct directly into bytes, without going through an intermediary type.
An error is returned if a Plugin_Goodbye_Args struct could not be encoded.
func (*Plugin_Goodbye_Args) EnvelopeType ¶ added in v0.5.0
func (v *Plugin_Goodbye_Args) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Call for this struct.
func (*Plugin_Goodbye_Args) Equals ¶ added in v1.2.0
func (v *Plugin_Goodbye_Args) Equals(rhs *Plugin_Goodbye_Args) bool
Equals returns true if all the fields of this Plugin_Goodbye_Args match the provided Plugin_Goodbye_Args.
This function performs a deep comparison.
func (*Plugin_Goodbye_Args) FromWire ¶ added in v0.5.0
func (v *Plugin_Goodbye_Args) FromWire(w wire.Value) error
FromWire deserializes a Plugin_Goodbye_Args struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Plugin_Goodbye_Args struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Plugin_Goodbye_Args if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Plugin_Goodbye_Args) MarshalLogObject ¶ added in v1.13.0
func (v *Plugin_Goodbye_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Plugin_Goodbye_Args.
func (*Plugin_Goodbye_Args) MethodName ¶ added in v0.5.0
func (v *Plugin_Goodbye_Args) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the arguments.
This will always be "goodbye" for this struct.
func (*Plugin_Goodbye_Args) String ¶ added in v0.5.0
func (v *Plugin_Goodbye_Args) String() string
String returns a readable string representation of a Plugin_Goodbye_Args struct.
func (*Plugin_Goodbye_Args) ToWire ¶ added in v0.5.0
func (v *Plugin_Goodbye_Args) ToWire() (wire.Value, error)
ToWire translates a Plugin_Goodbye_Args struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type Plugin_Goodbye_Result ¶ added in v0.5.0
type Plugin_Goodbye_Result struct { }
Plugin_Goodbye_Result represents the result of a Plugin.goodbye function call.
The result of a goodbye execution is sent and received over the wire as this struct.
func (*Plugin_Goodbye_Result) Decode ¶ added in v1.29.0
func (v *Plugin_Goodbye_Result) Decode(sr stream.Reader) error
Decode deserializes a Plugin_Goodbye_Result struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Plugin_Goodbye_Result struct could not be generated from the wire representation.
func (*Plugin_Goodbye_Result) Encode ¶ added in v1.29.0
func (v *Plugin_Goodbye_Result) Encode(sw stream.Writer) error
Encode serializes a Plugin_Goodbye_Result struct directly into bytes, without going through an intermediary type.
An error is returned if a Plugin_Goodbye_Result struct could not be encoded.
func (*Plugin_Goodbye_Result) EnvelopeType ¶ added in v0.5.0
func (v *Plugin_Goodbye_Result) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Reply for this struct.
func (*Plugin_Goodbye_Result) Equals ¶ added in v1.2.0
func (v *Plugin_Goodbye_Result) Equals(rhs *Plugin_Goodbye_Result) bool
Equals returns true if all the fields of this Plugin_Goodbye_Result match the provided Plugin_Goodbye_Result.
This function performs a deep comparison.
func (*Plugin_Goodbye_Result) FromWire ¶ added in v0.5.0
func (v *Plugin_Goodbye_Result) FromWire(w wire.Value) error
FromWire deserializes a Plugin_Goodbye_Result struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Plugin_Goodbye_Result struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Plugin_Goodbye_Result if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Plugin_Goodbye_Result) MarshalLogObject ¶ added in v1.13.0
func (v *Plugin_Goodbye_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Plugin_Goodbye_Result.
func (*Plugin_Goodbye_Result) MethodName ¶ added in v0.5.0
func (v *Plugin_Goodbye_Result) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the result.
This will always be "goodbye" for this struct.
func (*Plugin_Goodbye_Result) String ¶ added in v0.5.0
func (v *Plugin_Goodbye_Result) String() string
String returns a readable string representation of a Plugin_Goodbye_Result struct.
func (*Plugin_Goodbye_Result) ToWire ¶ added in v0.5.0
func (v *Plugin_Goodbye_Result) ToWire() (wire.Value, error)
ToWire translates a Plugin_Goodbye_Result struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type Plugin_Handshake_Args ¶ added in v0.5.0
type Plugin_Handshake_Args struct {
Request *HandshakeRequest `json:"request,omitempty"`
}
Plugin_Handshake_Args represents the arguments for the Plugin.handshake function.
The arguments for handshake are sent and received over the wire as this struct.
func (*Plugin_Handshake_Args) Decode ¶ added in v1.29.0
func (v *Plugin_Handshake_Args) Decode(sr stream.Reader) error
Decode deserializes a Plugin_Handshake_Args struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Plugin_Handshake_Args struct could not be generated from the wire representation.
func (*Plugin_Handshake_Args) Encode ¶ added in v1.29.0
func (v *Plugin_Handshake_Args) Encode(sw stream.Writer) error
Encode serializes a Plugin_Handshake_Args struct directly into bytes, without going through an intermediary type.
An error is returned if a Plugin_Handshake_Args struct could not be encoded.
func (*Plugin_Handshake_Args) EnvelopeType ¶ added in v0.5.0
func (v *Plugin_Handshake_Args) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Call for this struct.
func (*Plugin_Handshake_Args) Equals ¶ added in v1.2.0
func (v *Plugin_Handshake_Args) Equals(rhs *Plugin_Handshake_Args) bool
Equals returns true if all the fields of this Plugin_Handshake_Args match the provided Plugin_Handshake_Args.
This function performs a deep comparison.
func (*Plugin_Handshake_Args) FromWire ¶ added in v0.5.0
func (v *Plugin_Handshake_Args) FromWire(w wire.Value) error
FromWire deserializes a Plugin_Handshake_Args struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Plugin_Handshake_Args struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Plugin_Handshake_Args if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Plugin_Handshake_Args) GetRequest ¶ added in v1.13.0
func (v *Plugin_Handshake_Args) GetRequest() (o *HandshakeRequest)
GetRequest returns the value of Request if it is set or its zero value if it is unset.
func (*Plugin_Handshake_Args) IsSetRequest ¶ added in v1.14.0
func (v *Plugin_Handshake_Args) IsSetRequest() bool
IsSetRequest returns true if Request is not nil.
func (*Plugin_Handshake_Args) MarshalLogObject ¶ added in v1.13.0
func (v *Plugin_Handshake_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Plugin_Handshake_Args.
func (*Plugin_Handshake_Args) MethodName ¶ added in v0.5.0
func (v *Plugin_Handshake_Args) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the arguments.
This will always be "handshake" for this struct.
func (*Plugin_Handshake_Args) String ¶ added in v0.5.0
func (v *Plugin_Handshake_Args) String() string
String returns a readable string representation of a Plugin_Handshake_Args struct.
func (*Plugin_Handshake_Args) ToWire ¶ added in v0.5.0
func (v *Plugin_Handshake_Args) ToWire() (wire.Value, error)
ToWire translates a Plugin_Handshake_Args struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type Plugin_Handshake_Result ¶ added in v0.5.0
type Plugin_Handshake_Result struct { // Value returned by handshake after a successful execution. Success *HandshakeResponse `json:"success,omitempty"` }
Plugin_Handshake_Result represents the result of a Plugin.handshake function call.
The result of a handshake execution is sent and received over the wire as this struct.
Success is set only if the function did not throw an exception.
func (*Plugin_Handshake_Result) Decode ¶ added in v1.29.0
func (v *Plugin_Handshake_Result) Decode(sr stream.Reader) error
Decode deserializes a Plugin_Handshake_Result struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Plugin_Handshake_Result struct could not be generated from the wire representation.
func (*Plugin_Handshake_Result) Encode ¶ added in v1.29.0
func (v *Plugin_Handshake_Result) Encode(sw stream.Writer) error
Encode serializes a Plugin_Handshake_Result struct directly into bytes, without going through an intermediary type.
An error is returned if a Plugin_Handshake_Result struct could not be encoded.
func (*Plugin_Handshake_Result) EnvelopeType ¶ added in v0.5.0
func (v *Plugin_Handshake_Result) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Reply for this struct.
func (*Plugin_Handshake_Result) Equals ¶ added in v1.2.0
func (v *Plugin_Handshake_Result) Equals(rhs *Plugin_Handshake_Result) bool
Equals returns true if all the fields of this Plugin_Handshake_Result match the provided Plugin_Handshake_Result.
This function performs a deep comparison.
func (*Plugin_Handshake_Result) FromWire ¶ added in v0.5.0
func (v *Plugin_Handshake_Result) FromWire(w wire.Value) error
FromWire deserializes a Plugin_Handshake_Result struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Plugin_Handshake_Result struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Plugin_Handshake_Result if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Plugin_Handshake_Result) GetSuccess ¶ added in v1.13.0
func (v *Plugin_Handshake_Result) GetSuccess() (o *HandshakeResponse)
GetSuccess returns the value of Success if it is set or its zero value if it is unset.
func (*Plugin_Handshake_Result) IsSetSuccess ¶ added in v1.14.0
func (v *Plugin_Handshake_Result) IsSetSuccess() bool
IsSetSuccess returns true if Success is not nil.
func (*Plugin_Handshake_Result) MarshalLogObject ¶ added in v1.13.0
func (v *Plugin_Handshake_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Plugin_Handshake_Result.
func (*Plugin_Handshake_Result) MethodName ¶ added in v0.5.0
func (v *Plugin_Handshake_Result) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the result.
This will always be "handshake" for this struct.
func (*Plugin_Handshake_Result) String ¶ added in v0.5.0
func (v *Plugin_Handshake_Result) String() string
String returns a readable string representation of a Plugin_Handshake_Result struct.
func (*Plugin_Handshake_Result) ToWire ¶ added in v0.5.0
func (v *Plugin_Handshake_Result) ToWire() (wire.Value, error)
ToWire translates a Plugin_Handshake_Result struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type Service ¶
type Service struct { // Name of the Thrift service in Go code. Name string `json:"name,required"` // Name of the service as defined in the Thrift file. ThriftName string `json:"thriftName,required"` // ID of the parent service. ParentID *ServiceID `json:"parentID,omitempty"` // List of functions defined for this service. Functions []*Function `json:"functions,required"` // ID of the module where this service was declared. ModuleID ModuleID `json:"moduleID,required"` // Annotations defined on this service. // // Given, // // service KeyValue { // } (private = "true") // // The annotations will be, // // { // "private": "true", // } Annotations map[string]string `json:"annotations,omitempty"` }
Service is a service defined by the user in the Thrift file.
func (*Service) Decode ¶ added in v1.29.0
Decode deserializes a Service struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Service struct could not be generated from the wire representation.
func (*Service) Encode ¶ added in v1.29.0
Encode serializes a Service struct directly into bytes, without going through an intermediary type.
An error is returned if a Service struct could not be encoded.
func (*Service) Equals ¶ added in v1.2.0
Equals returns true if all the fields of this Service match the provided Service.
This function performs a deep comparison.
func (*Service) FromWire ¶
FromWire deserializes a Service struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Service struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Service if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Service) GetAnnotations ¶ added in v1.13.0
GetAnnotations returns the value of Annotations if it is set or its zero value if it is unset.
func (*Service) GetFunctions ¶ added in v1.13.0
GetFunctions returns the value of Functions if it is set or its zero value if it is unset.
func (*Service) GetModuleID ¶ added in v1.13.0
GetModuleID returns the value of ModuleID if it is set or its zero value if it is unset.
func (*Service) GetName ¶ added in v1.13.0
GetName returns the value of Name if it is set or its zero value if it is unset.
func (*Service) GetParentID ¶ added in v1.7.0
GetParentID returns the value of ParentID if it is set or its zero value if it is unset.
func (*Service) GetThriftName ¶ added in v1.13.0
GetThriftName returns the value of ThriftName if it is set or its zero value if it is unset.
func (*Service) IsSetAnnotations ¶ added in v1.14.0
IsSetAnnotations returns true if Annotations is not nil.
func (*Service) IsSetFunctions ¶ added in v1.14.0
IsSetFunctions returns true if Functions is not nil.
func (*Service) IsSetParentID ¶ added in v1.14.0
IsSetParentID returns true if ParentID is not nil.
func (*Service) MarshalLogObject ¶ added in v1.13.0
func (v *Service) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Service.
func (*Service) ToWire ¶
ToWire translates a Service struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type ServiceGenerator ¶
type ServiceGenerator interface { Generate( Request *GenerateServiceRequest, ) (*GenerateServiceResponse, error) }
func NewServiceGeneratorClient ¶ added in v0.5.0
func NewServiceGeneratorClient(c envelope.Client) ServiceGenerator
NewServiceGeneratorClient builds a new ServiceGenerator client.
type ServiceGeneratorHandler ¶ added in v0.5.0
type ServiceGeneratorHandler struct {
// contains filtered or unexported fields
}
ServiceGeneratorHandler serves an implementation of the ServiceGenerator service.
func NewServiceGeneratorHandler ¶ added in v0.5.0
func NewServiceGeneratorHandler(service ServiceGenerator) ServiceGeneratorHandler
NewServiceGeneratorHandler builds a new ServiceGenerator handler.
type ServiceGenerator_Generate_Args ¶ added in v0.5.0
type ServiceGenerator_Generate_Args struct {
Request *GenerateServiceRequest `json:"request,omitempty"`
}
ServiceGenerator_Generate_Args represents the arguments for the ServiceGenerator.generate function.
The arguments for generate are sent and received over the wire as this struct.
func (*ServiceGenerator_Generate_Args) Decode ¶ added in v1.29.0
func (v *ServiceGenerator_Generate_Args) Decode(sr stream.Reader) error
Decode deserializes a ServiceGenerator_Generate_Args struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a ServiceGenerator_Generate_Args struct could not be generated from the wire representation.
func (*ServiceGenerator_Generate_Args) Encode ¶ added in v1.29.0
func (v *ServiceGenerator_Generate_Args) Encode(sw stream.Writer) error
Encode serializes a ServiceGenerator_Generate_Args struct directly into bytes, without going through an intermediary type.
An error is returned if a ServiceGenerator_Generate_Args struct could not be encoded.
func (*ServiceGenerator_Generate_Args) EnvelopeType ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Args) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Call for this struct.
func (*ServiceGenerator_Generate_Args) Equals ¶ added in v1.2.0
func (v *ServiceGenerator_Generate_Args) Equals(rhs *ServiceGenerator_Generate_Args) bool
Equals returns true if all the fields of this ServiceGenerator_Generate_Args match the provided ServiceGenerator_Generate_Args.
This function performs a deep comparison.
func (*ServiceGenerator_Generate_Args) FromWire ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Args) FromWire(w wire.Value) error
FromWire deserializes a ServiceGenerator_Generate_Args struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a ServiceGenerator_Generate_Args struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v ServiceGenerator_Generate_Args if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*ServiceGenerator_Generate_Args) GetRequest ¶ added in v1.13.0
func (v *ServiceGenerator_Generate_Args) GetRequest() (o *GenerateServiceRequest)
GetRequest returns the value of Request if it is set or its zero value if it is unset.
func (*ServiceGenerator_Generate_Args) IsSetRequest ¶ added in v1.14.0
func (v *ServiceGenerator_Generate_Args) IsSetRequest() bool
IsSetRequest returns true if Request is not nil.
func (*ServiceGenerator_Generate_Args) MarshalLogObject ¶ added in v1.13.0
func (v *ServiceGenerator_Generate_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of ServiceGenerator_Generate_Args.
func (*ServiceGenerator_Generate_Args) MethodName ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Args) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the arguments.
This will always be "generate" for this struct.
func (*ServiceGenerator_Generate_Args) String ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Args) String() string
String returns a readable string representation of a ServiceGenerator_Generate_Args struct.
func (*ServiceGenerator_Generate_Args) ToWire ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Args) ToWire() (wire.Value, error)
ToWire translates a ServiceGenerator_Generate_Args struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type ServiceGenerator_Generate_Result ¶ added in v0.5.0
type ServiceGenerator_Generate_Result struct { // Value returned by generate after a successful execution. Success *GenerateServiceResponse `json:"success,omitempty"` }
ServiceGenerator_Generate_Result represents the result of a ServiceGenerator.generate function call.
The result of a generate execution is sent and received over the wire as this struct.
Success is set only if the function did not throw an exception.
func (*ServiceGenerator_Generate_Result) Decode ¶ added in v1.29.0
func (v *ServiceGenerator_Generate_Result) Decode(sr stream.Reader) error
Decode deserializes a ServiceGenerator_Generate_Result struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a ServiceGenerator_Generate_Result struct could not be generated from the wire representation.
func (*ServiceGenerator_Generate_Result) Encode ¶ added in v1.29.0
func (v *ServiceGenerator_Generate_Result) Encode(sw stream.Writer) error
Encode serializes a ServiceGenerator_Generate_Result struct directly into bytes, without going through an intermediary type.
An error is returned if a ServiceGenerator_Generate_Result struct could not be encoded.
func (*ServiceGenerator_Generate_Result) EnvelopeType ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Result) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Reply for this struct.
func (*ServiceGenerator_Generate_Result) Equals ¶ added in v1.2.0
func (v *ServiceGenerator_Generate_Result) Equals(rhs *ServiceGenerator_Generate_Result) bool
Equals returns true if all the fields of this ServiceGenerator_Generate_Result match the provided ServiceGenerator_Generate_Result.
This function performs a deep comparison.
func (*ServiceGenerator_Generate_Result) FromWire ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Result) FromWire(w wire.Value) error
FromWire deserializes a ServiceGenerator_Generate_Result struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a ServiceGenerator_Generate_Result struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v ServiceGenerator_Generate_Result if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*ServiceGenerator_Generate_Result) GetSuccess ¶ added in v1.13.0
func (v *ServiceGenerator_Generate_Result) GetSuccess() (o *GenerateServiceResponse)
GetSuccess returns the value of Success if it is set or its zero value if it is unset.
func (*ServiceGenerator_Generate_Result) IsSetSuccess ¶ added in v1.14.0
func (v *ServiceGenerator_Generate_Result) IsSetSuccess() bool
IsSetSuccess returns true if Success is not nil.
func (*ServiceGenerator_Generate_Result) MarshalLogObject ¶ added in v1.13.0
func (v *ServiceGenerator_Generate_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of ServiceGenerator_Generate_Result.
func (*ServiceGenerator_Generate_Result) MethodName ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Result) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the result.
This will always be "generate" for this struct.
func (*ServiceGenerator_Generate_Result) String ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Result) String() string
String returns a readable string representation of a ServiceGenerator_Generate_Result struct.
func (*ServiceGenerator_Generate_Result) ToWire ¶ added in v0.5.0
func (v *ServiceGenerator_Generate_Result) ToWire() (wire.Value, error)
ToWire translates a ServiceGenerator_Generate_Result struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type ServiceID ¶
type ServiceID int32
ServiceID is an arbitrary unique identifier to reference the different services in this request.
func (ServiceID) Equals ¶ added in v1.2.0
Equals returns true if this ServiceID is equal to the provided ServiceID.
func (*ServiceID) FromWire ¶
FromWire deserializes ServiceID from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
type SimpleType ¶
type SimpleType int32
SimpleType is a standalone native Go type.
const ( SimpleTypeBool SimpleType = 1 SimpleTypeByte SimpleType = 2 SimpleTypeInt8 SimpleType = 3 SimpleTypeInt16 SimpleType = 4 SimpleTypeInt32 SimpleType = 5 SimpleTypeInt64 SimpleType = 6 SimpleTypeFloat64 SimpleType = 7 SimpleTypeString SimpleType = 8 SimpleTypeStructEmpty SimpleType = 9 )
func SimpleType_Values ¶ added in v1.3.0
func SimpleType_Values() []SimpleType
SimpleType_Values returns all recognized values of SimpleType.
func (*SimpleType) Decode ¶ added in v1.29.0
func (v *SimpleType) Decode(sr stream.Reader) error
Decode reads off the encoded SimpleType directly off of the wire.
sReader := BinaryStreamer.Reader(reader) var v SimpleType if err := v.Decode(sReader); err != nil { return SimpleType(0), err } return v, nil
func (SimpleType) Encode ¶ added in v1.29.0
func (v SimpleType) Encode(sw stream.Writer) error
Encode encodes SimpleType directly to bytes.
sWriter := BinaryStreamer.Writer(writer) var v SimpleType return v.Encode(sWriter)
func (SimpleType) Equals ¶ added in v1.2.0
func (v SimpleType) Equals(rhs SimpleType) bool
Equals returns true if this SimpleType value matches the provided value.
func (*SimpleType) FromWire ¶
func (v *SimpleType) FromWire(w wire.Value) error
FromWire deserializes SimpleType from its Thrift-level representation.
x, err := binaryProtocol.Decode(reader, wire.TI32) if err != nil { return SimpleType(0), err } var v SimpleType if err := v.FromWire(x); err != nil { return SimpleType(0), err } return v, nil
func (SimpleType) MarshalJSON ¶ added in v0.5.0
func (v SimpleType) MarshalJSON() ([]byte, error)
MarshalJSON serializes SimpleType into JSON.
If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.
This implements json.Marshaler.
func (SimpleType) MarshalLogObject ¶ added in v1.13.0
func (v SimpleType) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of SimpleType. Enums are logged as objects, where the value is logged with key "value", and if this value's name is known, the name is logged with key "name".
func (SimpleType) MarshalText ¶ added in v1.13.0
func (v SimpleType) MarshalText() ([]byte, error)
MarshalText encodes SimpleType to text.
If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.
This implements the TextMarshaler interface.
func (SimpleType) Ptr ¶ added in v1.9.0
func (v SimpleType) Ptr() *SimpleType
Ptr returns a pointer to this enum value.
func (SimpleType) String ¶
func (v SimpleType) String() string
String returns a readable string representation of SimpleType.
func (SimpleType) ToWire ¶
func (v SimpleType) ToWire() (wire.Value, error)
ToWire translates SimpleType into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
Enums are represented as 32-bit integers over the wire.
func (*SimpleType) UnmarshalJSON ¶ added in v0.5.0
func (v *SimpleType) UnmarshalJSON(text []byte) error
UnmarshalJSON attempts to decode SimpleType from its JSON representation.
This implementation supports both, numeric and string inputs. If a string is provided, it must be a known enum name.
This implements json.Unmarshaler.
func (*SimpleType) UnmarshalText ¶ added in v1.3.0
func (v *SimpleType) UnmarshalText(value []byte) error
UnmarshalText tries to decode SimpleType from a byte slice containing its name.
var v SimpleType err := v.UnmarshalText([]byte("BOOL"))
type Type ¶
type Type struct { SimpleType *SimpleType `json:"simpleType,omitempty"` // Slice of a type // // []$sliceType SliceType *Type `json:"sliceType,omitempty"` // Slice of key-value pairs of a pair of types. // // []struct{Key $left, Value $right} KeyValueSliceType *TypePair `json:"keyValueSliceType,omitempty"` // Map of a pair of types. // // map[$left]$right MapType *TypePair `json:"mapType,omitempty"` // Reference to a user-defined type. ReferenceType *TypeReference `json:"referenceType,omitempty"` // Pointer to a type. PointerType *Type `json:"pointerType,omitempty"` }
Type is a reference to a Go type which may be native or user defined.
func (*Type) Decode ¶ added in v1.29.0
Decode deserializes a Type struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Type struct could not be generated from the wire representation.
func (*Type) Encode ¶ added in v1.29.0
Encode serializes a Type struct directly into bytes, without going through an intermediary type.
An error is returned if a Type struct could not be encoded.
func (*Type) Equals ¶ added in v1.2.0
Equals returns true if all the fields of this Type match the provided Type.
This function performs a deep comparison.
func (*Type) FromWire ¶
FromWire deserializes a Type struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a Type struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Type if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Type) GetKeyValueSliceType ¶ added in v1.13.0
GetKeyValueSliceType returns the value of KeyValueSliceType if it is set or its zero value if it is unset.
func (*Type) GetMapType ¶ added in v1.13.0
GetMapType returns the value of MapType if it is set or its zero value if it is unset.
func (*Type) GetPointerType ¶ added in v1.13.0
GetPointerType returns the value of PointerType if it is set or its zero value if it is unset.
func (*Type) GetReferenceType ¶ added in v1.13.0
func (v *Type) GetReferenceType() (o *TypeReference)
GetReferenceType returns the value of ReferenceType if it is set or its zero value if it is unset.
func (*Type) GetSimpleType ¶ added in v1.7.0
func (v *Type) GetSimpleType() (o SimpleType)
GetSimpleType returns the value of SimpleType if it is set or its zero value if it is unset.
func (*Type) GetSliceType ¶ added in v1.13.0
GetSliceType returns the value of SliceType if it is set or its zero value if it is unset.
func (*Type) IsSetKeyValueSliceType ¶ added in v1.14.0
IsSetKeyValueSliceType returns true if KeyValueSliceType is not nil.
func (*Type) IsSetMapType ¶ added in v1.14.0
IsSetMapType returns true if MapType is not nil.
func (*Type) IsSetPointerType ¶ added in v1.14.0
IsSetPointerType returns true if PointerType is not nil.
func (*Type) IsSetReferenceType ¶ added in v1.14.0
IsSetReferenceType returns true if ReferenceType is not nil.
func (*Type) IsSetSimpleType ¶ added in v1.14.0
IsSetSimpleType returns true if SimpleType is not nil.
func (*Type) IsSetSliceType ¶ added in v1.14.0
IsSetSliceType returns true if SliceType is not nil.
func (*Type) MarshalLogObject ¶ added in v1.13.0
func (v *Type) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Type.
func (*Type) ToWire ¶
ToWire translates a Type struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type TypePair ¶
TypePair is a pair of two types.
func (*TypePair) Decode ¶ added in v1.29.0
Decode deserializes a TypePair struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a TypePair struct could not be generated from the wire representation.
func (*TypePair) Encode ¶ added in v1.29.0
Encode serializes a TypePair struct directly into bytes, without going through an intermediary type.
An error is returned if a TypePair struct could not be encoded.
func (*TypePair) Equals ¶ added in v1.2.0
Equals returns true if all the fields of this TypePair match the provided TypePair.
This function performs a deep comparison.
func (*TypePair) FromWire ¶
FromWire deserializes a TypePair struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a TypePair struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v TypePair if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*TypePair) GetLeft ¶ added in v1.13.0
GetLeft returns the value of Left if it is set or its zero value if it is unset.
func (*TypePair) GetRight ¶ added in v1.13.0
GetRight returns the value of Right if it is set or its zero value if it is unset.
func (*TypePair) IsSetRight ¶ added in v1.14.0
IsSetRight returns true if Right is not nil.
func (*TypePair) MarshalLogObject ¶ added in v1.13.0
func (v *TypePair) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of TypePair.
func (*TypePair) ToWire ¶
ToWire translates a TypePair struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }
type TypeReference ¶
type TypeReference struct { Name string `json:"name,required"` // Import path for the package defining this type. ImportPath string `json:"importPath,required"` // Annotations defined on this type. // // Note that these are the Thrift annotations listed after the type // declaration in the Thrift file. // // Given, // // struct User { // 1: required i32 id // 2: required string name // } (key = "id", validate) // // The annotations will be, // // { // "key": "id", // "validate": "", // } Annotations map[string]string `json:"annotations,omitempty"` }
TypeReference is a reference to a user-defined type.
func (*TypeReference) Decode ¶ added in v1.29.0
func (v *TypeReference) Decode(sr stream.Reader) error
Decode deserializes a TypeReference struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a TypeReference struct could not be generated from the wire representation.
func (*TypeReference) Encode ¶ added in v1.29.0
func (v *TypeReference) Encode(sw stream.Writer) error
Encode serializes a TypeReference struct directly into bytes, without going through an intermediary type.
An error is returned if a TypeReference struct could not be encoded.
func (*TypeReference) Equals ¶ added in v1.2.0
func (v *TypeReference) Equals(rhs *TypeReference) bool
Equals returns true if all the fields of this TypeReference match the provided TypeReference.
This function performs a deep comparison.
func (*TypeReference) FromWire ¶
func (v *TypeReference) FromWire(w wire.Value) error
FromWire deserializes a TypeReference struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a TypeReference struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v TypeReference if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*TypeReference) GetAnnotations ¶ added in v1.13.0
func (v *TypeReference) GetAnnotations() (o map[string]string)
GetAnnotations returns the value of Annotations if it is set or its zero value if it is unset.
func (*TypeReference) GetImportPath ¶ added in v1.13.0
func (v *TypeReference) GetImportPath() (o string)
GetImportPath returns the value of ImportPath if it is set or its zero value if it is unset.
func (*TypeReference) GetName ¶ added in v1.13.0
func (v *TypeReference) GetName() (o string)
GetName returns the value of Name if it is set or its zero value if it is unset.
func (*TypeReference) IsSetAnnotations ¶ added in v1.14.0
func (v *TypeReference) IsSetAnnotations() bool
IsSetAnnotations returns true if Annotations is not nil.
func (*TypeReference) MarshalLogObject ¶ added in v1.13.0
func (v *TypeReference) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of TypeReference.
func (*TypeReference) String ¶
func (v *TypeReference) String() string
String returns a readable string representation of a TypeReference struct.
func (*TypeReference) ToWire ¶
func (v *TypeReference) ToWire() (wire.Value, error)
ToWire translates a TypeReference struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }