wrappers

package
v0.0.0-...-a1881e9 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 25

Documentation

Overview

Package wrappers provides protobuf wrappers for common teleport map and list types.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthWrappers        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowWrappers          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupWrappers = fmt.Errorf("proto: unexpected end of group")
)

Functions

func MarshalTraits

func MarshalTraits(traits *Traits) ([]byte, error)

MarshalTraits will marshal Traits as JSON. Used to embed traits into certificates.

func UnmarshalTraits

func UnmarshalTraits(data []byte, traits *Traits) error

UnmarshalTraits will unmarshal JSON traits. Used to embed traits into certificates.

Types

type CustomType

type CustomType struct {
	// Bytes is the marshalled json data of a struct.
	Bytes                []byte   `protobuf:"bytes,1,opt,name=Bytes,proto3" json:"json"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

CustomType is a json protobuf representation of a Go struct. This is useful when defining customtypes for use with the (gogoproto.customtype) extension.

func (*CustomType) Descriptor

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

func (*CustomType) Marshal

func (m *CustomType) Marshal() (dAtA []byte, err error)

func (*CustomType) MarshalTo

func (m *CustomType) MarshalTo(dAtA []byte) (int, error)

func (*CustomType) MarshalToSizedBuffer

func (m *CustomType) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CustomType) ProtoMessage

func (*CustomType) ProtoMessage()

func (*CustomType) Reset

func (m *CustomType) Reset()

func (*CustomType) Size

func (m *CustomType) Size() (n int)

func (*CustomType) String

func (m *CustomType) String() string

func (*CustomType) Unmarshal

func (m *CustomType) Unmarshal(dAtA []byte) error

func (*CustomType) XXX_DiscardUnknown

func (m *CustomType) XXX_DiscardUnknown()

func (*CustomType) XXX_Marshal

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

func (*CustomType) XXX_Merge

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

func (*CustomType) XXX_Size

func (m *CustomType) XXX_Size() int

func (*CustomType) XXX_Unmarshal

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

type LabelValues

type LabelValues struct {
	// Values contains key value pairs.
	Values               map[string]StringValues `` /* 143-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

LabelValues is a list of key value pairs, where key is a string and value is a list of string values.

func (*LabelValues) Descriptor

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

func (*LabelValues) Marshal

func (m *LabelValues) Marshal() (dAtA []byte, err error)

func (*LabelValues) MarshalTo

func (m *LabelValues) MarshalTo(dAtA []byte) (int, error)

func (*LabelValues) MarshalToSizedBuffer

func (m *LabelValues) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LabelValues) ProtoMessage

func (*LabelValues) ProtoMessage()

func (*LabelValues) Reset

func (m *LabelValues) Reset()

func (*LabelValues) Size

func (m *LabelValues) Size() (n int)

func (*LabelValues) String

func (m *LabelValues) String() string

func (*LabelValues) Unmarshal

func (m *LabelValues) Unmarshal(dAtA []byte) error

func (*LabelValues) XXX_DiscardUnknown

func (m *LabelValues) XXX_DiscardUnknown()

func (*LabelValues) XXX_Marshal

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

func (*LabelValues) XXX_Merge

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

func (*LabelValues) XXX_Size

func (m *LabelValues) XXX_Size() int

func (*LabelValues) XXX_Unmarshal

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

type StringValues

type StringValues struct {
	Values               []string `protobuf:"bytes,1,rep,name=Values,proto3" json:"Values,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StringValues is a list of strings.

func (*StringValues) Descriptor

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

func (*StringValues) Marshal

func (m *StringValues) Marshal() (dAtA []byte, err error)

func (*StringValues) MarshalTo

func (m *StringValues) MarshalTo(dAtA []byte) (int, error)

func (*StringValues) MarshalToSizedBuffer

func (m *StringValues) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StringValues) ProtoMessage

func (*StringValues) ProtoMessage()

func (*StringValues) Reset

func (m *StringValues) Reset()

func (*StringValues) Size

func (m *StringValues) Size() (n int)

func (*StringValues) String

func (m *StringValues) String() string

func (*StringValues) Unmarshal

func (m *StringValues) Unmarshal(dAtA []byte) error

func (*StringValues) XXX_DiscardUnknown

func (m *StringValues) XXX_DiscardUnknown()

func (*StringValues) XXX_Marshal

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

func (*StringValues) XXX_Merge

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

func (*StringValues) XXX_Size

func (m *StringValues) XXX_Size() int

func (*StringValues) XXX_Unmarshal

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

type Strings

type Strings []string

Strings is a list of string that can unmarshal from list of strings or a scalar string from scalar yaml or json property

func (Strings) Marshal

func (s Strings) Marshal() ([]byte, error)

Marshal marshals value into protobuf representation

func (Strings) MarshalJSON

func (s Strings) MarshalJSON() ([]byte, error)

MarshalJSON marshals to scalar value if there is only one value in the list to list otherwise

func (Strings) MarshalTo

func (s Strings) MarshalTo(data []byte) (int, error)

MarshalTo marshals value to the array

func (Strings) MarshalYAML

func (s Strings) MarshalYAML() (interface{}, error)

MarshalYAML marshals to scalar value if there is only one value in the list, marshals to list otherwise

func (Strings) Size

func (s Strings) Size() int

Size returns protobuf size

func (*Strings) Unmarshal

func (s *Strings) Unmarshal(data []byte) error

Unmarshal unmarshals value from protobuf

func (*Strings) UnmarshalJSON

func (s *Strings) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals scalar string or strings slice to Strings

func (*Strings) UnmarshalYAML

func (s *Strings) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used to allow Strings to unmarshal from scalar string value or from the list

type Traits

type Traits map[string][]string

Traits is a wrapper around map with string slices as values

func (Traits) Marshal

func (l Traits) Marshal() ([]byte, error)

Marshal marshals value into protobuf representation

func (Traits) MarshalTo

func (l Traits) MarshalTo(data []byte) (int, error)

MarshalTo marshals value to the array

func (Traits) Size

func (l Traits) Size() int

Size returns protobuf size

func (*Traits) Unmarshal

func (l *Traits) Unmarshal(data []byte) error

Unmarshal unmarshals value from protobuf

Jump to

Keyboard shortcuts

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