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 ¶
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 *transport_tpg.Config, tfData tpgresource.TerraformResourceData, cai *resources.Asset) ([]string, string, error) }
AncestryManager is the interface that fetch ancestors for a resource.
func New ¶
func New(cfg *transport_tpg.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 ¶
type NoOpAncestryManager struct{}
func (*NoOpAncestryManager) Ancestors ¶
func (*NoOpAncestryManager) Ancestors(config *transport_tpg.Config, tfData tpgresource.TerraformResourceData, cai *resources.Asset) ([]string, string, error)