core

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package core holds the types every Vault subsystem needs and that none of them may reach the root package for.

The subsystem packages (secret, flag, config, override, rotation) embed Entity and compare against the sentinel errors. If those lived in the root package, the root could not import the subsystems, and the composed Vault in vault.go could not exist. This package is a leaf: it imports nothing from Vault.

The root package re-exports everything here, so vault.Entity and vault.ErrSecretNotFound continue to work unchanged.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Store errors.
	ErrNoStore = errors.New("vault: no store configured")

	// Key/entity not found errors.
	ErrKeyNotFound      = errors.New("vault: key not found")
	ErrSecretNotFound   = errors.New("vault: secret not found")
	ErrFlagNotFound     = errors.New("vault: flag not found")
	ErrConfigNotFound   = errors.New("vault: config entry not found")
	ErrOverrideNotFound = errors.New("vault: override not found")
	ErrRotationNotFound = errors.New("vault: rotation policy not found")
	ErrAuditNotFound    = errors.New("vault: audit entry not found")
	ErrRunNotFound      = errors.New("vault: workflow run not found")
	ErrDLQNotFound      = errors.New("vault: DLQ entry not found")
	ErrCronNotFound     = errors.New("vault: cron entry not found")
	ErrEventNotFound    = errors.New("vault: event not found")
	ErrWorkflowNotFound = errors.New("vault: workflow not found")

	// Crypto errors.
	ErrDecryptionFailed = errors.New("vault: decryption failed")
	ErrEncryptionFailed = errors.New("vault: encryption failed")
	ErrInvalidKey       = errors.New("vault: invalid encryption key")

	// Feature flag errors.
	ErrFlagDisabled   = errors.New("vault: flag is disabled")
	ErrFlagExists     = errors.New("vault: flag already exists")
	ErrInvalidFlagKey = errors.New("vault: invalid flag key")

	// Rotation errors.
	ErrRotationFailed = errors.New("vault: rotation failed")

	// Auth errors.
	ErrUnauthorized = errors.New("vault: unauthorized")

	// Secret errors.
	ErrSecretExists = errors.New("vault: secret already exists")

	// Config errors.
	ErrConfigExists = errors.New("vault: config entry already exists")

	// ErrConfigVersionNotFound is returned when a config entry exists but
	// has no version with the requested number.
	ErrConfigVersionNotFound = errors.New("vault: config version not found")
)

Sentinel errors for Vault operations.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	CreatedAt time.Time `json:"created_at" grove:"created_at,notnull,default:current_timestamp"`
	UpdatedAt time.Time `json:"updated_at" grove:"updated_at,notnull,default:current_timestamp"`
}

Entity is the base type embedded by all Vault entities. It provides standard timestamp fields.

func NewEntity

func NewEntity() Entity

NewEntity creates a new Entity with both timestamps set to now (UTC).

func (*Entity) Touch

func (e *Entity) Touch()

Touch updates the UpdatedAt timestamp to now (UTC).

Jump to

Keyboard shortcuts

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