Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateURL ¶
ValidateURL validates Gitaly address URL having dns scheme. The URL follows three forms: * dns://authority-port:authority-host/host:port * dns:///host:port * dns:host:port Either form, the real address is the URL's path
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is an object to build the resolver for a connection. A client connection uses the builder specified by grpc.WithResolvers dial option or the one fetched from global Resolver registry. The local option has higher precedence than the global one.
func NewBuilder ¶
func NewBuilder(opts *BuilderConfig) *Builder
NewBuilder creates a builder option with an input option
func (*Builder) Build ¶
func (d *Builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (resolver.Resolver, error)
Build returns a resolver that periodically resolves the input target. Each client connection maintains a resolver. It's a part of client connection's life cycle. The target follows gRPC desc resolution format (https://github.com/grpc/grpc/blob/master/doc/naming.md). As this builds a DNS resolver, we care about dns URL only: dns:[//authority/]host[:port] If the authority is missing (dns:host[:port]), it fallbacks to use OS resolver.
type BuilderConfig ¶
type BuilderConfig struct { // RefreshRate determines the periodic refresh rate of the resolver. The resolver may issue // the resolver earlier if client connection demands RefreshRate time.Duration // LookupTimeout determines the timeout of underlying DNS query. LookupTimeout time.Duration // Backoff defines the backoff strategy when the resolver fails to resolve or pushes new // state to client connection Backoff backoff.Strategy // DefaultGrpcPort sets the gRPC port if the target URL doesn't specify a target port DefaultGrpcPort string // contains filtered or unexported fields }
BuilderConfig defines the configuration for customizing the builder.