ancestrymanager

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

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

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 *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{}

func (*NoOpAncestryManager) Ancestors added in v0.15.0

Jump to

Keyboard shortcuts

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