secret

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreateTypeOrgRepo represents a query to create an
	// index on the secrets table for the type, org and repo columns.
	CreateTypeOrgRepo = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org_repo
ON secrets (type, org, repo);
`
	// CreateTypeOrgTeam represents a query to create an
	// index on the secrets table for the type, org and team columns.
	CreateTypeOrgTeam = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org_team
ON secrets (type, org, team);
`
	// CreateTypeOrg represents a query to create an
	// index on the secrets table for the type, and org columns.
	CreateTypeOrg = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org
ON secrets (type, org);
`
)
View Source
const (
	// CreatePostgresTable represents a query to create the Postgres secrets table.
	CreatePostgresTable = `` /* 624-byte string literal not displayed */

	// CreateSqliteTable represents a query to create the Sqlite secrets table.
	CreateSqliteTable = `` /* 563-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func New

func New(opts ...EngineOpt) (*engine, error)

New creates and returns a Vela service for integrating with secrets in the database.

Types

type EngineOpt

type EngineOpt func(*engine) error

EngineOpt represents a configuration option to initialize the database engine for Secrets.

func WithClient

func WithClient(client *gorm.DB) EngineOpt

WithClient sets the gorm.io/gorm client in the database engine for Secrets.

func WithContext added in v0.21.0

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for Secrets.

func WithEncryptionKey

func WithEncryptionKey(key string) EngineOpt

WithEncryptionKey sets the encryption key in the database engine for Secrets.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Secrets.

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

WithSkipCreation sets the skip creation logic in the database engine for Secrets.

type SecretInterface added in v0.20.0

type SecretInterface interface {

	// CreateSecretIndexes defines a function that creates the indexes for the secrets table.
	CreateSecretIndexes(context.Context) error
	// CreateSecretTable defines a function that creates the secrets table.
	CreateSecretTable(context.Context, string) error

	// CountSecrets defines a function that gets the count of all secrets.
	CountSecrets(context.Context) (int64, error)
	// CountSecretsForOrg defines a function that gets the count of secrets by org name.
	CountSecretsForOrg(context.Context, string, map[string]interface{}) (int64, error)
	// CountSecretsForRepo defines a function that gets the count of secrets by org and repo name.
	CountSecretsForRepo(context.Context, *library.Repo, map[string]interface{}) (int64, error)
	// CountSecretsForTeam defines a function that gets the count of secrets by org and team name.
	CountSecretsForTeam(context.Context, string, string, map[string]interface{}) (int64, error)
	// CountSecretsForTeams defines a function that gets the count of secrets by teams within an org.
	CountSecretsForTeams(context.Context, string, []string, map[string]interface{}) (int64, error)
	// CreateSecret defines a function that creates a new secret.
	CreateSecret(context.Context, *library.Secret) (*library.Secret, error)
	// DeleteSecret defines a function that deletes an existing secret.
	DeleteSecret(context.Context, *library.Secret) error
	// GetSecret defines a function that gets a secret by ID.
	GetSecret(context.Context, int64) (*library.Secret, error)
	// GetSecretForOrg defines a function that gets a secret by org name.
	GetSecretForOrg(context.Context, string, string) (*library.Secret, error)
	// GetSecretForRepo defines a function that gets a secret by org and repo name.
	GetSecretForRepo(context.Context, string, *library.Repo) (*library.Secret, error)
	// GetSecretForTeam defines a function that gets a secret by org and team name.
	GetSecretForTeam(context.Context, string, string, string) (*library.Secret, error)
	// ListSecrets defines a function that gets a list of all secrets.
	ListSecrets(context.Context) ([]*library.Secret, error)
	// ListSecretsForOrg defines a function that gets a list of secrets by org name.
	ListSecretsForOrg(context.Context, string, map[string]interface{}, int, int) ([]*library.Secret, int64, error)
	// ListSecretsForRepo defines a function that gets a list of secrets by org and repo name.
	ListSecretsForRepo(context.Context, *library.Repo, map[string]interface{}, int, int) ([]*library.Secret, int64, error)
	// ListSecretsForTeam defines a function that gets a list of secrets by org and team name.
	ListSecretsForTeam(context.Context, string, string, map[string]interface{}, int, int) ([]*library.Secret, int64, error)
	// ListSecretsForTeams defines a function that gets a list of secrets by teams within an org.
	ListSecretsForTeams(context.Context, string, []string, map[string]interface{}, int, int) ([]*library.Secret, int64, error)
	// UpdateSecret defines a function that updates an existing secret.
	UpdateSecret(context.Context, *library.Secret) (*library.Secret, error)
}

SecretInterface represents the Vela interface for secret functions with the supported Database backends.

Jump to

Keyboard shortcuts

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