extends

package
v1.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Name_Name_Helper = struct {
	// Args accepts the parameters of name in-order and returns
	// the arguments struct for the function.
	Args func() *Name_Name_Args

	// IsException returns true if the given error can be thrown
	// by name.
	//
	// An error can be thrown by name 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 name
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// name into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by name
	//
	//   value, err := name(args)
	//   result, err := Name_Name_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from name: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(string, error) (*Name_Name_Result, error)

	// UnwrapResponse takes the result struct for name
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if name threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := Name_Name_Helper.UnwrapResponse(result)
	UnwrapResponse func(*Name_Name_Result) (string, error)
}{}

Name_Name_Helper provides functions that aid in handling the parameters and return values of the Name.name function.

View Source
var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "extends",
	Package:  "go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/extends",
	FilePath: "extends.thrift",
	SHA1:     "5dc89427890e0f8f94285fc648815882150591b9",
	Raw:      rawIDL,
}

ThriftModule represents the IDL file used to generate this package.

Functions

This section is empty.

Types

type Name_Name_Args

type Name_Name_Args struct {
}

Name_Name_Args represents the arguments for the Name.name function.

The arguments for name are sent and received over the wire as this struct.

func (*Name_Name_Args) EnvelopeType

func (v *Name_Name_Args) EnvelopeType() wire.EnvelopeType

EnvelopeType returns the kind of value inside this struct.

This will always be Call for this struct.

func (*Name_Name_Args) Equals

func (v *Name_Name_Args) Equals(rhs *Name_Name_Args) bool

Equals returns true if all the fields of this Name_Name_Args match the provided Name_Name_Args.

This function performs a deep comparison.

func (*Name_Name_Args) FromWire

func (v *Name_Name_Args) FromWire(w wire.Value) error

FromWire deserializes a Name_Name_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 Name_Name_Args struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v Name_Name_Args
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*Name_Name_Args) MarshalLogObject

func (v *Name_Name_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Name_Name_Args.

func (*Name_Name_Args) MethodName

func (v *Name_Name_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 "name" for this struct.

func (*Name_Name_Args) String

func (v *Name_Name_Args) String() string

String returns a readable string representation of a Name_Name_Args struct.

func (*Name_Name_Args) ToWire

func (v *Name_Name_Args) ToWire() (wire.Value, error)

ToWire translates a Name_Name_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 Name_Name_Result

type Name_Name_Result struct {
	// Value returned by name after a successful execution.
	Success *string `json:"success,omitempty"`
}

Name_Name_Result represents the result of a Name.name function call.

The result of a name execution is sent and received over the wire as this struct.

Success is set only if the function did not throw an exception.

func (*Name_Name_Result) EnvelopeType

func (v *Name_Name_Result) EnvelopeType() wire.EnvelopeType

EnvelopeType returns the kind of value inside this struct.

This will always be Reply for this struct.

func (*Name_Name_Result) Equals

func (v *Name_Name_Result) Equals(rhs *Name_Name_Result) bool

Equals returns true if all the fields of this Name_Name_Result match the provided Name_Name_Result.

This function performs a deep comparison.

func (*Name_Name_Result) FromWire

func (v *Name_Name_Result) FromWire(w wire.Value) error

FromWire deserializes a Name_Name_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 Name_Name_Result struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v Name_Name_Result
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*Name_Name_Result) GetSuccess

func (v *Name_Name_Result) GetSuccess() (o string)

GetSuccess returns the value of Success if it is set or its zero value if it is unset.

func (*Name_Name_Result) IsSetSuccess added in v1.35.2

func (v *Name_Name_Result) IsSetSuccess() bool

IsSetSuccess returns true if Success is not nil.

func (*Name_Name_Result) MarshalLogObject

func (v *Name_Name_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Name_Name_Result.

func (*Name_Name_Result) MethodName

func (v *Name_Name_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 "name" for this struct.

func (*Name_Name_Result) String

func (v *Name_Name_Result) String() string

String returns a readable string representation of a Name_Name_Result struct.

func (*Name_Name_Result) ToWire

func (v *Name_Name_Result) ToWire() (wire.Value, error)

ToWire translates a Name_Name_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
}

Directories

Path Synopsis
Package barfx provides better integration for Fx for services implementing or calling Bar.
Package barfx provides better integration for Fx for services implementing or calling Bar.
Package foofx provides better integration for Fx for services implementing or calling Foo.
Package foofx provides better integration for Fx for services implementing or calling Foo.
Package namefx provides better integration for Fx for services implementing or calling Name.
Package namefx provides better integration for Fx for services implementing or calling Name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL