package ringhash

import "google.golang.org/grpc/resolver/ringhash"

Package ringhash implements resolver related functions for the ring_hash load balancing policy.

Index

Functions

func HashKey

func HashKey(endpoint resolver.Endpoint) string

HashKey returns the hash key attribute of endpoint. If this attribute is not set, it returns the empty string.

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func SetHashKey

func SetHashKey(endpoint resolver.Endpoint, hashKey string) resolver.Endpoint

SetHashKey sets the hash key for this endpoint. Combined with the ring_hash load balancing policy, it allows placing the endpoint on the ring based on an arbitrary string instead of the IP address. If hashKey is empty, the endpoint is returned unmodified.

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

Source Files

attr.go

Version
v1.72.0 (latest)
Published
Apr 21, 2025
Platform
js/wasm
Imports
1 packages
Last checked
1 hour ago

Tools for package owners.