Help us shape the future of Go! Take the 2026 Go Developer Survey

domain

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package domain defines provider-neutral value types shared across every storage backend (AWS, Google Cloud, and Azure services).

It has ZERO knowledge of any cloud SDK: no ARNs, no staging labels, no provider metadata bags. Types here carry only cross-provider essentials so that the usecase and CLI layers can be written once against a single shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// Name is the entry's identifier within its provider namespace.
	Name string
	// Value is the entry's current value.
	Value string
	// Type classifies the value in a provider-neutral way.
	Type ValueType
	// Version identifies the retrieved version.
	Version Version
	// Description is an optional human-readable description.
	Description string
	// Tags are the labels attached to the entry.
	Tags []Tag
	// Modified is the last-modified time, if known.
	Modified *time.Time
	// Extra holds provider-populated, display-only metadata (e.g. an AWS
	// Secrets Manager ARN). Its SHAPE is provider-neutral: a list of neutral
	// Field values, never AWS types or an untyped any. Providers may leave it
	// empty when they have no extra metadata to surface.
	Extra []Field
}

Entry is a provider-neutral retrieved parameter/secret. It carries only cross-provider essentials: no ARN, no provider metadata bag.

type Field

type Field struct {
	// Label is the human-facing field name (e.g. "ARN").
	Label string
	// Value is the pre-formatted display value.
	Value string
}

Field is a neutral, display-only piece of provider metadata surfaced on a read Entry (e.g. an AWS Secrets Manager ARN). It carries a human-facing Label and a pre-formatted string Value only: it is deliberately provider-neutral in SHAPE (no AWS types, no any) so the usecase/CLI layers can render it without knowing which provider produced it. Providers populate Entry.Extra; consumers display it verbatim and never interpret it.

type Tag

type Tag struct{ Key, Value string }

Tag is a single key/value label attached to an entry.

type TagChange

type TagChange struct {
	// Add holds tags to create or update, keyed by tag key.
	Add map[string]string
	// Remove holds tag keys to delete.
	Remove []string
}

TagChange describes staged tag mutations (add/update + remove-by-key).

type ValueType

type ValueType string

ValueType classifies the nature of an entry's value in a provider-neutral way. Providers map their own native types onto these values.

const (
	// ValueTypePlaintext is a plain, non-secret value (e.g. an AWS SSM String).
	ValueTypePlaintext ValueType = "plaintext"
	// ValueTypeSecret is an encrypted/secret value (e.g. an AWS SSM SecureString,
	// or any value of a secret service such as Secrets Manager or Key Vault).
	ValueTypeSecret ValueType = "secret"
	// ValueTypeList is a list of values (e.g. an AWS SSM StringList).
	ValueTypeList ValueType = "list"
)

type Version

type Version struct {
	// ID is the provider-internal version identifier. It is opaque to callers:
	// they display it and hand it back to the same provider, never parse it.
	ID string
	// State is the per-version lifecycle state: "enabled" / "disabled" /
	// "destroyed", or "" when the provider has no such concept. It is a
	// per-version switch controlling whether that version's value can be read
	// (Google Cloud + Azure Key Vault); it is orthogonal to which version is
	// latest. Empty for AWS Secrets Manager, AWS SSM and Azure App Config.
	State string
	// Labels are the movable version labels attached to this version (all of
	// them, e.g. the AWS Secrets Manager staging labels AWSCURRENT /
	// AWSPREVIOUS). A label is a pointer naming a version, not a per-version
	// state. nil/empty for providers without version labels.
	Labels []string
	// Current reports whether this is the version the provider serves as the
	// current value. Adapters set it on History results (exactly one version of
	// a non-empty history); it is not populated on Get.
	Current bool
	// Created is the version creation time, if known.
	Created *time.Time
	// Tags are the labels attached to THIS version. Only Azure Key Vault scopes
	// tags per version (each version has its own); every other provider keeps
	// tags at the resource level (see Entry.Tags) and leaves this nil.
	Tags []Tag
}

Version identifies one version of an entry.

It carries two independent, provider-specific axes that must NOT be conflated (#419):

  • Labels are movable pointers naming "which version is current" (AWS Secrets Manager staging labels: AWSCURRENT / AWSPENDING / AWSPREVIOUS). Rotation moves a label from one version to another; a version may carry several labels or none (unlabeled versions are passively retained history, still readable by ID). Multi-valued.
  • State is a per-version enable/disable switch for reading that specific version's value (Google Cloud + Azure Key Vault). It is single-valued and orthogonal to "which version is latest".

Providers that have neither concept (AWS SSM, Azure App Configuration) leave both empty. Which version is current is decided by the adapter and reported through Current, so callers never infer it from Labels or position.

Jump to

Keyboard shortcuts

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