fieldpath

package
v0.0.0-...-bc946d0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

This packages is used to create compiled fieldpaths for selective unmarshaling.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collapse

func Collapse(rootPkg string, rootMsg string, path string, descriptorSet *descriptor.FileDescriptorSet) (string, error)

Collapses a proto fieldpath into a go fieldpath. They are different if some of the fields in the fieldpath have been embedded.

func DecBool

func DecBool(buf []byte, offset int, handler BoolHandler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecBytes

func DecBytes(buf []byte, offset int, handler BytesHandler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecFixed32

func DecFixed32(buf []byte, offset int, handler Uint32Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecFixed64

func DecFixed64(buf []byte, offset int, handler Uint64Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecFloat32

func DecFloat32(buf []byte, offset int, handler Float32Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecFloat64

func DecFloat64(buf []byte, offset int, handler Float64Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecInt32

func DecInt32(buf []byte, offset int, handler Int32Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecInt64

func DecInt64(buf []byte, offset int, handler Int64Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecPackedBool

func DecPackedBool(buf []byte, offset int, handler BoolHandler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedBytes

func DecPackedBytes(buf []byte, offset int, handler BytesHandler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedFixed32

func DecPackedFixed32(buf []byte, offset int, handler Uint32Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedFixed64

func DecPackedFixed64(buf []byte, offset int, handler Uint64Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedFloat32

func DecPackedFloat32(buf []byte, offset int, handler Float32Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedFloat64

func DecPackedFloat64(buf []byte, offset int, handler Float64Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedInt32

func DecPackedInt32(buf []byte, offset int, handler Int32Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedInt64

func DecPackedInt64(buf []byte, offset int, handler Int64Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedSfixed32

func DecPackedSfixed32(buf []byte, offset int, handler Int32Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedSfixed64

func DecPackedSfixed64(buf []byte, offset int, handler Int64Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedSint32

func DecPackedSint32(buf []byte, offset int, handler Int32Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedSint64

func DecPackedSint64(buf []byte, offset int, handler Int64Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedString

func DecPackedString(buf []byte, offset int, handler StringHandler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedUint32

func DecPackedUint32(buf []byte, offset int, handler Uint32Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecPackedUint64

func DecPackedUint64(buf []byte, offset int, handler Uint64Handler) (int, error)

Decodes a repeated packed field and sends the elements one by one to the handler. The buffer, from the offset, should start with the varint encoded length followed by the list of encoded values. The number of bytes consumed after the offset is returned from this function.

func DecSfixed32

func DecSfixed32(buf []byte, offset int, handler Int32Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecSfixed64

func DecSfixed64(buf []byte, offset int, handler Int64Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecSint32

func DecSint32(buf []byte, offset int, handler Int32Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecSint64

func DecSint64(buf []byte, offset int, handler Int64Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecString

func DecString(buf []byte, offset int, handler StringHandler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecUint32

func DecUint32(buf []byte, offset int, handler Uint32Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func DecUint64

func DecUint64(buf []byte, offset int, handler Uint64Handler) (int, error)

Decodes a protocol buffer encoded value and sends the value to the handler. The number of bytes consumed after the offset is returned from this function.

func Expand

func Expand(rootPkg string, rootMsg string, path string, descriptorSet *descriptor.FileDescriptorSet) (string, error)

Expands a fieldpath as defined in go with possible implications for embedded structs to a normal proto fieldpath.

func NoMerge

func NoMerge(buf []byte, descriptorSet *descriptor.FileDescriptorSet, rootPkg string, rootMsg string) error

The NoMerge function checks that the marshaled protocol buffer does not require any merging when unmarshaling. When this property holds, streaming processing is possible.

See below quotes from the protocol buffer documentation that describes how merging should work.

https://developers.google.com/protocol-buffers/docs/encoding#optional

Normally, an encoded message would never have more than one instance of an optional or required field. However, parsers are expected to handle the case in which they do. For numeric types and strings, if the same value appears multiple times, the parser accepts the last value it sees. For embedded message fields, the parser merges multiple instances of the same field, as if with the Message::MergeFrom method – that is, all singular scalar fields in the latter instance replace those in the former, singular embedded messages are merged, and repeated fields are concatenated. The effect of these rules is that parsing the concatenation of two encoded messages produces exactly the same result as if you had parsed the two messages separately and merged the resulting objects. That is, this:

MyMessage message; message.ParseFromString(str1 + str2);

is equivalent to this:

MyMessage message, message2; message.ParseFromString(str1); message2.ParseFromString(str2); message.MergeFrom(message2);

This property is occasionally useful, as it allows you to merge two messages even if you do not know their types.

https://developers.google.com/protocol-buffers/docs/encoding#order

However, protocol buffer parsers must be able to parse fields in any order, as not all messages are created by simply serializing an object – for instance, it's sometimes useful to merge two messages by simply concatenating them.

func TestDefault

func TestDefault(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) def

only for testing

func TestNew

func TestNew(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) ([]uint64, *descriptor.FieldDescriptorProto, error)

only for testing

func ToMessages

func ToMessages(path string, fileDescriptorSet *descriptor.FileDescriptorSet) ([]string, error)

func ToString

func ToString(rootPkg string, rootMsg string, desc *descriptor.FileDescriptorSet, fpath string, buf []byte, tabs int, writer io.Writer) error

Converts a marshalled protocol buffer to string. It does this pretty effienctly by not combining slices. It rather prints every element of the slice seperately. This is typically used for debugging.

Types

type BoolHandler

type BoolHandler interface {
	Bool(bool)
}

type BoolPath

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

Contains the ordered list of keys, compiled path.

func NewBoolPath

func NewBoolPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*BoolPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*BoolPath) GetDefault

func (this *BoolPath) GetDefault() *bool

Returns this default value of the field

func (*BoolPath) GetPath

func (this *BoolPath) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type BytesHandler

type BytesHandler interface {
	Bytes([]byte)
}

type BytesPath

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

Contains the ordered list of keys, compiled path.

func NewBytesPath

func NewBytesPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*BytesPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*BytesPath) GetDefault

func (this *BytesPath) GetDefault() []byte

Returns this default value of the field

func (*BytesPath) GetPath

func (this *BytesPath) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type BytesSinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewBytesSinglePath

func NewBytesSinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*BytesSinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*BytesSinglePath) GetDefault

func (this *BytesSinglePath) GetDefault() []byte

Returns this default value of the field

func (*BytesSinglePath) GetPath

func (this *BytesSinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*BytesSinglePath) Unmarshal

func (this *BytesSinglePath) Unmarshal(buf []byte) ([]byte, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*BytesSinglePath) UnmarshalFirst

func (this *BytesSinglePath) UnmarshalFirst(buf []byte) ([]byte, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type BytesSorter

type BytesSorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Bytes field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewBytesSorter

func NewBytesSorter(list Sort, path *BytesSinglePath) *BytesSorter

func (*BytesSorter) Less

func (this *BytesSorter) Less(i, j int) bool

func (*BytesSorter) Swap

func (this *BytesSorter) Swap(i, j int)

type Compiled

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

One or more Unmarshalers compiled for single traversal of an input buffer.

func Compile

func Compile(unmarshalers ...*Unmarshaler) *Compiled

Compiles a list of Unmarshalers into a object which can traverse an input buffer once and unmarshal all the selected parts.

Example
// Extensions for Protocol Buffers to create more go like structures.
//
// Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package main

import (
	"fmt"
	"github.com/gogo/protobuf/fieldpath"
	"github.com/gogo/protobuf/proto"
	"github.com/gogo/protobuf/test"
)

type handler64 struct {
}

func (this *handler64) Int64(v int64) {
	fmt.Printf("%d\n", v)
}

type handler32 struct {
}

func (this *handler32) Int32(v int32) {
	fmt.Printf("%d\n", v)
}

func main() {
	a := &test.NinOptNative{
		Field4: proto.Int64(1234),
		Field7: proto.Int32(123),
	}
	fp1, err := fieldpath.NewInt64Path("test", "NinOptNative", test.ThetestDescription(), "Field4")
	if err != nil {
		panic(err)
	}
	fp2, err := fieldpath.NewSint32Path("test", "NinOptNative", test.ThetestDescription(), "Field7")
	if err != nil {
		panic(err)
	}
	buf, err := proto.Marshal(a)
	if err != nil {
		panic(err)
	}
	u1 := fieldpath.NewInt64Unmarshaler(fp1, &handler64{})
	u2 := fieldpath.NewSint32Unmarshaler(fp2, &handler32{})
	c := fieldpath.Compile(u1, u2)
	err = c.Unmarshal(buf)
	if err != nil {
		panic(err)
	}
}
Output:

1234
123

func (*Compiled) Unmarshal

func (this *Compiled) Unmarshal(buf []byte) error

Unmarshals all the slected parts with a single traversal of the input buffer.

type Fixed32Path

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

Contains the ordered list of keys, compiled path.

func NewFixed32Path

func NewFixed32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Fixed32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Fixed32Path) GetDefault

func (this *Fixed32Path) GetDefault() *uint32

Returns this default value of the field

func (*Fixed32Path) GetPath

func (this *Fixed32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Fixed32SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewFixed32SinglePath

func NewFixed32SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Fixed32SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Fixed32SinglePath) GetDefault

func (this *Fixed32SinglePath) GetDefault() *uint32

Returns this default value of the field

func (*Fixed32SinglePath) GetPath

func (this *Fixed32SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Fixed32SinglePath) Unmarshal

func (this *Fixed32SinglePath) Unmarshal(buf []byte) (*uint32, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Fixed32SinglePath) UnmarshalFirst

func (this *Fixed32SinglePath) UnmarshalFirst(buf []byte) (*uint32, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Fixed32Sorter

type Fixed32Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Fixed32 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewFixed32Sorter

func NewFixed32Sorter(list Sort, path *Fixed32SinglePath) *Fixed32Sorter

func (*Fixed32Sorter) Less

func (this *Fixed32Sorter) Less(i, j int) bool

func (*Fixed32Sorter) Swap

func (this *Fixed32Sorter) Swap(i, j int)

type Fixed64Path

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

Contains the ordered list of keys, compiled path.

func NewFixed64Path

func NewFixed64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Fixed64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Fixed64Path) GetDefault

func (this *Fixed64Path) GetDefault() *uint64

Returns this default value of the field

func (*Fixed64Path) GetPath

func (this *Fixed64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Fixed64SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewFixed64SinglePath

func NewFixed64SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Fixed64SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Fixed64SinglePath) GetDefault

func (this *Fixed64SinglePath) GetDefault() *uint64

Returns this default value of the field

func (*Fixed64SinglePath) GetPath

func (this *Fixed64SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Fixed64SinglePath) Unmarshal

func (this *Fixed64SinglePath) Unmarshal(buf []byte) (*uint64, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Fixed64SinglePath) UnmarshalFirst

func (this *Fixed64SinglePath) UnmarshalFirst(buf []byte) (*uint64, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Fixed64Sorter

type Fixed64Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Fixed64 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewFixed64Sorter

func NewFixed64Sorter(list Sort, path *Fixed64SinglePath) *Fixed64Sorter

func (*Fixed64Sorter) Less

func (this *Fixed64Sorter) Less(i, j int) bool

func (*Fixed64Sorter) Swap

func (this *Fixed64Sorter) Swap(i, j int)

type Float32Handler

type Float32Handler interface {
	Float32(float32)
}

type Float32Path

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

Contains the ordered list of keys, compiled path.

func NewFloat32Path

func NewFloat32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Float32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Float32Path) GetDefault

func (this *Float32Path) GetDefault() *float32

Returns this default value of the field

func (*Float32Path) GetPath

func (this *Float32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Float32SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewFloat32SinglePath

func NewFloat32SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Float32SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Float32SinglePath) GetDefault

func (this *Float32SinglePath) GetDefault() *float32

Returns this default value of the field

func (*Float32SinglePath) GetPath

func (this *Float32SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Float32SinglePath) Unmarshal

func (this *Float32SinglePath) Unmarshal(buf []byte) (*float32, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Float32SinglePath) UnmarshalFirst

func (this *Float32SinglePath) UnmarshalFirst(buf []byte) (*float32, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Float32Sorter

type Float32Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Float32 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewFloat32Sorter

func NewFloat32Sorter(list Sort, path *Float32SinglePath) *Float32Sorter

func (*Float32Sorter) Less

func (this *Float32Sorter) Less(i, j int) bool

func (*Float32Sorter) Swap

func (this *Float32Sorter) Swap(i, j int)

type Float64Handler

type Float64Handler interface {
	Float64(float64)
}

type Float64Path

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

Contains the ordered list of keys, compiled path.

func NewFloat64Path

func NewFloat64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Float64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Float64Path) GetDefault

func (this *Float64Path) GetDefault() *float64

Returns this default value of the field

func (*Float64Path) GetPath

func (this *Float64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Float64SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewFloat64SinglePath

func NewFloat64SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Float64SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Float64SinglePath) GetDefault

func (this *Float64SinglePath) GetDefault() *float64

Returns this default value of the field

func (*Float64SinglePath) GetPath

func (this *Float64SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Float64SinglePath) Unmarshal

func (this *Float64SinglePath) Unmarshal(buf []byte) (*float64, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Float64SinglePath) UnmarshalFirst

func (this *Float64SinglePath) UnmarshalFirst(buf []byte) (*float64, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Float64Sorter

type Float64Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Float64 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewFloat64Sorter

func NewFloat64Sorter(list Sort, path *Float64SinglePath) *Float64Sorter

func (*Float64Sorter) Less

func (this *Float64Sorter) Less(i, j int) bool

func (*Float64Sorter) Swap

func (this *Float64Sorter) Swap(i, j int)

type GenericPath

type GenericPath interface {
	//Combines a path with the handler to create an Unmarshaler.
	NewUnmarshaler(h handler) *Unmarshaler
	//Returns whether the Field Type is a message.
	IsMessage() bool
}

func NewGenericPath

func NewGenericPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (GenericPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This is strictly less type safe than using a New<T>Path, but sometimes it cannot be helped, use New<T>Path when it can.

type Int32Handler

type Int32Handler interface {
	Int32(int32)
}

type Int32Path

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

Contains the ordered list of keys, compiled path.

func NewInt32Path

func NewInt32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Int32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Int32Path) GetDefault

func (this *Int32Path) GetDefault() *int32

Returns this default value of the field

func (*Int32Path) GetPath

func (this *Int32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Int32SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewInt32SinglePath

func NewInt32SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Int32SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Int32SinglePath) GetDefault

func (this *Int32SinglePath) GetDefault() *int32

Returns this default value of the field

func (*Int32SinglePath) GetPath

func (this *Int32SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Int32SinglePath) Unmarshal

func (this *Int32SinglePath) Unmarshal(buf []byte) (*int32, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Int32SinglePath) UnmarshalFirst

func (this *Int32SinglePath) UnmarshalFirst(buf []byte) (*int32, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Int32Sorter

type Int32Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Int32 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewInt32Sorter

func NewInt32Sorter(list Sort, path *Int32SinglePath) *Int32Sorter

func (*Int32Sorter) Less

func (this *Int32Sorter) Less(i, j int) bool

func (*Int32Sorter) Swap

func (this *Int32Sorter) Swap(i, j int)

type Int64Handler

type Int64Handler interface {
	Int64(int64)
}

type Int64Path

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

Contains the ordered list of keys, compiled path.

func NewInt64Path

func NewInt64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Int64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Int64Path) GetDefault

func (this *Int64Path) GetDefault() *int64

Returns this default value of the field

func (*Int64Path) GetPath

func (this *Int64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Int64SinglePath

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

Contains an ordered key list, compiled path, for a single value.

Example
package main

import (
	"fmt"
	"github.com/gogo/protobuf/fieldpath"
	"github.com/gogo/protobuf/proto"
	"github.com/gogo/protobuf/test"
)

func main() {
	a := &test.NinOptNative{
		Field4: proto.Int64(1234),
	}
	fp, err := fieldpath.NewInt64SinglePath("test", "NinOptNative", test.ThetestDescription(), "Field4")
	if err != nil {
		panic(err)
	}
	buf, err := proto.Marshal(a)
	if err != nil {
		panic(err)
	}
	unmarshalled, err := fp.Unmarshal(buf)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%v\n", *unmarshalled)
}
Output:

1234

func NewInt64SinglePath

func NewInt64SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Int64SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Int64SinglePath) GetDefault

func (this *Int64SinglePath) GetDefault() *int64

Returns this default value of the field

func (*Int64SinglePath) GetPath

func (this *Int64SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Int64SinglePath) Unmarshal

func (this *Int64SinglePath) Unmarshal(buf []byte) (*int64, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Int64SinglePath) UnmarshalFirst

func (this *Int64SinglePath) UnmarshalFirst(buf []byte) (*int64, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Int64Sorter

type Int64Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Int64 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewInt64Sorter

func NewInt64Sorter(list Sort, path *Int64SinglePath) *Int64Sorter

func (*Int64Sorter) Less

func (this *Int64Sorter) Less(i, j int) bool

func (*Int64Sorter) Swap

func (this *Int64Sorter) Swap(i, j int)

type PackedBoolPath

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

Contains the ordered list of keys, compiled path.

func NewPackedBoolPath

func NewPackedBoolPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedBoolPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedBoolPath) GetDefault

func (this *PackedBoolPath) GetDefault() *bool

Returns this default value of the field

func (*PackedBoolPath) GetPath

func (this *PackedBoolPath) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedBytesPath

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

Contains the ordered list of keys, compiled path.

func NewPackedBytesPath

func NewPackedBytesPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedBytesPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedBytesPath) GetDefault

func (this *PackedBytesPath) GetDefault() []byte

Returns this default value of the field

func (*PackedBytesPath) GetPath

func (this *PackedBytesPath) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedFixed32Path

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

Contains the ordered list of keys, compiled path.

func NewPackedFixed32Path

func NewPackedFixed32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedFixed32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedFixed32Path) GetDefault

func (this *PackedFixed32Path) GetDefault() *uint32

Returns this default value of the field

func (*PackedFixed32Path) GetPath

func (this *PackedFixed32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedFixed64Path

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

Contains the ordered list of keys, compiled path.

func NewPackedFixed64Path

func NewPackedFixed64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedFixed64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedFixed64Path) GetDefault

func (this *PackedFixed64Path) GetDefault() *uint64

Returns this default value of the field

func (*PackedFixed64Path) GetPath

func (this *PackedFixed64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedFloat32Path

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

Contains the ordered list of keys, compiled path.

func NewPackedFloat32Path

func NewPackedFloat32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedFloat32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedFloat32Path) GetDefault

func (this *PackedFloat32Path) GetDefault() *float32

Returns this default value of the field

func (*PackedFloat32Path) GetPath

func (this *PackedFloat32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedFloat64Path

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

Contains the ordered list of keys, compiled path.

func NewPackedFloat64Path

func NewPackedFloat64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedFloat64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedFloat64Path) GetDefault

func (this *PackedFloat64Path) GetDefault() *float64

Returns this default value of the field

func (*PackedFloat64Path) GetPath

func (this *PackedFloat64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedInt32Path

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

Contains the ordered list of keys, compiled path.

func NewPackedInt32Path

func NewPackedInt32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedInt32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedInt32Path) GetDefault

func (this *PackedInt32Path) GetDefault() *int32

Returns this default value of the field

func (*PackedInt32Path) GetPath

func (this *PackedInt32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedInt64Path

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

Contains the ordered list of keys, compiled path.

func NewPackedInt64Path

func NewPackedInt64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedInt64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedInt64Path) GetDefault

func (this *PackedInt64Path) GetDefault() *int64

Returns this default value of the field

func (*PackedInt64Path) GetPath

func (this *PackedInt64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedSfixed32Path

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

Contains the ordered list of keys, compiled path.

func NewPackedSfixed32Path

func NewPackedSfixed32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedSfixed32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedSfixed32Path) GetDefault

func (this *PackedSfixed32Path) GetDefault() *int32

Returns this default value of the field

func (*PackedSfixed32Path) GetPath

func (this *PackedSfixed32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedSfixed64Path

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

Contains the ordered list of keys, compiled path.

func NewPackedSfixed64Path

func NewPackedSfixed64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedSfixed64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedSfixed64Path) GetDefault

func (this *PackedSfixed64Path) GetDefault() *int64

Returns this default value of the field

func (*PackedSfixed64Path) GetPath

func (this *PackedSfixed64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedSint32Path

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

Contains the ordered list of keys, compiled path.

func NewPackedSint32Path

func NewPackedSint32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedSint32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedSint32Path) GetDefault

func (this *PackedSint32Path) GetDefault() *int32

Returns this default value of the field

func (*PackedSint32Path) GetPath

func (this *PackedSint32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedSint64Path

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

Contains the ordered list of keys, compiled path.

func NewPackedSint64Path

func NewPackedSint64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedSint64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedSint64Path) GetDefault

func (this *PackedSint64Path) GetDefault() *int64

Returns this default value of the field

func (*PackedSint64Path) GetPath

func (this *PackedSint64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedStringPath

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

Contains the ordered list of keys, compiled path.

func NewPackedStringPath

func NewPackedStringPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedStringPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedStringPath) GetDefault

func (this *PackedStringPath) GetDefault() *string

Returns this default value of the field

func (*PackedStringPath) GetPath

func (this *PackedStringPath) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedUint32Path

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

Contains the ordered list of keys, compiled path.

func NewPackedUint32Path

func NewPackedUint32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedUint32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedUint32Path) GetDefault

func (this *PackedUint32Path) GetDefault() *uint32

Returns this default value of the field

func (*PackedUint32Path) GetPath

func (this *PackedUint32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type PackedUint64Path

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

Contains the ordered list of keys, compiled path.

func NewPackedUint64Path

func NewPackedUint64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*PackedUint64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*PackedUint64Path) GetDefault

func (this *PackedUint64Path) GetDefault() *uint64

Returns this default value of the field

func (*PackedUint64Path) GetPath

func (this *PackedUint64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Sfixed32Path

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

Contains the ordered list of keys, compiled path.

func NewSfixed32Path

func NewSfixed32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sfixed32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Sfixed32Path) GetDefault

func (this *Sfixed32Path) GetDefault() *int32

Returns this default value of the field

func (*Sfixed32Path) GetPath

func (this *Sfixed32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Sfixed32SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewSfixed32SinglePath

func NewSfixed32SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sfixed32SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Sfixed32SinglePath) GetDefault

func (this *Sfixed32SinglePath) GetDefault() *int32

Returns this default value of the field

func (*Sfixed32SinglePath) GetPath

func (this *Sfixed32SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Sfixed32SinglePath) Unmarshal

func (this *Sfixed32SinglePath) Unmarshal(buf []byte) (*int32, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Sfixed32SinglePath) UnmarshalFirst

func (this *Sfixed32SinglePath) UnmarshalFirst(buf []byte) (*int32, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Sfixed32Sorter

type Sfixed32Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Sfixed32 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewSfixed32Sorter

func NewSfixed32Sorter(list Sort, path *Sfixed32SinglePath) *Sfixed32Sorter

func (*Sfixed32Sorter) Less

func (this *Sfixed32Sorter) Less(i, j int) bool

func (*Sfixed32Sorter) Swap

func (this *Sfixed32Sorter) Swap(i, j int)

type Sfixed64Path

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

Contains the ordered list of keys, compiled path.

func NewSfixed64Path

func NewSfixed64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sfixed64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Sfixed64Path) GetDefault

func (this *Sfixed64Path) GetDefault() *int64

Returns this default value of the field

func (*Sfixed64Path) GetPath

func (this *Sfixed64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Sfixed64SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewSfixed64SinglePath

func NewSfixed64SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sfixed64SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Sfixed64SinglePath) GetDefault

func (this *Sfixed64SinglePath) GetDefault() *int64

Returns this default value of the field

func (*Sfixed64SinglePath) GetPath

func (this *Sfixed64SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Sfixed64SinglePath) Unmarshal

func (this *Sfixed64SinglePath) Unmarshal(buf []byte) (*int64, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Sfixed64SinglePath) UnmarshalFirst

func (this *Sfixed64SinglePath) UnmarshalFirst(buf []byte) (*int64, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Sfixed64Sorter

type Sfixed64Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Sfixed64 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewSfixed64Sorter

func NewSfixed64Sorter(list Sort, path *Sfixed64SinglePath) *Sfixed64Sorter

func (*Sfixed64Sorter) Less

func (this *Sfixed64Sorter) Less(i, j int) bool

func (*Sfixed64Sorter) Swap

func (this *Sfixed64Sorter) Swap(i, j int)

type Sint32Path

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

Contains the ordered list of keys, compiled path.

func NewSint32Path

func NewSint32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sint32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Sint32Path) GetDefault

func (this *Sint32Path) GetDefault() *int32

Returns this default value of the field

func (*Sint32Path) GetPath

func (this *Sint32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Sint32SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewSint32SinglePath

func NewSint32SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sint32SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Sint32SinglePath) GetDefault

func (this *Sint32SinglePath) GetDefault() *int32

Returns this default value of the field

func (*Sint32SinglePath) GetPath

func (this *Sint32SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Sint32SinglePath) Unmarshal

func (this *Sint32SinglePath) Unmarshal(buf []byte) (*int32, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Sint32SinglePath) UnmarshalFirst

func (this *Sint32SinglePath) UnmarshalFirst(buf []byte) (*int32, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Sint32Sorter

type Sint32Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Sint32 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewSint32Sorter

func NewSint32Sorter(list Sort, path *Sint32SinglePath) *Sint32Sorter

func (*Sint32Sorter) Less

func (this *Sint32Sorter) Less(i, j int) bool

func (*Sint32Sorter) Swap

func (this *Sint32Sorter) Swap(i, j int)

type Sint64Path

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

Contains the ordered list of keys, compiled path.

func NewSint64Path

func NewSint64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sint64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Sint64Path) GetDefault

func (this *Sint64Path) GetDefault() *int64

Returns this default value of the field

func (*Sint64Path) GetPath

func (this *Sint64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Sint64SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewSint64SinglePath

func NewSint64SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Sint64SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Sint64SinglePath) GetDefault

func (this *Sint64SinglePath) GetDefault() *int64

Returns this default value of the field

func (*Sint64SinglePath) GetPath

func (this *Sint64SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Sint64SinglePath) Unmarshal

func (this *Sint64SinglePath) Unmarshal(buf []byte) (*int64, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Sint64SinglePath) UnmarshalFirst

func (this *Sint64SinglePath) UnmarshalFirst(buf []byte) (*int64, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Sint64Sorter

type Sint64Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Sint64 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewSint64Sorter

func NewSint64Sorter(list Sort, path *Sint64SinglePath) *Sint64Sorter

func (*Sint64Sorter) Less

func (this *Sint64Sorter) Less(i, j int) bool

func (*Sint64Sorter) Swap

func (this *Sint64Sorter) Swap(i, j int)

type Sort

type Sort interface {
	//Get returns the marshalled protocol buffer at the specified index in the list.
	Get(index int) []byte
	// Len is the number of elements in the collection.
	Len() int
	// Swap swaps the elements with indexes i and j.
	Swap(i, j int)
}

type StringHandler

type StringHandler interface {
	String(string)
}

type StringPath

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

Contains the ordered list of keys, compiled path.

func NewStringPath

func NewStringPath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*StringPath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*StringPath) GetDefault

func (this *StringPath) GetDefault() *string

Returns this default value of the field

func (*StringPath) GetPath

func (this *StringPath) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type StringSinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewStringSinglePath

func NewStringSinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*StringSinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*StringSinglePath) GetDefault

func (this *StringSinglePath) GetDefault() *string

Returns this default value of the field

func (*StringSinglePath) GetPath

func (this *StringSinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*StringSinglePath) Unmarshal

func (this *StringSinglePath) Unmarshal(buf []byte) (*string, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*StringSinglePath) UnmarshalFirst

func (this *StringSinglePath) UnmarshalFirst(buf []byte) (*string, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type StringSorter

type StringSorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single String field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewStringSorter

func NewStringSorter(list Sort, path *StringSinglePath) *StringSorter

func (*StringSorter) Less

func (this *StringSorter) Less(i, j int) bool

func (*StringSorter) Swap

func (this *StringSorter) Swap(i, j int)

type Uint32Handler

type Uint32Handler interface {
	Uint32(uint32)
}

type Uint32Path

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

Contains the ordered list of keys, compiled path.

func NewUint32Path

func NewUint32Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Uint32Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Uint32Path) GetDefault

func (this *Uint32Path) GetDefault() *uint32

Returns this default value of the field

func (*Uint32Path) GetPath

func (this *Uint32Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Uint32SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewUint32SinglePath

func NewUint32SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Uint32SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Uint32SinglePath) GetDefault

func (this *Uint32SinglePath) GetDefault() *uint32

Returns this default value of the field

func (*Uint32SinglePath) GetPath

func (this *Uint32SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Uint32SinglePath) Unmarshal

func (this *Uint32SinglePath) Unmarshal(buf []byte) (*uint32, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Uint32SinglePath) UnmarshalFirst

func (this *Uint32SinglePath) UnmarshalFirst(buf []byte) (*uint32, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Uint32Sorter

type Uint32Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Uint32 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewUint32Sorter

func NewUint32Sorter(list Sort, path *Uint32SinglePath) *Uint32Sorter

func (*Uint32Sorter) Less

func (this *Uint32Sorter) Less(i, j int) bool

func (*Uint32Sorter) Swap

func (this *Uint32Sorter) Swap(i, j int)

type Uint64Handler

type Uint64Handler interface {
	Uint64(uint64)
}

type Uint64Path

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

Contains the ordered list of keys, compiled path.

func NewUint64Path

func NewUint64Path(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Uint64Path, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later.

func (*Uint64Path) GetDefault

func (this *Uint64Path) GetDefault() *uint64

Returns this default value of the field

func (*Uint64Path) GetPath

func (this *Uint64Path) GetPath() []uint64

Returns the ordered list of keys, compiled path.

type Uint64SinglePath

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

Contains an ordered key list, compiled path, for a single value.

func NewUint64SinglePath

func NewUint64SinglePath(rootPackage string, rootMessage string, descSet *descriptor.FileDescriptorSet, path string) (*Uint64SinglePath, error)

This constructor also checks if the path is valid and the type in the descriptor is matches the called function. This function should preferably be called in the init of a module, since this is not very type safe (stringly typed), this will help in catching these errors sooner rather than later. This function also checks that there are no repeated fields on the path and that there should only be one value on this path. One value, really means zero or more values, where zero occurences means nil, one occurence is trivial and more than one occurence means that the last occurence overwrites the previous occurences.

func (*Uint64SinglePath) GetDefault

func (this *Uint64SinglePath) GetDefault() *uint64

Returns this default value of the field

func (*Uint64SinglePath) GetPath

func (this *Uint64SinglePath) GetPath() []uint64

Returns an ordered key list, previously compiled path, for a single value.

func (*Uint64SinglePath) Unmarshal

func (this *Uint64SinglePath) Unmarshal(buf []byte) (*uint64, error)

Technically UnmarshalLast which is the correct protocol buffer compliant way to unmarshal only one field.

func (*Uint64SinglePath) UnmarshalFirst

func (this *Uint64SinglePath) UnmarshalFirst(buf []byte) (*uint64, error)

Technically this will work for most but not all protocol buffers, depends on how it was marshalled. Use with caution.

type Uint64Sorter

type Uint64Sorter struct {
	Sort
	// contains filtered or unexported fields
}

Used to sort marshalled protocol buffers on a single Uint64 field. Provides memoizing to avoid unmarshaling the same value more than once.

func NewUint64Sorter

func NewUint64Sorter(list Sort, path *Uint64SinglePath) *Uint64Sorter

func (*Uint64Sorter) Less

func (this *Uint64Sorter) Less(i, j int) bool

func (*Uint64Sorter) Swap

func (this *Uint64Sorter) Swap(i, j int)

type Unmarshaler

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

Used to Unmarshal a selected part of an input buffer.

Example
// Extensions for Protocol Buffers to create more go like structures.
//
// Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved.
// http://github.com/gogo/protobuf/gogoproto
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package main

import (
	"fmt"
	"github.com/gogo/protobuf/fieldpath"
	"github.com/gogo/protobuf/proto"
	"github.com/gogo/protobuf/test"
)

type handler struct {
}

func (this *handler) Int64(v int64) {
	fmt.Printf("%d\n", v)
}

func main() {
	a := &test.NinOptNative{
		Field4: proto.Int64(1234),
	}
	fp, err := fieldpath.NewInt64Path("test", "NinOptNative", test.ThetestDescription(), "Field4")
	if err != nil {
		panic(err)
	}
	buf, err := proto.Marshal(a)
	if err != nil {
		panic(err)
	}
	h := &handler{}
	u := fieldpath.NewInt64Unmarshaler(fp, h)
	err = u.Unmarshal(buf)
	if err != nil {
		panic(err)
	}
}
Output:

1234

func NewBoolUnmarshaler

func NewBoolUnmarshaler(f *BoolPath, h BoolHandler) *Unmarshaler

Combines a BoolPath and a BoolHandler into an Unmarshaler

func NewBytesUnmarshaler

func NewBytesUnmarshaler(f *BytesPath, h BytesHandler) *Unmarshaler

Combines a BytesPath and a BytesHandler into an Unmarshaler

func NewFixed32Unmarshaler

func NewFixed32Unmarshaler(f *Fixed32Path, h Uint32Handler) *Unmarshaler

Combines a Fixed32Path and a Uint32Handler into an Unmarshaler

func NewFixed64Unmarshaler

func NewFixed64Unmarshaler(f *Fixed64Path, h Uint64Handler) *Unmarshaler

Combines a Fixed64Path and a Uint64Handler into an Unmarshaler

func NewFloat32Unmarshaler

func NewFloat32Unmarshaler(f *Float32Path, h Float32Handler) *Unmarshaler

Combines a Float32Path and a Float32Handler into an Unmarshaler

func NewFloat64Unmarshaler

func NewFloat64Unmarshaler(f *Float64Path, h Float64Handler) *Unmarshaler

Combines a Float64Path and a Float64Handler into an Unmarshaler

func NewInt32Unmarshaler

func NewInt32Unmarshaler(f *Int32Path, h Int32Handler) *Unmarshaler

Combines a Int32Path and a Int32Handler into an Unmarshaler

func NewInt64Unmarshaler

func NewInt64Unmarshaler(f *Int64Path, h Int64Handler) *Unmarshaler

Combines a Int64Path and a Int64Handler into an Unmarshaler

func NewPackedBoolUnmarshaler

func NewPackedBoolUnmarshaler(f *PackedBoolPath, h BoolHandler) *Unmarshaler

Combines a PackedBoolPath and a BoolHandler into an Unmarshaler

func NewPackedBytesUnmarshaler

func NewPackedBytesUnmarshaler(f *PackedBytesPath, h BytesHandler) *Unmarshaler

Combines a PackedBytesPath and a BytesHandler into an Unmarshaler

func NewPackedFixed32Unmarshaler

func NewPackedFixed32Unmarshaler(f *PackedFixed32Path, h Uint32Handler) *Unmarshaler

Combines a PackedFixed32Path and a Uint32Handler into an Unmarshaler

func NewPackedFixed64Unmarshaler

func NewPackedFixed64Unmarshaler(f *PackedFixed64Path, h Uint64Handler) *Unmarshaler

Combines a PackedFixed64Path and a Uint64Handler into an Unmarshaler

func NewPackedFloat32Unmarshaler

func NewPackedFloat32Unmarshaler(f *PackedFloat32Path, h Float32Handler) *Unmarshaler

Combines a PackedFloat32Path and a Float32Handler into an Unmarshaler

func NewPackedFloat64Unmarshaler

func NewPackedFloat64Unmarshaler(f *PackedFloat64Path, h Float64Handler) *Unmarshaler

Combines a PackedFloat64Path and a Float64Handler into an Unmarshaler

func NewPackedInt32Unmarshaler

func NewPackedInt32Unmarshaler(f *PackedInt32Path, h Int32Handler) *Unmarshaler

Combines a PackedInt32Path and a Int32Handler into an Unmarshaler

func NewPackedInt64Unmarshaler

func NewPackedInt64Unmarshaler(f *PackedInt64Path, h Int64Handler) *Unmarshaler

Combines a PackedInt64Path and a Int64Handler into an Unmarshaler

func NewPackedSfixed32Unmarshaler

func NewPackedSfixed32Unmarshaler(f *PackedSfixed32Path, h Int32Handler) *Unmarshaler

Combines a PackedSfixed32Path and a Int32Handler into an Unmarshaler

func NewPackedSfixed64Unmarshaler

func NewPackedSfixed64Unmarshaler(f *PackedSfixed64Path, h Int64Handler) *Unmarshaler

Combines a PackedSfixed64Path and a Int64Handler into an Unmarshaler

func NewPackedSint32Unmarshaler

func NewPackedSint32Unmarshaler(f *PackedSint32Path, h Int32Handler) *Unmarshaler

Combines a PackedSint32Path and a Int32Handler into an Unmarshaler

func NewPackedSint64Unmarshaler

func NewPackedSint64Unmarshaler(f *PackedSint64Path, h Int64Handler) *Unmarshaler

Combines a PackedSint64Path and a Int64Handler into an Unmarshaler

func NewPackedStringUnmarshaler

func NewPackedStringUnmarshaler(f *PackedStringPath, h StringHandler) *Unmarshaler

Combines a PackedStringPath and a StringHandler into an Unmarshaler

func NewPackedUint32Unmarshaler

func NewPackedUint32Unmarshaler(f *PackedUint32Path, h Uint32Handler) *Unmarshaler

Combines a PackedUint32Path and a Uint32Handler into an Unmarshaler

func NewPackedUint64Unmarshaler

func NewPackedUint64Unmarshaler(f *PackedUint64Path, h Uint64Handler) *Unmarshaler

Combines a PackedUint64Path and a Uint64Handler into an Unmarshaler

func NewSfixed32Unmarshaler

func NewSfixed32Unmarshaler(f *Sfixed32Path, h Int32Handler) *Unmarshaler

Combines a Sfixed32Path and a Int32Handler into an Unmarshaler

func NewSfixed64Unmarshaler

func NewSfixed64Unmarshaler(f *Sfixed64Path, h Int64Handler) *Unmarshaler

Combines a Sfixed64Path and a Int64Handler into an Unmarshaler

func NewSint32Unmarshaler

func NewSint32Unmarshaler(f *Sint32Path, h Int32Handler) *Unmarshaler

Combines a Sint32Path and a Int32Handler into an Unmarshaler

func NewSint64Unmarshaler

func NewSint64Unmarshaler(f *Sint64Path, h Int64Handler) *Unmarshaler

Combines a Sint64Path and a Int64Handler into an Unmarshaler

func NewStringUnmarshaler

func NewStringUnmarshaler(f *StringPath, h StringHandler) *Unmarshaler

Combines a StringPath and a StringHandler into an Unmarshaler

func NewUint32Unmarshaler

func NewUint32Unmarshaler(f *Uint32Path, h Uint32Handler) *Unmarshaler

Combines a Uint32Path and a Uint32Handler into an Unmarshaler

func NewUint64Unmarshaler

func NewUint64Unmarshaler(f *Uint64Path, h Uint64Handler) *Unmarshaler

Combines a Uint64Path and a Uint64Handler into an Unmarshaler

func (*Unmarshaler) Unmarshal

func (this *Unmarshaler) Unmarshal(buf []byte) error

Unmarshals the selected part of this input buffer.

Directories

Path Synopsis
Generates fieldpath-generated.go and fieldpath-generated_test.go in github.com/gogo/protobuf/fieldpath , since writing code for each native go type and native proto type can be quite tedious.
Generates fieldpath-generated.go and fieldpath-generated_test.go in github.com/gogo/protobuf/fieldpath , since writing code for each native go type and native proto type can be quite tedious.

Jump to

Keyboard shortcuts

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