rename record discovery options
This commit is contained in:
parent
f57d2bf05d
commit
2ecf526993
2 changed files with 8 additions and 8 deletions
|
|
@ -79,8 +79,8 @@ type Service struct {
|
|||
|
||||
type ServiceOptions struct {
|
||||
Records map[string]NameRecords
|
||||
Discoverer func() (map[string]NameRecords, error)
|
||||
FallbackDiscoverer func() (map[string]NameRecords, error)
|
||||
RecordDiscoverer func() (map[string]NameRecords, error)
|
||||
FallbackRecordDiscoverer func() (map[string]NameRecords, error)
|
||||
MainchainAliasClient *MainchainAliasClient
|
||||
HSDClient *HSDClient
|
||||
ChainAliasActionCaller ActionCaller
|
||||
|
|
@ -126,8 +126,8 @@ func NewService(options ServiceOptions) *Service {
|
|||
mainchainAliasClient: options.MainchainAliasClient,
|
||||
chainAliasActionCaller: options.ChainAliasActionCaller,
|
||||
chainAliasAction: options.ChainAliasAction,
|
||||
recordDiscoverer: options.Discoverer,
|
||||
fallbackRecordDiscoverer: options.FallbackDiscoverer,
|
||||
recordDiscoverer: options.RecordDiscoverer,
|
||||
fallbackRecordDiscoverer: options.FallbackRecordDiscoverer,
|
||||
chainAliasDiscoverer: options.ChainAliasDiscoverer,
|
||||
fallbackChainAliasDiscoverer: options.FallbackChainAliasDiscoverer,
|
||||
treeRootCheckInterval: checkInterval,
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ func TestServiceDiscoverReplacesRecordsFromDiscoverer(t *testing.T) {
|
|||
A: []string{"10.11.11.11"},
|
||||
},
|
||||
},
|
||||
Discoverer: func() (map[string]NameRecords, error) {
|
||||
RecordDiscoverer: func() (map[string]NameRecords, error) {
|
||||
next := records[index%len(records)]
|
||||
index++
|
||||
return next, nil
|
||||
|
|
@ -859,11 +859,11 @@ func TestServiceDiscoverFallsBackWhenPrimaryDiscovererFails(t *testing.T) {
|
|||
A: []string{"10.11.11.11"},
|
||||
},
|
||||
},
|
||||
Discoverer: func() (map[string]NameRecords, error) {
|
||||
RecordDiscoverer: func() (map[string]NameRecords, error) {
|
||||
primaryCalled = true
|
||||
return nil, errors.New("chain service unavailable")
|
||||
},
|
||||
FallbackDiscoverer: func() (map[string]NameRecords, error) {
|
||||
FallbackRecordDiscoverer: func() (map[string]NameRecords, error) {
|
||||
fallbackCalled = true
|
||||
return map[string]NameRecords{
|
||||
"gateway.charon.lthn": {
|
||||
|
|
@ -904,7 +904,7 @@ func TestServiceDiscoverUsesFallbackOnlyWhenPrimaryMissing(t *testing.T) {
|
|||
A: []string{"10.11.11.11"},
|
||||
},
|
||||
},
|
||||
FallbackDiscoverer: func() (map[string]NameRecords, error) {
|
||||
FallbackRecordDiscoverer: func() (map[string]NameRecords, error) {
|
||||
fallbackCalled = true
|
||||
return map[string]NameRecords{
|
||||
"gateway.charon.lthn": {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue