Move the network resolver out (#1944)

This commit is contained in:
Asim Aslam
2020-08-18 21:38:29 +01:00
committed by GitHub
parent 2eac8ed64f
commit 5d6b7b3d7d
9 changed files with 14 additions and 64 deletions

16
resolver/resolver.go Normal file
View File

@@ -0,0 +1,16 @@
// Package resolver resolves network names to addresses
package resolver
// Resolver is network resolver. It's used to find network nodes
// via the name to connect to. This is done based on Network.Name().
// 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
Resolve(name string) ([]*Record, error)
}
// A resolved record
type Record struct {
Address string `json:"address"`
Priority int64 `json:"priority"`
}