github.com/lyraproj/hiera@v1.0.0-rc4/provider/scopelookupkey.go (about)

     1  package provider
     2  
     3  import (
     4  	"github.com/lyraproj/dgo/dgo"
     5  	"github.com/lyraproj/hiera/api"
     6  	"github.com/lyraproj/hierasdk/hiera"
     7  )
     8  
     9  // ScopeLookupKey is a function that performs a lookup in the current scope.
    10  func ScopeLookupKey(pc hiera.ProviderContext, key string) dgo.Value {
    11  	sc, ok := pc.(api.ServerContext)
    12  	if !ok {
    13  		return nil
    14  	}
    15  	return sc.Invocation().Scope().Get(key)
    16  }