micro/network/resolver/resolver.go

16 lines
460 B
Go
Raw Normal View History

2019-06-24 15:11:11 +01:00
// Package resolver resolves network ids to addresses
package resolver
2019-07-01 23:11:55 +01:00
// Resolver is network resolver. It's used to find network nodes
// via id to connect to. This is done based on Network.Id().
// Before we can be part of any network, we have to connect to it.
2019-06-24 15:11:11 +01:00
type Resolver interface {
// Resolve returns a list of addresses for an id
Resolve(id string) ([]*Record, error)
}
2019-06-24 15:22:12 +01:00
// A resolved record
2019-06-24 15:11:11 +01:00
type Record struct {
2019-06-24 15:21:24 +01:00
Address string `json:"address"`
2019-06-24 15:11:11 +01:00
}