maps

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package maps contains shared layouts for maps field implementations, for sharing between the tdp packages and the gencode packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolToBytes

type BoolToBytes struct {
	// contains filtered or unexported fields
}

BoolToBytes is a map<bool, bytes>.

func (*BoolToBytes) Get

func (m *BoolToBytes) Get(key bool) ([]byte, bool)

Get implements Map.

func (*BoolToBytes) Len

func (m *BoolToBytes) Len() int

Len implements Map.

func (*BoolToBytes) ProtoReflect

func (m *BoolToBytes) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*BoolToBytes) Range

func (m *BoolToBytes) Range(yield func(bool, []byte) bool)

Range implements Map.

type BoolToMessage

type BoolToMessage[M any] struct {
	// contains filtered or unexported fields
}

BoolToMessage is a map<bool, M> where M is a message type.

M must be dynamic.Message or a type that wraps it.

func (*BoolToMessage[M]) Get

func (m *BoolToMessage[M]) Get(key bool) (*M, bool)

Get implements Map.

func (*BoolToMessage[M]) Len

func (m *BoolToMessage[M]) Len() int

Len implements Map.

func (*BoolToMessage[_]) ProtoReflect

func (m *BoolToMessage[_]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*BoolToMessage[M]) Range

func (m *BoolToMessage[M]) Range(yield func(bool, *M) bool)

Range implements Map.

type BoolToScalar

type BoolToScalar[V any] struct {
	// contains filtered or unexported fields
}

BoolToScalar is a map<bool, V> field where V is a scalar type.

func (*BoolToScalar[V]) Get

func (m *BoolToScalar[V]) Get(key bool) (V, bool)

Get implements Map.

func (*BoolToScalar[V]) Len

func (m *BoolToScalar[V]) Len() int

Len implements Map.

func (*BoolToScalar[V]) ProtoReflect

func (m *BoolToScalar[V]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*BoolToScalar[V]) Range

func (m *BoolToScalar[V]) Range(yield func(bool, V) bool)

Range implements Map.

type BoolToString

type BoolToString struct {
	// contains filtered or unexported fields
}

BoolToString is a map<bool, string>.

func (*BoolToString) Get

func (m *BoolToString) Get(key bool) (string, bool)

Get implements Map.

func (*BoolToString) Len

func (m *BoolToString) Len() int

Len implements Map.

func (*BoolToString) ProtoReflect

func (m *BoolToString) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*BoolToString) Range

func (m *BoolToString) Range(yield func(bool, string) bool)

Range implements Map.

type Int

type Int = xprotoreflect.Int

Int is any integer type that can be a key to a map.

type IntToBytes

type IntToBytes[K Int] struct {
	// contains filtered or unexported fields
}

IntToBytes is a map<K, string> where K is an integer type.

func (*IntToBytes[K]) Get

func (m *IntToBytes[K]) Get(key K) ([]byte, bool)

Get implements Map.

func (*IntToBytes[K]) Len

func (m *IntToBytes[K]) Len() int

Len implements Map.

func (*IntToBytes[K]) ProtoReflect

func (m *IntToBytes[K]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*IntToBytes[K]) Range

func (m *IntToBytes[K]) Range(yield func(K, []byte) bool)

Range implements Map.

type IntToMessage

type IntToMessage[K xprotoreflect.Int, M any] struct {
	// contains filtered or unexported fields
}

IntToMessage is a map<K, M> where K is an integer type and M is a message type.

M must be dynamic.Message or a type that wraps it.

func (*IntToMessage[K, M]) Get

func (m *IntToMessage[K, M]) Get(key K) (*M, bool)

Get implements Map.

func (*IntToMessage[K, M]) Len

func (m *IntToMessage[K, M]) Len() int

Len implements Map.

func (*IntToMessage[K, _]) ProtoReflect

func (m *IntToMessage[K, _]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*IntToMessage[K, M]) Range

func (m *IntToMessage[K, M]) Range(yield func(K, *M) bool)

Range implements Map.

type IntToScalar

type IntToScalar[K Int, V any] struct {
	// contains filtered or unexported fields
}

IntToScalar is a map<K, V> field where K and V are both scalar types.

func (*IntToScalar[K, V]) Get

func (m *IntToScalar[K, V]) Get(key K) (V, bool)

Get implements Map.

func (*IntToScalar[K, V]) Len

func (m *IntToScalar[K, V]) Len() int

Len implements Map.

func (*IntToScalar[K, V]) ProtoReflect

func (m *IntToScalar[K, V]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*IntToScalar[K, V]) Range

func (m *IntToScalar[K, V]) Range(yield func(K, V) bool)

Range implements Map.

type IntToString

type IntToString[K Int] struct {
	// contains filtered or unexported fields
}

IntToString is a map<K, string> where K is an integer type.

func (*IntToString[K]) Get

func (m *IntToString[K]) Get(key K) (string, bool)

Get implements Map.

func (*IntToString[K]) Len

func (m *IntToString[K]) Len() int

Len implements Map.

func (*IntToString[K]) ProtoReflect

func (m *IntToString[K]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*IntToString[K]) Range

func (m *IntToString[K]) Range(yield func(K, string) bool)

Range implements Map.

type Map

type Map[K, V any] interface {
	// Len returns the number of entries in the map.
	Len() int

	// Get looks up an entry in the map.
	Get(K) (V, bool)

	// Range is an iterator over the entries in the map; entries are returned
	// in unspecified order.
	Range(yield func(K, V) bool)

	// ProtoReflect returns a reflection view for this value.
	ProtoReflect() protoreflect.Map
	// contains filtered or unexported methods
}

Map is an interface that all map types in this package conform to.

type StringToBytes

type StringToBytes struct {
	// contains filtered or unexported fields
}

StringToBytes is a map<string, bytes>.

func (*StringToBytes) Get

func (m *StringToBytes) Get(key string) ([]byte, bool)

Get implements Map.

func (*StringToBytes) Len

func (m *StringToBytes) Len() int

Len implements Map.

func (*StringToBytes) ProtoReflect

func (m *StringToBytes) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*StringToBytes) Range

func (m *StringToBytes) Range(yield func(string, []byte) bool)

Range implements Map.

type StringToMessage

type StringToMessage[M any] struct {
	// contains filtered or unexported fields
}

StringToMessage is a map<string, M> where M is a message type.

M must be dynamic.Message or a type that wraps it.

func (*StringToMessage[M]) Get

func (m *StringToMessage[M]) Get(key string) (*M, bool)

Get implements Map.

func (*StringToMessage[M]) Len

func (m *StringToMessage[M]) Len() int

Len implements Map.

func (*StringToMessage[_]) ProtoReflect

func (m *StringToMessage[_]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*StringToMessage[M]) Range

func (m *StringToMessage[M]) Range(yield func(string, *M) bool)

Range implements Map.

type StringToScalar

type StringToScalar[V any] struct {
	// contains filtered or unexported fields
}

StringToScalar is a map<string, V> field where V is a scalar type.

func (*StringToScalar[V]) Get

func (m *StringToScalar[V]) Get(key string) (V, bool)

Get implements Map.

func (*StringToScalar[V]) Len

func (m *StringToScalar[V]) Len() int

Len implements Map.

func (*StringToScalar[V]) ProtoReflect

func (m *StringToScalar[V]) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*StringToScalar[V]) Range

func (m *StringToScalar[V]) Range(yield func(string, V) bool)

Range implements Map.

type StringToString

type StringToString struct {
	// contains filtered or unexported fields
}

StringToString is a map<string, string>.

func (*StringToString) Get

func (m *StringToString) Get(key string) (string, bool)

Get implements Map.

func (*StringToString) Len

func (m *StringToString) Len() int

Len implements Map.

func (*StringToString) ProtoReflect

func (m *StringToString) ProtoReflect() protoreflect.Map

ProtoReflect implements Map.

func (*StringToString) Range

func (m *StringToString) Range(yield func(string, string) bool)

Range implements Map.

Jump to

Keyboard shortcuts

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