grpclb
v0.0.0-20170609214715-11d0a25b4919
go4.org/grpc/grpclb
Documentation
pkg.go.dev ↗Package grpclb implements the load balancing protocol defined at https://github.com/grpc/grpc/blob/master/doc/load-balancing.md. The implementation is currently EXPERIMENTAL.
Functions
Balancer
func Balancer(r naming.Resolver) grpc.Balancer
Balancer creates a grpclb load balancer.
Types
AddressType
type AddressType uint8
AddressType indicates the address type returned by name resolution.
Backend (2 declarations)
const ( // Backend indicates the server is a backend server. Backend AddressType = iota // GRPCLB indicates the server is a grpclb load balancer. GRPCLB )
Metadata
type Metadata struct {
// AddrType is the type of server (grpc load balancer or backend).
AddrType AddressType
// ServerName is the name of the grpc load balancer. Used for authentication.
ServerName string
}
Metadata contains the information the name resolution for grpclb should provide. The name resolver used by grpclb balancer is required to provide this type of metadata in its address updates.