dns

package
v0.0.0-...-ee930af Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prefix = "etcd3_naming"

Prefix should start and end with no slash

Functions

func Register

func Register(name string, host string, port int, target string, interval time.Duration, ttl int) error

Register service to service registry. name: service name; host: your service running host; port: your service running export port; target: your service register target; interval: ; ttl: ;

func UnRegister

func UnRegister(name string, target string) error

UnRegister delete registered service from etcd

Types

type Resolver

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

Resolver is the implementaion of grpc.naming.Resolver

func NewResolver

func NewResolver(serviceName string) *Resolver

NewResolver return resolver with service name

func (*Resolver) Resolve

func (re *Resolver) Resolve(target string) (naming.Watcher, error)

Resolve to resolve the service from etcd, target is the dial address of etcd target example: "http://127.0.0.1:2379,http://127.0.0.1:12379,http://127.0.0.1:22379"

Jump to

Keyboard shortcuts

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