etcd: Index | Files

package endpoint

import ""

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


Package Files


func Dialer Uses

func Dialer(ctx context.Context, dialEp string) (net.Conn, error)

Dialer dials a endpoint using net.Dialer. Context cancelation and timeout are supported.

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 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 {
    // 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.ResolveNowOptions)

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 7 packages (graph) and is imported by 29 packages. Updated 2020-03-22. Refresh now. Tools for package owners.