2019-07-28 22:00:09 +03:00
|
|
|
// Package resolver resolves network names to addresses
|
2023-04-11 22:20:37 +03:00
|
|
|
package resolver // import "go.unistack.org/micro/v4/resolver"
|
2019-07-28 14:14:40 +03:00
|
|
|
|
|
|
|
// Resolver is network resolver. It's used to find network nodes
|
2019-07-28 22:00:09 +03:00
|
|
|
// via the name to connect to. This is done based on Network.Name().
|
2019-07-28 14:14:40 +03:00
|
|
|
// Before we can be part of any network, we have to connect to it.
|
|
|
|
type Resolver interface {
|
2019-08-20 14:48:51 +03:00
|
|
|
// Resolve returns a list of addresses for a name
|
2019-07-28 22:00:09 +03:00
|
|
|
Resolve(name string) ([]*Record, error)
|
2019-07-28 14:14:40 +03:00
|
|
|
}
|
|
|
|
|
2020-11-02 13:25:29 +03:00
|
|
|
// Record that resolved
|
2019-07-28 14:14:40 +03:00
|
|
|
type Record struct {
|
2019-10-28 18:31:46 +03:00
|
|
|
Address string `json:"address"`
|
|
|
|
Priority int64 `json:"priority"`
|
2019-07-28 14:14:40 +03:00
|
|
|
}
|