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
Click to show internal directories.
Click to hide internal directories.