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

credentials

package
v1.94.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("credentials not found")
View Source
var ErrValidation = errors.New("credentials validation error")

Functions

This section is empty.

Types

type APICreds

type APICreds struct {
	Host, Key string
}

func (*APICreds) Validate

func (a *APICreds) Validate() error

Validate that the APICreds has all its properties set

type OCIKeypair

type OCIKeypair struct {
	Repo, Username, Password string
}

func (*OCIKeypair) Validate

func (o *OCIKeypair) Validate() error

Validate that the OCIKeypair has all its properties set

type Reader

type Reader interface {
	ReadCredentials(ctx context.Context, secretName string, credentials any) error
}

type ReaderWriter

type ReaderWriter interface {
	Reader
	Writer
}

type Role

type Role int64
const (
	RoleUnknown Role = iota
	RoleReader
	RoleWriter
)

func (Role) String

func (r Role) String() string

Implement string interface for Role

type SaveOption added in v1.85.0

type SaveOption func(*SaveOpts)

SaveOption is a functional option for SaveCredentials.

func WithExistingSecret added in v1.85.0

func WithExistingSecret(name string) SaveOption

WithExistingSecret instructs SaveCredentials to upsert at the provided existing secret path. An empty name is a no-op (auto-generate behavior is preserved).

type SaveOpts added in v1.85.0

type SaveOpts struct {
	// SecretName when non-empty causes SaveCredentials to upsert at the given path
	// instead of generating a new UUID-based path.
	SecretName string
}

SaveOpts holds optional parameters for SaveCredentials.

func ApplySaveOptions added in v1.85.0

func ApplySaveOptions(opts ...SaveOption) SaveOpts

ApplySaveOptions applies the given options and returns the resulting SaveOpts.

type Writer

type Writer interface {
	SaveCredentials(ctx context.Context, org string, credentials any, opts ...SaveOption) (string, error)
	DeleteCredentials(ctx context.Context, credID string) error
}

Directories

Path Synopsis
api
aws
gcp
KeyVal V2 secrets implementation for Hashicorp Vault
KeyVal V2 secrets implementation for Hashicorp Vault

Jump to

Keyboard shortcuts

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