package keys
import "google.golang.org/grpc/balancer/rls/internal/keys"
Package keys provides functionality required to build RLS request keys.
Index ¶
- type BuilderMap
- func MakeBuilderMap(cfg *rlspb.RouteLookupConfig) (BuilderMap, error)
- func (bm BuilderMap) Equal(am BuilderMap) bool
- func (bm BuilderMap) RLSKey(md metadata.MD, host, path string) KeyMap
- type KeyMap
Types ¶
type BuilderMap ¶
type BuilderMap map[string]builder
BuilderMap maps from request path to the key builder for that path.
func MakeBuilderMap ¶
func MakeBuilderMap(cfg *rlspb.RouteLookupConfig) (BuilderMap, error)
MakeBuilderMap parses the provided RouteLookupConfig proto and returns a map from paths to key builders.
func (BuilderMap) Equal ¶
func (bm BuilderMap) Equal(am BuilderMap) bool
Equal reports whether bm and am represent equivalent BuilderMaps.
func (BuilderMap) RLSKey ¶
func (bm BuilderMap) RLSKey(md metadata.MD, host, path string) KeyMap
RLSKey builds the RLS keys to be used for the given request, identified by the request path and the request headers stored in metadata.
type KeyMap ¶
type KeyMap struct { // Map is the representation of an RLS key as a Go map. This is used when // an actual RLS request is to be sent out on the wire, since the // RouteLookupRequest proto expects a Go map. Map map[string]string // Str is the representation of an RLS key as a string, sorted by keys. // Since the RLS keys are part of the cache key in the request cache // maintained by the RLS balancer, and Go maps cannot be used as keys for // Go maps (the cache is implemented as a map), we need a stringified // version of it. Str string }
KeyMap represents the RLS keys to be used for a request.
Source Files ¶
builder.go
- Version
- v1.70.0 (latest)
- Published
- Jan 23, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 20 hours ago –
Tools for package owners.