Back to godoc.org

Package sink

v1.42.1
Latest Go to latest
Published: Dec 2, 2019 | License: MIT | Module: go.uber.org/yarpc

Index

Package Files

Variables

var Hello_Sink_Helper = struct {
	// Args accepts the parameters of sink in-order and returns
	// the arguments struct for the function.
	Args func(
		snk *SinkRequest,
	) *Hello_Sink_Args
}{}

Hello_Sink_Helper provides functions that aid in handling the parameters and return values of the Hello.sink function.

var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "sink",
	Package:  "go.uber.org/yarpc/internal/examples/thrift-oneway/sink",
	FilePath: "sink.thrift",
	SHA1:     "f723dc578c8ae4251c75f873a5a24b6c1a9df61f",
	Raw:      rawIDL,
}

ThriftModule represents the IDL file used to generate this package.

type Hello_Sink_Args

type Hello_Sink_Args struct {
	Snk *SinkRequest `json:"snk,omitempty"`
}

Hello_Sink_Args represents the arguments for the Hello.sink function.

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

func (*Hello_Sink_Args) EnvelopeType

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

EnvelopeType returns the kind of value inside this struct.

This will always be OneWay for this struct.

func (*Hello_Sink_Args) Equals

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

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

This function performs a deep comparison.

func (*Hello_Sink_Args) FromWire

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

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

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

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

func (*Hello_Sink_Args) GetSnk

func (v *Hello_Sink_Args) GetSnk() (o *SinkRequest)

GetSnk returns the value of Snk if it is set or its zero value if it is unset.

func (*Hello_Sink_Args) IsSetSnk

func (v *Hello_Sink_Args) IsSetSnk() bool

IsSetSnk returns true if Snk is not nil.

func (*Hello_Sink_Args) MarshalLogObject

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

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

func (*Hello_Sink_Args) MethodName

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

func (*Hello_Sink_Args) String

func (v *Hello_Sink_Args) String() string

String returns a readable string representation of a Hello_Sink_Args struct.

func (*Hello_Sink_Args) ToWire

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

ToWire translates a Hello_Sink_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 SinkRequest

type SinkRequest struct {
	Message string `json:"message,required"`
}

func (*SinkRequest) Equals

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

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

This function performs a deep comparison.

func (*SinkRequest) FromWire

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

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

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

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

func (*SinkRequest) GetMessage

func (v *SinkRequest) GetMessage() (o string)

GetMessage returns the value of Message if it is set or its zero value if it is unset.

func (*SinkRequest) MarshalLogObject

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

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

func (*SinkRequest) String

func (v *SinkRequest) String() string

String returns a readable string representation of a SinkRequest struct.

func (*SinkRequest) ToWire

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

ToWire translates a SinkRequest 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
}
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier