Back to godoc.org
go.uber.org/thriftrw / gen / internal / tests / hyphenated-file

Package hyphenated_file

v1.24.0
Latest Go to latest
Published: Jun 24, 2020 | License: MIT | Module: go.uber.org/thriftrw

Index

Package Files

Variables

var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "hyphenated-file",
	Package:  "go.uber.org/thriftrw/gen/internal/tests/hyphenated-file",
	FilePath: "hyphenated-file.thrift",
	SHA1:     "8513913ac76a3ba1c6b2b3b6fb241462e162c446",
	Includes: []*thriftreflect.ThriftModule{
		non_hyphenated.ThriftModule,
	},
	Raw: rawIDL,
}

ThriftModule represents the IDL file used to generate this package.

type DocumentStruct

type DocumentStruct struct {
	Second *non_hyphenated.Second `json:"second,required"`
}

func (*DocumentStruct) Equals

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

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

This function performs a deep comparison.

func (*DocumentStruct) FromWire

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

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

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

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

func (*DocumentStruct) GetSecond

func (v *DocumentStruct) GetSecond() (o *non_hyphenated.Second)

GetSecond returns the value of Second if it is set or its zero value if it is unset.

func (*DocumentStruct) IsSetSecond

func (v *DocumentStruct) IsSetSecond() bool

IsSetSecond returns true if Second is not nil.

func (*DocumentStruct) MarshalLogObject

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

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

func (*DocumentStruct) String

func (v *DocumentStruct) String() string

String returns a readable string representation of a DocumentStruct struct.

func (*DocumentStruct) ToWire

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

ToWire translates a DocumentStruct 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