config

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config re-exports the dtctl session layer from github.com/Dynatrace/dtctl/sdk/session, where the implementation moved: the config model, load/save, credential stores, and token resolution are the shared contract consumed by dtctl and dtctl-* plugins; this package remains so the root module's import surface is stable. New code (and external consumers) should import sdk/session directly.

Index

Constants

View Source
const (
	SafetyLevelReadOnly                = session.SafetyLevelReadOnly
	SafetyLevelReadWriteMine           = session.SafetyLevelReadWriteMine
	SafetyLevelReadWriteAll            = session.SafetyLevelReadWriteAll
	SafetyLevelDangerouslyUnrestricted = session.SafetyLevelDangerouslyUnrestricted
	DefaultSafetyLevel                 = session.DefaultSafetyLevel
)

Safety levels — the shared semantics of a context's safety-level field.

View Source
const (
	CurrentAPIVersion = session.CurrentAPIVersion
	LocalConfigName   = session.LocalConfigName
)

Schema and file-discovery constants.

View Source
const (
	KeyringService         = session.KeyringService
	EnvDisableKeyring      = session.EnvDisableKeyring
	EnvTokenStorage        = session.EnvTokenStorage
	ErrMsgCollectionUnlock = session.ErrMsgCollectionUnlock
)

Credential-store constants.

View Source
const (
	ProfileEnvVar = session.ProfileEnvVar
	ProfileFull   = session.ProfileFull
)
View Source
const (
	StabilityDevelopment  = session.StabilityDevelopment
	StabilityExperimental = session.StabilityExperimental
	StabilityStable       = session.StabilityStable
	DefaultStabilityLevel = session.DefaultStabilityLevel
	DefaultMinStability   = session.DefaultMinStability

	MinStabilityEnvVar = session.MinStabilityEnvVar
	DevelopmentEnvVar  = session.DevelopmentEnvVar
	NoDeprecatedEnvVar = session.NoDeprecatedEnvVar
	DevelopmentAll     = session.DevelopmentAll
)

Stability tiers (what dtctl promises about a command's shape over time) — the ordered axis and its config/environment resolution live with the Config type in sdk/session; declaration and *enforcement* stay in pkg/stability and cmd/.

View Source
const EnvConfig = session.EnvConfig

Explicit-config environment variable — see sdk/session.EnvConfig.

Variables

This section is empty.

Functions

func BuiltinProfileNames

func BuiltinProfileNames() []string

func CacheDir

func CacheDir() string

func CheckKeyring

func CheckKeyring() error

func ConfigDir

func ConfigDir() string

func DataDir

func DataDir() string

func DefaultConfigPath

func DefaultConfigPath() string

XDG paths.

func EnsureKeyringCollection

func EnsureKeyringCollection(ctx context.Context) error

func FileTokenStorageConsentPath

func FileTokenStorageConsentPath() string

func FindLocalConfig

func FindLocalConfig() string

Config loading and discovery.

func GetTokenWithFallback

func GetTokenWithFallback(cfg *Config, tokenRef string) (string, error)

func IsFileTokenStorage

func IsFileTokenStorage() bool

func IsKeyringAbsent

func IsKeyringAbsent(err error) bool

func IsKeyringAvailable

func IsKeyringAvailable() bool

func IsOAuthStorageAvailable

func IsOAuthStorageAvailable() bool

func KeyringBackend

func KeyringBackend() string

func MigrateTokensToKeyring

func MigrateTokensToKeyring(cfg *Config) (int, error)

func OAuthStorageBackend

func OAuthStorageBackend() string

func PersistFileTokenStorage

func PersistFileTokenStorage() error

func StateDir

func StateDir() string

func ValidateAliasName

func ValidateAliasName(name string) error

Alias name validation (alias data lives in the shared schema; alias execution stays in cmd/).

Types

type AliasEntry

type AliasEntry = session.AliasEntry

Config model — see sdk/session.

type AliasFile

type AliasFile = session.AliasFile

Config model — see sdk/session.

type Config

type Config = session.Config

Config model — see sdk/session.

func Load

func Load() (*Config, error)

func LoadFrom

func LoadFrom(path string) (*Config, error)

func LoadFromWithoutExpansion

func LoadFromWithoutExpansion(p string) (*Config, error)

func LoadWithoutExpansion

func LoadWithoutExpansion() (*Config, error)

func NewConfig

func NewConfig() *Config

type Context

type Context = session.Context

Config model — see sdk/session.

type ContextOptions

type ContextOptions = session.ContextOptions

Config model — see sdk/session.

type Hooks

type Hooks = session.Hooks

Config model — see sdk/session.

type NamedContext

type NamedContext = session.NamedContext

Config model — see sdk/session.

type NamedToken

type NamedToken = session.NamedToken

Config model — see sdk/session.

type OAuthFileStore

type OAuthFileStore = session.OAuthFileStore

Credential stores.

func NewOAuthFileStore

func NewOAuthFileStore() *OAuthFileStore

func NewOAuthFileStoreWithDir

func NewOAuthFileStoreWithDir(dir string) *OAuthFileStore

type Preferences

type Preferences = session.Preferences

Config model — see sdk/session.

type Profile

type Profile = session.Profile

Command profiles (default-deny allowlists of commands) — the schema and resolution live with the Config type in sdk/session; profile *enforcement* stays in cmd/.

type QueryLimits

type QueryLimits = session.QueryLimits

Config model — see sdk/session.

type SafetyLevel

type SafetyLevel = session.SafetyLevel

Config model — see sdk/session.

func ValidSafetyLevels

func ValidSafetyLevels() []SafetyLevel

ValidSafetyLevels returns all valid safety level values.

type SpillConfig

type SpillConfig = session.SpillConfig

Config model — see sdk/session.

type StabilityLevel

type StabilityLevel = session.StabilityLevel

Config model — see sdk/session.

func ParseStabilityLevel

func ParseStabilityLevel(s string) (StabilityLevel, error)

ParseStabilityLevel validates and normalizes a user-written stability level.

func ValidStabilityLevels

func ValidStabilityLevels() []StabilityLevel

ValidStabilityLevels returns the stability levels in ascending order of promise.

type TokenStore

type TokenStore = session.TokenStore

Credential stores.

func NewTokenStore

func NewTokenStore() *TokenStore

Jump to

Keyboard shortcuts

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