hostname
v1.85.0
google.golang.org/grpc/experimental/balancer/hostname
Documentation
pkg.go.dev ↗Package hostname contains utilities for the endpoint hostname attribute (used for per-endpoint :authority / SNI override).
Experimental
Notice: All APIs in this package are EXPERIMENTAL and may be changed or removed in a later release.
Functions
FromEndpoint
func FromEndpoint(endpoint resolver.Endpoint) string
FromEndpoint returns the hostname attribute of endpoint. If this attribute is not set, it returns the empty string.
Set
func Set(endpoint resolver.Endpoint, hostname string) resolver.Endpoint
Set returns a copy of the given endpoint with the hostname attribute set. If hostname is empty the endpoint is returned unmodified.