grpcetcd

package module
v0.0.0-...-5b83bba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder(client *clientv3.Client, le logger.Entry) (gresolver.Builder, error)

NewBuilder creates a resolver builder.

Types

type Discovery

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

func NewDiscovery

func NewDiscovery(
	cli *clientv3.Client,
	path string,
	le logger.Entry,
	dialOpts ...grpc.DialOption,
) *Discovery

func (*Discovery) Dial

func (d *Discovery) Dial(ctx context.Context) (cc *grpc.ClientConn, err error)

Dial connects to the target service

type Registry

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

func NewRegistry

func NewRegistry(
	cli *clientv3.Client,
	path string,
	ttl int64,
	le logger.Entry,
) *Registry

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, addr string) (revoke func(context.Context), err error)

Register registers the service with etcd addr: the address of the service, eg: 10.10.10.10:50051 returns a revoke function to deregister the service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL