withexceptions

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

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

WithExceptions_Func1_Helper provides functions that aid in handling the parameters and return values of the WithExceptions.Func1 function.

Functions

This section is empty.

Types

type EndpointExceptionType1

type EndpointExceptionType1 struct {
	Message1 string `json:"message1,required"`
}

func (*EndpointExceptionType1) Equals

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

This function performs a deep comparison.

func (*EndpointExceptionType1) Error

func (v *EndpointExceptionType1) Error() string

func (*EndpointExceptionType1) FromWire

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

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

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

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

func (*EndpointExceptionType1) GetMessage1

func (v *EndpointExceptionType1) GetMessage1() (o string)

GetMessage1 returns the value of Message1 if it is set or its zero value if it is unset.

func (EndpointExceptionType1) MarshalEasyJSON

func (v EndpointExceptionType1) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EndpointExceptionType1) MarshalJSON

func (v EndpointExceptionType1) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EndpointExceptionType1) MarshalLogObject

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

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

func (*EndpointExceptionType1) String

func (v *EndpointExceptionType1) String() string

String returns a readable string representation of a EndpointExceptionType1 struct.

func (*EndpointExceptionType1) ToWire

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

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

func (*EndpointExceptionType1) UnmarshalEasyJSON

func (v *EndpointExceptionType1) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EndpointExceptionType1) UnmarshalJSON

func (v *EndpointExceptionType1) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EndpointExceptionType2

type EndpointExceptionType2 struct {
	Message2 string `json:"message2,required"`
}

func (*EndpointExceptionType2) Equals

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

This function performs a deep comparison.

func (*EndpointExceptionType2) Error

func (v *EndpointExceptionType2) Error() string

func (*EndpointExceptionType2) FromWire

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

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

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

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

func (*EndpointExceptionType2) GetMessage2

func (v *EndpointExceptionType2) GetMessage2() (o string)

GetMessage2 returns the value of Message2 if it is set or its zero value if it is unset.

func (EndpointExceptionType2) MarshalEasyJSON

func (v EndpointExceptionType2) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EndpointExceptionType2) MarshalJSON

func (v EndpointExceptionType2) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EndpointExceptionType2) MarshalLogObject

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

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

func (*EndpointExceptionType2) String

func (v *EndpointExceptionType2) String() string

String returns a readable string representation of a EndpointExceptionType2 struct.

func (*EndpointExceptionType2) ToWire

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

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

func (*EndpointExceptionType2) UnmarshalEasyJSON

func (v *EndpointExceptionType2) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EndpointExceptionType2) UnmarshalJSON

func (v *EndpointExceptionType2) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Response

type Response struct {
}

func (*Response) Equals

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

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

This function performs a deep comparison.

func (*Response) FromWire

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

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

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

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

func (Response) MarshalEasyJSON

func (v Response) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Response) MarshalJSON

func (v Response) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Response) MarshalLogObject

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

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

func (*Response) String

func (v *Response) String() string

String returns a readable string representation of a Response struct.

func (*Response) ToWire

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

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

func (*Response) UnmarshalEasyJSON

func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Response) UnmarshalJSON

func (v *Response) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type WithExceptions_Func1_Args

type WithExceptions_Func1_Args struct {
}

WithExceptions_Func1_Args represents the arguments for the WithExceptions.Func1 function.

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

func (*WithExceptions_Func1_Args) EnvelopeType

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

EnvelopeType returns the kind of value inside this struct.

This will always be Call for this struct.

func (*WithExceptions_Func1_Args) Equals

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

This function performs a deep comparison.

func (*WithExceptions_Func1_Args) FromWire

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

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

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

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

func (WithExceptions_Func1_Args) MarshalEasyJSON

func (v WithExceptions_Func1_Args) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (WithExceptions_Func1_Args) MarshalJSON

func (v WithExceptions_Func1_Args) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*WithExceptions_Func1_Args) MarshalLogObject

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

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

func (*WithExceptions_Func1_Args) MethodName

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

func (*WithExceptions_Func1_Args) String

func (v *WithExceptions_Func1_Args) String() string

String returns a readable string representation of a WithExceptions_Func1_Args struct.

func (*WithExceptions_Func1_Args) ToWire

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

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

func (*WithExceptions_Func1_Args) UnmarshalEasyJSON

func (v *WithExceptions_Func1_Args) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*WithExceptions_Func1_Args) UnmarshalJSON

func (v *WithExceptions_Func1_Args) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type WithExceptions_Func1_Result

type WithExceptions_Func1_Result struct {
	// Value returned by Func1 after a successful execution.
	Success *Response               `json:"success,omitempty"`
	E1      *EndpointExceptionType1 `json:"e1,omitempty"`
	E2      *EndpointExceptionType2 `json:"e2,omitempty"`
}

WithExceptions_Func1_Result represents the result of a WithExceptions.Func1 function call.

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

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

func (*WithExceptions_Func1_Result) EnvelopeType

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

EnvelopeType returns the kind of value inside this struct.

This will always be Reply for this struct.

func (*WithExceptions_Func1_Result) Equals

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

This function performs a deep comparison.

func (*WithExceptions_Func1_Result) FromWire

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

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

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

func (*WithExceptions_Func1_Result) GetE1

GetE1 returns the value of E1 if it is set or its zero value if it is unset.

func (*WithExceptions_Func1_Result) GetE2

GetE2 returns the value of E2 if it is set or its zero value if it is unset.

func (*WithExceptions_Func1_Result) GetSuccess

func (v *WithExceptions_Func1_Result) GetSuccess() (o *Response)

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

func (*WithExceptions_Func1_Result) IsSetE1

func (v *WithExceptions_Func1_Result) IsSetE1() bool

IsSetE1 returns true if E1 is not nil.

func (*WithExceptions_Func1_Result) IsSetE2

func (v *WithExceptions_Func1_Result) IsSetE2() bool

IsSetE2 returns true if E2 is not nil.

func (*WithExceptions_Func1_Result) IsSetSuccess

func (v *WithExceptions_Func1_Result) IsSetSuccess() bool

IsSetSuccess returns true if Success is not nil.

func (WithExceptions_Func1_Result) MarshalEasyJSON

func (v WithExceptions_Func1_Result) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (WithExceptions_Func1_Result) MarshalJSON

func (v WithExceptions_Func1_Result) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*WithExceptions_Func1_Result) MarshalLogObject

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

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

func (*WithExceptions_Func1_Result) MethodName

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

func (*WithExceptions_Func1_Result) String

func (v *WithExceptions_Func1_Result) String() string

String returns a readable string representation of a WithExceptions_Func1_Result struct.

func (*WithExceptions_Func1_Result) ToWire

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

func (*WithExceptions_Func1_Result) UnmarshalEasyJSON

func (v *WithExceptions_Func1_Result) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*WithExceptions_Func1_Result) UnmarshalJSON

func (v *WithExceptions_Func1_Result) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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