github.com/koko1123/flow-go-1@v0.29.6/module/id/custom_provider.go (about) 1 package id 2 3 import ( 4 "github.com/koko1123/flow-go-1/model/flow" 5 ) 6 7 // CustomIdentifierProvider implements `module.IdentifierProvider` which provides results from the given function. 8 type CustomIdentifierProvider struct { 9 identifiers func() flow.IdentifierList 10 } 11 12 func NewCustomIdentifierProvider(identifiers func() flow.IdentifierList) *CustomIdentifierProvider { 13 return &CustomIdentifierProvider{identifiers} 14 } 15 16 func (p *CustomIdentifierProvider) Identifiers() flow.IdentifierList { 17 return p.identifiers() 18 }