structpb

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package structpb is a generated protocol buffer package.

It is generated from these files:

struct/struct.proto

It has these top-level messages:

Struct
Value
ListValue

Index

Constants

This section is empty.

Variables

View Source
var NullValue_name = map[int]string{
	0: "NULL_VALUE",
}
View Source
var NullValue_value = map[string]int{
	"NULL_VALUE": 0,
}

Functions

This section is empty.

Types

type ListValue

type ListValue struct {
	*js.Object
}

`ListValue` is a wrapper around a repeated field of values.

The JSON representation for `ListValue` is JSON array.

func (*ListValue) Deserialize

func (m *ListValue) Deserialize(rawBytes []byte) (*ListValue, error)

Deserialize unmarshals a ListValue from a slice of bytes.

func (*ListValue) GetValues

func (m *ListValue) GetValues() []*Value

GetValues gets the Values of the ListValue. Repeated field of dynamically typed values. Warning: mutating the returned slice will not be reflected in the message. Use the setter to make changes to the slice in the message.

func (*ListValue) New

func (m *ListValue) New(values []*Value) *ListValue

New creates a new ListValue. Repeated field of dynamically typed values.

func (*ListValue) Serialize

func (m *ListValue) Serialize() ([]byte, error)

Serialize marshals ListValue to a slice of bytes.

func (*ListValue) SetValues

func (m *ListValue) SetValues(v []*Value)

SetValues sets the Values of the ListValue. Repeated field of dynamically typed values.

type NullValue

type NullValue int

`NullValue` is a singleton enumeration to represent the null value for the `Value` type union.

The JSON representation for `NullValue` is JSON `null`.
const (
	// Null value.
	NullValue_NULL_VALUE NullValue = 0
)

func (NullValue) String

func (x NullValue) String() string

type Struct

type Struct struct {
	*js.Object
}

`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.

The JSON representation for `Struct` is JSON object.

func (*Struct) Deserialize

func (m *Struct) Deserialize(rawBytes []byte) (*Struct, error)

Deserialize unmarshals a Struct from a slice of bytes.

func (*Struct) GetFields

func (m *Struct) GetFields() map[string]*Value

GetFields gets the Fields of the Struct. Unordered map of dynamically typed values.

func (*Struct) New

func (m *Struct) New(fields map[string]*Value) *Struct

New creates a new Struct. Unordered map of dynamically typed values.

func (*Struct) Serialize

func (m *Struct) Serialize() ([]byte, error)

Serialize marshals Struct to a slice of bytes.

func (*Struct) SetFields

func (m *Struct) SetFields(v map[string]*Value)

SetFields sets the Fields of the Struct. Unordered map of dynamically typed values.

type Value

type Value struct {
	*js.Object
}

`Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error.

The JSON representation for `Value` is JSON value.

func (*Value) Deserialize

func (m *Value) Deserialize(rawBytes []byte) (*Value, error)

Deserialize unmarshals a Value from a slice of bytes.

func (*Value) GetBoolValue

func (m *Value) GetBoolValue() bool

GetBoolValue gets the BoolValue of the Value. Represents a boolean value.

func (*Value) GetKind

func (m *Value) GetKind() (x isValue_Kind)

func (*Value) GetListValue

func (m *Value) GetListValue() *ListValue

GetListValue gets the ListValue of the Value. Represents a repeated `Value`.

func (*Value) GetNullValue

func (m *Value) GetNullValue() NullValue

GetNullValue gets the NullValue of the Value. Represents a null value.

func (*Value) GetNumberValue

func (m *Value) GetNumberValue() float64

GetNumberValue gets the NumberValue of the Value. Represents a double value.

func (*Value) GetStringValue

func (m *Value) GetStringValue() string

GetStringValue gets the StringValue of the Value. Represents a string value.

func (*Value) GetStructValue

func (m *Value) GetStructValue() *Struct

GetStructValue gets the StructValue of the Value. Represents a structured value.

func (*Value) New

func (m *Value) New() *Value

New creates a new Value.

func (*Value) Serialize

func (m *Value) Serialize() ([]byte, error)

Serialize marshals Value to a slice of bytes.

func (*Value) SetBoolValue

func (m *Value) SetBoolValue(v bool)

SetBoolValue sets the BoolValue of the Value. Represents a boolean value.

func (*Value) SetListValue

func (m *Value) SetListValue(v *ListValue)

SetListValue sets the ListValue of the Value. Represents a repeated `Value`.

func (*Value) SetNullValue

func (m *Value) SetNullValue(v NullValue)

SetNullValue sets the NullValue of the Value. Represents a null value.

func (*Value) SetNumberValue

func (m *Value) SetNumberValue(v float64)

SetNumberValue sets the NumberValue of the Value. Represents a double value.

func (*Value) SetStringValue

func (m *Value) SetStringValue(v string)

SetStringValue sets the StringValue of the Value. Represents a string value.

func (*Value) SetStructValue

func (m *Value) SetStructValue(v *Struct)

SetStructValue sets the StructValue of the Value. Represents a structured value.

type Value_BoolValue

type Value_BoolValue struct {
	// Represents a boolean value.
	BoolValue bool
}

type Value_ListValue

type Value_ListValue struct {
	// Represents a repeated `Value`.
	ListValue *ListValue
}

type Value_NullValue

type Value_NullValue struct {
	// Represents a null value.
	NullValue NullValue
}

type Value_NumberValue

type Value_NumberValue struct {
	// Represents a double value.
	NumberValue float64
}

type Value_StringValue

type Value_StringValue struct {
	// Represents a string value.
	StringValue string
}

type Value_StructValue

type Value_StructValue struct {
	// Represents a structured value.
	StructValue *Struct
}

Jump to

Keyboard shortcuts

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