Documentation ¶
Overview ¶
Package ancestrymanager provides an interface to query the ancestry information for a resource.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToAncestryPath ¶ added in v0.15.0
ConvertToAncestryPath composes a path containing organization/folder/project (i.e. "organization/my-org/folder/my-folder/project/my-prj").
Types ¶
type AncestryManager ¶
type AncestryManager interface { // Ancestors returns a list of ancestors. Ancestors(config *resources.Config, tfData resources.TerraformResourceData, cai *resources.Asset) ([]string, string, error) }
AncestryManager is the interface that fetch ancestors for a resource.
func New ¶
func New(cfg *resources.Config, offline bool, entries map[string]string, errorLogger *zap.Logger) (AncestryManager, error)
New returns AncestryManager that can be used to fetch ancestry information. Entries takes `projects/<number>` or `folders/<id>` as key and ancestry path as value to the offline cache. If the key is not prefix with `projects/` or `folders/`, it will be considered as a project. If offline is true, resource manager API requests for ancestry will be disabled.
type NoOpAncestryManager ¶ added in v0.15.0
type NoOpAncestryManager struct{}