manifest

package
v0.0.0-test.20230316.4... Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteManifest

func WriteManifest(context *ManifestWriterContext, manifestToWrite Manifest) error

Types

type Auth

type Auth struct {
	Token AuthSecret
	OAuth OAuth
}

type AuthSecret

type AuthSecret struct {
	// Name is the name of the environment-variable of the token. It is used for converting monaco-v1 to monaco-v2 environments
	// where the value is not resolved, but the env-name has to be kept.
	Name string

	// Value holds the actual token value for the given [Name]. It is empty when converting vom monaco-v1 to monaco-v2
	Value string
}

AuthSecret contains a resolved secret value. It is used for the API-Token, ClientId, and ClientSecret.

type EnvironmentDefinition

type EnvironmentDefinition struct {
	Name  string
	Type  EnvironmentType
	Url   UrlDefinition
	Group string

	Auth Auth
}

EnvironmentDefinition holds all information about a Dynatrace environment

type EnvironmentType

type EnvironmentType int

EnvironmentType is used to identify the type of the environment. Possible values are Classic and Platform

const (
	// Classic identifies a Dynatrace Classic environment
	Classic EnvironmentType = iota

	// Platform identifies a Dynatrace Platform environment
	Platform
)

type Environments

type Environments map[string]EnvironmentDefinition

Environments is a map of environment-name -> EnvironmentDefinition

func (Environments) Names

func (e Environments) Names() []string

Names returns the slice of environment names

type Manifest

type Manifest struct {
	// Projects defined in the manifest, split by project-name
	Projects ProjectDefinitionByProjectId

	// Environments defined in the manifest, split by environment-name
	Environments Environments
}

func LoadManifest

func LoadManifest(context *ManifestLoaderContext) (Manifest, []error)

type ManifestLoaderContext

type ManifestLoaderContext struct {
	Fs           afero.Fs
	ManifestPath string

	// Environments is a filter to what environments should be loaded.
	// If it's empty, all environments are loaded.
	// If both Environments and Groups are specified, the union of both results is returned.
	//
	// If Environments contains items that do not match any environment in the specified manifest file, the loading errors.
	Environments []string

	// Groups is a filter to what environment-groups (and thus environments) should be loaded.
	// If it's empty, all environment-groups are loaded.
	// If both Environments and Groups are specified, the union of both results is returned.
	//
	// If Groups contains items that do not match any environment in the specified manifest file, the loading errors.
	Groups []string
}

type ManifestWriterContext

type ManifestWriterContext struct {
	Fs           afero.Fs
	ManifestPath string
}

type OAuth

type OAuth struct {
	ClientId     AuthSecret
	ClientSecret AuthSecret
}

type ProjectDefinition

type ProjectDefinition struct {
	Name  string
	Group string
	Path  string
}

func (ProjectDefinition) String

func (p ProjectDefinition) String() string

type ProjectDefinitionByProjectId

type ProjectDefinitionByProjectId map[string]ProjectDefinition

type UrlDefinition

type UrlDefinition struct {
	// Type defines whether the [UrlDefinition.Value] is loaded from an env var, or directly.
	Type UrlType

	// Name is the name of the environment-variable of the token. It only has a value if [UrlDefinition.Type] is "[EnvironmentUrlType]"
	Name string

	// Value is the resolved value of the Url.
	// It is resolved during manifest reading.
	Value string
}

UrlDefinition holds the value and origin of an environment-url.

type UrlType

type UrlType int

UrlType describes from where the url is loaded. Possible values are EnvironmentUrlType and ValueUrlType. ValueUrlType is the default value.

const (
	// ValueUrlType describes that the url has been loaded directly as a value
	ValueUrlType UrlType = iota

	// EnvironmentUrlType describes that the url has been loaded from an environment variable
	EnvironmentUrlType
)

Jump to

Keyboard shortcuts

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