etcd: github.com/coreos/etcd/clientv3/balancer/resolver/endpoint Index | Files

package endpoint

import "github.com/coreos/etcd/clientv3/balancer/resolver/endpoint"

Package endpoint resolves etcd entpoints using grpc targets of the form 'endpoint://<id>/<endpoint>'.

Index

Package Files

endpoint.go

func IsTarget Uses

func IsTarget(target string) bool

IsTarget checks if a given target string in an endpoint resolver target.

func ParseEndpoint Uses

func ParseEndpoint(endpoint string) (proto string, host string, scheme string)

ParseEndpoint endpoint parses an endpoint of the form (http|https)://<host>*|(unix|unixs)://<path>) and returns a protocol ('tcp' or 'unix'), host (or filepath if a unix socket), scheme (http, https, unix, unixs).

func ParseHostPort Uses

func ParseHostPort(hostPort string) (host string, port string)

ParseHostPort splits a "<host>:<port>" string into the host and port parts. The port part is optional.

func ParseTarget Uses

func ParseTarget(target string) (string, string, error)

ParseTarget parses a endpoint://<id>/<endpoint> string and returns the parsed id and endpoint. If the target is malformed, an error is returned.

func Target Uses

func Target(id, endpoint string) string

Target constructs a endpoint resolver target.

type Resolver Uses

type Resolver struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

Resolver provides a resolver for a single etcd cluster, identified by name.

func (*Resolver) Close Uses

func (r *Resolver) Close()

func (*Resolver) ResolveNow Uses

func (*Resolver) ResolveNow(o resolver.ResolveNowOption)

type ResolverGroup Uses

type ResolverGroup struct {
    // contains filtered or unexported fields
}

ResolverGroup keeps all endpoints of resolvers using a common endpoint://<id>/ target up-to-date.

func NewResolverGroup Uses

func NewResolverGroup(id string) (*ResolverGroup, error)

NewResolverGroup creates a new ResolverGroup with the given id.

func (*ResolverGroup) Close Uses

func (e *ResolverGroup) Close()

func (*ResolverGroup) SetEndpoints Uses

func (e *ResolverGroup) SetEndpoints(endpoints []string)

SetEndpoints updates the endpoints for ResolverGroup. All registered resolver are updated immediately with the new endpoints.

func (*ResolverGroup) Target Uses

func (e *ResolverGroup) Target(endpoint string) string

Target constructs a endpoint target using the endpoint id of the ResolverGroup.

Package endpoint imports 5 packages (graph) and is imported by 1 packages. Updated 2018-09-02. Refresh now. Tools for package owners.