1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00
go-micro/network/resolver/resolver.go

17 lines
509 B
Go
Raw Normal View History

2019-07-28 21:00:09 +02:00
// Package resolver resolves network names to addresses
2019-07-28 13:14:40 +02:00
package resolver
// Resolver is network resolver. It's used to find network nodes
2019-07-28 21:00:09 +02:00
// via the name to connect to. This is done based on Network.Name().
2019-07-28 13:14:40 +02:00
// Before we can be part of any network, we have to connect to it.
type Resolver interface {
// Resolve returns a list of addresses for a name
2019-07-28 21:00:09 +02:00
Resolve(name string) ([]*Record, error)
2019-07-28 13:14:40 +02:00
}
// A resolved record
type Record struct {
Address string `json:"address"`
Priority int64 `json:"priority"`
2019-07-28 13:14:40 +02:00
}