package structpb
import "github.com/knqyf263/go-plugin/types/known/structpb"
Index ¶
- Variables
- type ListValue
- func NewList(v []interface{}) (*ListValue, error)
- func (x *ListValue) AsSlice() []interface{}
- func (x *ListValue) GetValues() []*Value
- func (m *ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ListValue) MarshalToVT(dAtA []byte) (int, error)
- func (m *ListValue) MarshalVT() (dAtA []byte, err error)
- func (x *ListValue) ProtoReflect() protoreflect.Message
- func (m *ListValue) SizeVT() (n int)
- func (m *ListValue) UnmarshalVT(dAtA []byte) error
- type NullValue
- type Struct
- func NewStruct(v map[string]interface{}) (*Struct, error)
- func (x *Struct) AsMap() map[string]interface{}
- func (x *Struct) GetFields() map[string]*Value
- func (m *Struct) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Struct) MarshalToVT(dAtA []byte) (int, error)
- func (m *Struct) MarshalVT() (dAtA []byte, err error)
- func (x *Struct) ProtoReflect() protoreflect.Message
- func (m *Struct) SizeVT() (n int)
- func (m *Struct) UnmarshalVT(dAtA []byte) error
- type Value
- func NewBoolValue(v bool) *Value
- func NewListValue(v *ListValue) *Value
- func NewNullValue() *Value
- func NewNumberValue(v float64) *Value
- func NewStringValue(v string) *Value
- func NewStructValue(v *Struct) *Value
- func NewValue(v interface{}) (*Value, error)
- func (x *Value) AsInterface() interface{}
- func (x *Value) GetBoolValue() bool
- func (m *Value) GetKind() isValue_Kind
- func (x *Value) GetListValue() *ListValue
- func (x *Value) GetNullValue() NullValue
- func (x *Value) GetNumberValue() float64
- func (x *Value) GetStringValue() string
- func (x *Value) GetStructValue() *Struct
- func (m *Value) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Value) MarshalToVT(dAtA []byte) (int, error)
- func (m *Value) MarshalVT() (dAtA []byte, err error)
- func (x *Value) ProtoReflect() protoreflect.Message
- func (m *Value) SizeVT() (n int)
- func (m *Value) UnmarshalVT(dAtA []byte) error
- type Value_BoolValue
- func (m *Value_BoolValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Value_BoolValue) MarshalToVT(dAtA []byte) (int, error)
- func (m *Value_BoolValue) SizeVT() (n int)
- type Value_ListValue
- func (m *Value_ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Value_ListValue) MarshalToVT(dAtA []byte) (int, error)
- func (m *Value_ListValue) SizeVT() (n int)
- type Value_NullValue
- func (m *Value_NullValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Value_NullValue) MarshalToVT(dAtA []byte) (int, error)
- func (m *Value_NullValue) SizeVT() (n int)
- type Value_NumberValue
- func (m *Value_NumberValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Value_NumberValue) MarshalToVT(dAtA []byte) (int, error)
- func (m *Value_NumberValue) SizeVT() (n int)
- type Value_StringValue
- func (m *Value_StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Value_StringValue) MarshalToVT(dAtA []byte) (int, error)
- func (m *Value_StringValue) SizeVT() (n int)
- type Value_StructValue
Variables ¶
var ( NullValue_name = map[int32]string{ 0: "NULL_VALUE", } NullValue_value = map[string]int32{ "NULL_VALUE": 0, } )
Enum value maps for NullValue.
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
Types ¶
type ListValue ¶
type ListValue struct { // Repeated field of dynamically typed values. Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
`ListValue` is a wrapper around a repeated field of values.
The JSON representation for `ListValue` is JSON array.
func NewList ¶
NewList constructs a ListValue from a general-purpose Go slice. The slice elements are converted using NewValue.
func (*ListValue) AsSlice ¶
func (x *ListValue) AsSlice() []interface{}
AsSlice converts x to a general-purpose Go slice. The slice elements are converted by calling Value.AsInterface.
func (*ListValue) GetValues ¶
func (*ListValue) MarshalToSizedBufferVT ¶
func (*ListValue) MarshalToVT ¶
func (*ListValue) MarshalVT ¶
func (*ListValue) ProtoReflect ¶
func (x *ListValue) ProtoReflect() protoreflect.Message
func (*ListValue) SizeVT ¶
func (*ListValue) UnmarshalVT ¶
type NullValue ¶
type NullValue int32
`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) Enum ¶
type Struct ¶
type Struct struct { // Unordered map of dynamically typed values. Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // contains filtered or unexported fields }
`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 NewStruct ¶
NewStruct constructs a Struct from a general-purpose Go map. The map keys must be valid UTF-8. The map values are converted using NewValue.
func (*Struct) AsMap ¶
AsMap converts x to a general-purpose Go map. The map values are converted by calling Value.AsInterface.
func (*Struct) GetFields ¶
func (*Struct) MarshalToSizedBufferVT ¶
func (*Struct) MarshalToVT ¶
func (*Struct) MarshalVT ¶
func (*Struct) ProtoReflect ¶
func (x *Struct) ProtoReflect() protoreflect.Message
func (*Struct) SizeVT ¶
func (*Struct) UnmarshalVT ¶
type Value ¶
type Value struct { // The kind of value. // // Types that are assignable to Kind: // // *Value_NullValue // *Value_NumberValue // *Value_StringValue // *Value_BoolValue // *Value_StructValue // *Value_ListValue Kind isValue_Kind `protobuf_oneof:"kind"` // contains filtered or unexported fields }
`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 these variants. Absence of any variant indicates an error.
The JSON representation for `Value` is JSON value.
func NewBoolValue ¶
NewBoolValue constructs a new boolean Value.
func NewListValue ¶
NewListValue constructs a new list Value.
func NewNullValue ¶
func NewNullValue() *Value
NewNullValue constructs a new null Value.
func NewNumberValue ¶
NewNumberValue constructs a new number Value.
func NewStringValue ¶
NewStringValue constructs a new string Value.
func NewStructValue ¶
NewStructValue constructs a new struct Value.
func NewValue ¶
NewValue constructs a Value from a general-purpose Go interface.
╔════════════════════════╤════════════════════════════════════════════╗ ║ Go type │ Conversion ║ ╠════════════════════════╪════════════════════════════════════════════╣ ║ nil │ stored as NullValue ║ ║ bool │ stored as BoolValue ║ ║ int, int32, int64 │ stored as NumberValue ║ ║ uint, uint32, uint64 │ stored as NumberValue ║ ║ float32, float64 │ stored as NumberValue ║ ║ string │ stored as StringValue; must be valid UTF-8 ║ ║ []byte │ stored as StringValue; base64-encoded ║ ║ map[string]interface{} │ stored as StructValue ║ ║ []interface{} │ stored as ListValue ║ ╚════════════════════════╧════════════════════════════════════════════╝
When converting an int64 or uint64 to a NumberValue, numeric precision loss is possible since they are stored as a float64.
func (*Value) AsInterface ¶
func (x *Value) AsInterface() interface{}
AsInterface converts x to a general-purpose Go interface.
Calling Value.MarshalJSON and "encoding/json".Marshal on this output produce semantically equivalent JSON (assuming no errors occur).
Floating-point values (i.e., "NaN", "Infinity", and "-Infinity") are converted as strings to remain compatible with MarshalJSON.
func (*Value) GetBoolValue ¶
func (*Value) GetKind ¶
func (m *Value) GetKind() isValue_Kind
func (*Value) GetListValue ¶
func (*Value) GetNullValue ¶
func (*Value) GetNumberValue ¶
func (*Value) GetStringValue ¶
func (*Value) GetStructValue ¶
func (*Value) MarshalToSizedBufferVT ¶
func (*Value) MarshalToVT ¶
func (*Value) MarshalVT ¶
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
func (*Value) SizeVT ¶
func (*Value) UnmarshalVT ¶
type Value_BoolValue ¶
type Value_BoolValue struct { // Represents a boolean value. BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` }
func (*Value_BoolValue) MarshalToSizedBufferVT ¶
func (m *Value_BoolValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*Value_BoolValue) MarshalToVT ¶
func (m *Value_BoolValue) MarshalToVT(dAtA []byte) (int, error)
func (*Value_BoolValue) SizeVT ¶
func (m *Value_BoolValue) SizeVT() (n int)
type Value_ListValue ¶
type Value_ListValue struct { // Represents a repeated `Value`. ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` }
func (*Value_ListValue) MarshalToSizedBufferVT ¶
func (m *Value_ListValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*Value_ListValue) MarshalToVT ¶
func (m *Value_ListValue) MarshalToVT(dAtA []byte) (int, error)
func (*Value_ListValue) SizeVT ¶
func (m *Value_ListValue) SizeVT() (n int)
type Value_NullValue ¶
type Value_NullValue struct { // Represents a null value. NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` }
func (*Value_NullValue) MarshalToSizedBufferVT ¶
func (m *Value_NullValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*Value_NullValue) MarshalToVT ¶
func (m *Value_NullValue) MarshalToVT(dAtA []byte) (int, error)
func (*Value_NullValue) SizeVT ¶
func (m *Value_NullValue) SizeVT() (n int)
type Value_NumberValue ¶
type Value_NumberValue struct { // Represents a double value. NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` }
func (*Value_NumberValue) MarshalToSizedBufferVT ¶
func (m *Value_NumberValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*Value_NumberValue) MarshalToVT ¶
func (m *Value_NumberValue) MarshalToVT(dAtA []byte) (int, error)
func (*Value_NumberValue) SizeVT ¶
func (m *Value_NumberValue) SizeVT() (n int)
type Value_StringValue ¶
type Value_StringValue struct { // Represents a string value. StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` }
func (*Value_StringValue) MarshalToSizedBufferVT ¶
func (m *Value_StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*Value_StringValue) MarshalToVT ¶
func (m *Value_StringValue) MarshalToVT(dAtA []byte) (int, error)
func (*Value_StringValue) SizeVT ¶
func (m *Value_StringValue) SizeVT() (n int)
type Value_StructValue ¶
type Value_StructValue struct { // Represents a structured value. StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` }
func (*Value_StructValue) MarshalToSizedBufferVT ¶
func (m *Value_StructValue) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*Value_StructValue) MarshalToVT ¶
func (m *Value_StructValue) MarshalToVT(dAtA []byte) (int, error)
func (*Value_StructValue) SizeVT ¶
func (m *Value_StructValue) SizeVT() (n int)
Source Files ¶
struct.go struct.pb.go struct_vtproto.pb.go
- Version
- v0.8.0
- Published
- Jun 25, 2023
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 3 days ago –
Tools for package owners.