ancestrymanager

package
v0.0.0-...-0d862b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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

func ConvertToAncestryPath(as []string) string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL