udpa_type_v1

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypedStruct

type TypedStruct struct {
	// A URL that uniquely identifies the type of the serialize protocol buffer message.
	// This has same semantics and format described in google.protobuf.Any:
	// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto
	TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// A JSON representation of the above specified type.
	Value                *_struct.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

A TypedStruct contains an arbitrary JSON serialized protocol buffer message with a URL that describes the type of the serialized message. This is very similar to google.protobuf.Any, instead of having protocol buffer binary, this employs google.protobuf.Struct as value.

This message is intended to be embedded inside Any, so it shouldn't be directly referred from other UDPA messages.

When packing an opaque extension config, packing the expected type into Any is preferred wherever possible for its efficiency. TypedStruct should be used only if a proto descriptor is not available, for example if:

  • A control plane sends opaque message that is originally from external source in human readable format such as JSON or YAML.
  • The control plane doesn't have the knowledge of the protocol buffer schema hence it cannot serialize the message in protocol buffer binary format.
  • The DPLB doesn't have have the knowledge of the protocol buffer schema its plugin or extension uses. This has to be indicated in the DPLB capability negotiation.

When a DPLB receives a TypedStruct in Any, it should: - Check if the type_url of the TypedStruct matches the type the extension expects. - Convert value to the type described in type_url and perform validation. TODO(lizan): Figure out how TypeStruct should be used with DPLB extensions that doesn't link protobuf descriptor with DPLB itself, (e.g. gRPC LB Plugin, Envoy WASM extensions).

func (*TypedStruct) Descriptor

func (*TypedStruct) Descriptor() ([]byte, []int)

func (*TypedStruct) GetTypeUrl

func (m *TypedStruct) GetTypeUrl() string

func (*TypedStruct) GetValue

func (m *TypedStruct) GetValue() *_struct.Struct

func (*TypedStruct) ProtoMessage

func (*TypedStruct) ProtoMessage()

func (*TypedStruct) Reset

func (m *TypedStruct) Reset()

func (*TypedStruct) String

func (m *TypedStruct) String() string

func (*TypedStruct) XXX_DiscardUnknown

func (m *TypedStruct) XXX_DiscardUnknown()

func (*TypedStruct) XXX_Marshal

func (m *TypedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TypedStruct) XXX_Merge

func (m *TypedStruct) XXX_Merge(src proto.Message)

func (*TypedStruct) XXX_Size

func (m *TypedStruct) XXX_Size() int

func (*TypedStruct) XXX_Unmarshal

func (m *TypedStruct) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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