weather

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ThriftModule represents the IDL file used to generate this package.

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

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

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

Weather_Check_Helper provides functions that aid in handling the parameters and return values of the Weather.check function.

Functions

This section is empty.

Types

type Weather_Check_Args

type Weather_Check_Args struct {
}

Weather_Check_Args represents the arguments for the Weather.check function.

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

func (*Weather_Check_Args) EnvelopeType

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

EnvelopeType returns the kind of value inside this struct.

This will always be Call for this struct.

func (*Weather_Check_Args) Equals

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

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

This function performs a deep comparison.

func (*Weather_Check_Args) FromWire

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

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

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

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

func (*Weather_Check_Args) MethodName

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

func (*Weather_Check_Args) String

func (v *Weather_Check_Args) String() string

String returns a readable string representation of a Weather_Check_Args struct.

func (*Weather_Check_Args) ToWire

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

ToWire translates a Weather_Check_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 Weather_Check_Result

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

Weather_Check_Result represents the result of a Weather.check function call.

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

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

func (*Weather_Check_Result) EnvelopeType

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

EnvelopeType returns the kind of value inside this struct.

This will always be Reply for this struct.

func (*Weather_Check_Result) Equals

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

This function performs a deep comparison.

func (*Weather_Check_Result) FromWire

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

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

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

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

func (*Weather_Check_Result) GetSuccess

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

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

func (*Weather_Check_Result) MethodName

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

func (*Weather_Check_Result) String

func (v *Weather_Check_Result) String() string

String returns a readable string representation of a Weather_Check_Result struct.

func (*Weather_Check_Result) ToWire

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

ToWire translates a Weather_Check_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 weatherfx provides better integration for Fx for services implementing or calling Weather.
Package weatherfx provides better integration for Fx for services implementing or calling Weather.

Jump to

Keyboard shortcuts

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