{"modulePath":"github.com/chainloop-dev/chainloop","version":"v1.140.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package credentials\n\n## Variables\n\n```go\nvar ErrNotFound = errors.New(\"credentials not found\")\n```\n\n```go\nvar ErrValidation = errors.New(\"credentials validation error\")\n```\n\n## Types\n\n```go\ntype APICreds struct {\n\tHost, Key string\n}\n```\n\n```go\nfunc (a *APICreds) Validate() error\n```\nValidate that the APICreds has all its properties set\n\n```go\ntype OCIKeypair struct {\n\tRepo, Username, Password string\n}\n```\n\n```go\nfunc (o *OCIKeypair) Validate() error\n```\nValidate that the OCIKeypair has all its properties set\n\n```go\ntype Reader interface {\n\tReadCredentials(ctx context.Context, secretName string, credentials any) error\n}\n```\n\n```go\ntype ReaderWriter interface {\n\tReader\n\tWriter\n}\n```\n\n```go\ntype Role int64\n```\n\n```go\nconst (\n\tRoleUnknown Role = iota\n\tRoleReader\n\tRoleWriter\n)\n```\n\n```go\nfunc (r Role) String() string\n```\nImplement string interface for Role\n\n```go\ntype SaveOption func(*SaveOpts)\n```\nSaveOption is a functional option for SaveCredentials.\n\n```go\nfunc WithExistingSecret(name string) SaveOption\n```\nWithExistingSecret instructs SaveCredentials to upsert at the provided existing secret path. An empty name is a no-op (auto-generate behavior is preserved).\n\n```go\ntype SaveOpts struct {\n\t// SecretName when non-empty causes SaveCredentials to upsert at the given path\n\t// instead of generating a new UUID-based path.\n\tSecretName string\n}\n```\nSaveOpts holds optional parameters for SaveCredentials.\n\n```go\nfunc ApplySaveOptions(opts ...SaveOption) SaveOpts\n```\nApplySaveOptions applies the given options and returns the resulting SaveOpts.\n\n```go\ntype Writer interface {\n\tSaveCredentials(ctx context.Context, org string, credentials any, opts ...SaveOption) (string, error)\n\tDeleteCredentials(ctx context.Context, credID string) error\n}\n```\n\n","path":"github.com/chainloop-dev/chainloop/pkg/credentials","name":"credentials","synopsis":"","isRedistributable":true}
