github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/id/custom_provider.go (about)

     1  package id
     2  
     3  import (
     4  	"github.com/onflow/flow-go/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  }