structpb

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: MIT Imports: 1 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 {
	// Repeated field of dynamically typed values.
	Values []*Value
}

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

The JSON representation for `ListValue` is JSON array.

func (*ListValue) GetValues

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

GetValues gets the Values of the ListValue.

func (*ListValue) Marshal

func (m *ListValue) Marshal() []byte

Marshal marshals ListValue to a slice of bytes.

func (*ListValue) MarshalToWriter

func (m *ListValue) MarshalToWriter(writer jspb.Writer)

MarshalToWriter marshals ListValue to the provided writer.

func (*ListValue) Unmarshal

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

Unmarshal unmarshals a ListValue from a slice of bytes.

func (*ListValue) UnmarshalFromReader

func (m *ListValue) UnmarshalFromReader(reader jspb.Reader) *ListValue

UnmarshalFromReader unmarshals a ListValue from the provided reader.

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 {
	// Unordered map of dynamically typed values.
	Fields map[string]*Value
}

`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) GetFields

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

GetFields gets the Fields of the Struct.

func (*Struct) Marshal

func (m *Struct) Marshal() []byte

Marshal marshals Struct to a slice of bytes.

func (*Struct) MarshalToWriter

func (m *Struct) MarshalToWriter(writer jspb.Writer)

MarshalToWriter marshals Struct to the provided writer.

func (*Struct) Unmarshal

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

Unmarshal unmarshals a Struct from a slice of bytes.

func (*Struct) UnmarshalFromReader

func (m *Struct) UnmarshalFromReader(reader jspb.Reader) *Struct

UnmarshalFromReader unmarshals a Struct from the provided reader.

type Value

type Value struct {
	// The kind of value.
	//
	// Types that are valid to be assigned to Kind:
	//	*Value_NullValue
	//	*Value_NumberValue
	//	*Value_StringValue
	//	*Value_BoolValue
	//	*Value_StructValue
	//	*Value_ListValue
	Kind isValue_Kind
}

`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) GetBoolValue

func (m *Value) GetBoolValue() (x bool)

GetBoolValue gets the BoolValue of the Value.

func (*Value) GetKind

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

GetKind gets the Kind of the Value.

func (*Value) GetListValue

func (m *Value) GetListValue() (x *ListValue)

GetListValue gets the ListValue of the Value.

func (*Value) GetNullValue

func (m *Value) GetNullValue() (x NullValue)

GetNullValue gets the NullValue of the Value.

func (*Value) GetNumberValue

func (m *Value) GetNumberValue() (x float64)

GetNumberValue gets the NumberValue of the Value.

func (*Value) GetStringValue

func (m *Value) GetStringValue() (x string)

GetStringValue gets the StringValue of the Value.

func (*Value) GetStructValue

func (m *Value) GetStructValue() (x *Struct)

GetStructValue gets the StructValue of the Value.

func (*Value) Marshal

func (m *Value) Marshal() []byte

Marshal marshals Value to a slice of bytes.

func (*Value) MarshalToWriter

func (m *Value) MarshalToWriter(writer jspb.Writer)

MarshalToWriter marshals Value to the provided writer.

func (*Value) Unmarshal

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

Unmarshal unmarshals a Value from a slice of bytes.

func (*Value) UnmarshalFromReader

func (m *Value) UnmarshalFromReader(reader jspb.Reader) *Value

UnmarshalFromReader unmarshals a Value from the provided reader.

type Value_BoolValue

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

Value_BoolValue is assignable to Kind

type Value_ListValue

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

Value_ListValue is assignable to Kind

type Value_NullValue

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

Value_NullValue is assignable to Kind

type Value_NumberValue

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

Value_NumberValue is assignable to Kind

type Value_StringValue

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

Value_StringValue is assignable to Kind

type Value_StructValue

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

Value_StructValue is assignable to Kind

Jump to

Keyboard shortcuts

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