person

package
v0.0.0-...-f56171f Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Example
input := []byte{
	// age
	0, 21,
	// siblings
	0, 3,
	// len of name +1
	5,
	// name
	'J', 'a', 'n', 'e',
}
view, err := person.NewPersonV2View(input)
if err != nil {
	log.Fatal(err)
}
fields, err := view.Fields()
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%q is %d years old.\n", fields.Name(), view.Age())
Output:

"Jane" is 21 years old.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PersonV2Maker

type PersonV2Maker struct {
	// contains filtered or unexported fields
}

func NewPersonV2Maker

func NewPersonV2Maker() *PersonV2Maker

func (*PersonV2Maker) Bytes

func (m *PersonV2Maker) Bytes() []byte

func (*PersonV2Maker) SetAge

func (m *PersonV2Maker) SetAge(v uint16)

func (*PersonV2Maker) SetName

func (m *PersonV2Maker) SetName(v string)

func (*PersonV2Maker) SetSiblings

func (m *PersonV2Maker) SetSiblings(v uint16)

type PersonV2View

type PersonV2View struct {
	// contains filtered or unexported fields
}

func NewPersonV2View

func NewPersonV2View(data []byte) (*PersonV2View, error)

func (*PersonV2View) Age

func (v *PersonV2View) Age() uint16

func (*PersonV2View) Fields

func (v *PersonV2View) Fields() (*PersonV2ViewFields, error)

func (*PersonV2View) Siblings

func (v *PersonV2View) Siblings() uint16

type PersonV2ViewFields

type PersonV2ViewFields struct {
	// contains filtered or unexported fields
}

func (*PersonV2ViewFields) Name

func (f *PersonV2ViewFields) Name() string

Jump to

Keyboard shortcuts

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