manifest

package
v2.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package manifest and its subpackages contains all information regarding the in-memory definitions of manifests, as well as the persistence layer, loading, and writing. To load use the [loader] package, to write use the [writer] package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJSONSchema added in v2.10.0

func GenerateJSONSchema() ([]byte, error)

Types

type Account added in v2.9.2

type Account struct {
	// Name is the account-name that is used to resolve user-defined lookup names.
	Name string

	// AccountUUID is the Dynatrace-account UUID
	AccountUUID uuid.UUID

	// ApiUrl is the target URL of this account.
	// It is used when the default account management url is not the target account management url.
	ApiUrl *URLDefinition

	// OAuth holds the OAuth credentials used to access the account API.
	OAuth OAuth
}

Account holds all necessary information to access the account API

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 secret.MaskedString
}

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

type EnvironmentDefinition

type EnvironmentDefinition struct {
	Name  string
	Group string
	URL   URLDefinition
	Auth  Auth
}

EnvironmentDefinition holds all information about a Dynatrace environment

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

	// Accounts holds all accounts defined in the manifest. Key is the user-defined account name.
	Accounts map[string]Account
}

Manifest is the central component. It holds all information that is needed to deploy projects.

type OAuth

type OAuth struct {
	ClientID      AuthSecret
	ClientSecret  AuthSecret
	TokenEndpoint *URLDefinition
}

func (OAuth) GetTokenEndpointValue

func (o OAuth) GetTokenEndpointValue() string

GetTokenEndpointValue returns the defined token endpoint or the default token endpoint if none is defined

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
)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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