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