Documentation
¶
Overview ¶
Package gcloudversion provides version spec parsing for Google Cloud Secret Manager (name#VERSION~SHIFT).
Google Cloud secret versions are positive integers (1, 2, 3, ...) or the "latest" alias; there are NO staging labels. The grammar therefore mirrors the SSM Parameter Store grammar (an integer #VERSION plus ~SHIFT) rather than the Secrets Manager one, and a ":LABEL" specifier is rejected at parse time with a clear error so the mistake never reaches the provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidVersion is returned when # is not followed by a version number. ErrInvalidVersion = errors.New("# must be followed by a version number") // ErrLabelUnsupported is returned when a :LABEL specifier is used. Google // Cloud Secret Manager has no staging labels (versions are integers or // "latest"), so a colon specifier is always invalid. ErrLabelUnsupported = errors.New( ": staging labels are not supported for Google Cloud Secret Manager " + "(versions are integers or \"latest\")", ) )
Google Cloud Secret Manager-specific errors.
Functions ¶
Types ¶
type AbsoluteSpec ¶
type AbsoluteSpec struct {
Version *int64 // Explicit version number (#VERSION)
}
AbsoluteSpec represents the absolute version specifier for Google Cloud Secret Manager.
type Spec ¶
type Spec = version.Spec[AbsoluteSpec]
Spec represents a parsed Google Cloud Secret Manager version specification.
Grammar: <name>[#<N>]<shift>*
- #<N> optional version number (0 or 1)
- <shift> ~ or ~<N>, repeatable (0 or more, cumulative)
A ":LABEL" specifier is rejected: Google Cloud has no staging labels.
Examples: my-secret, my-secret#3, my-secret~1, my-secret#5~2, my-secret~~.