database

package
v0.0.0-...-85ffd96 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDatabasePath = "database"
)

Variables

This section is empty.

Functions

func GetDatabasePath

If database path does not exist, then use default database path

Types

type DatabaseCredentialManager

type DatabaseCredentialManager interface {
	// Gets credential from vault
	GetCredential() (*vaultapi.Secret, error)

	// Creates a kubernetes secret containing postgres credential
	CreateSecret(name string, namespace string, credential *vaultapi.Secret) error

	// Creates kubernetes role
	CreateRole(name string, namespace string, secretName string) error

	// Creates kubernetes role binding
	CreateRoleBinding(name string, namespace string, roleName string, subjects []rbacv1.Subject) error

	IsLeaseExpired(leaseID string) (bool, error)

	RevokeLease(leaseID string) error
}

type DatabaseRole

type DatabaseRole struct {
	role.RoleInterface
	// contains filtered or unexported fields
}

func (*DatabaseRole) DeleteRole

func (d *DatabaseRole) DeleteRole(name string) error

https://www.vaultproject.io/api/secret/databases/index.html#delete-role

DeleteRole deletes role It's safe to call multiple time. It doesn't give error even if respective role doesn't exist

func (*DatabaseRole) EnableDatabase

func (d *DatabaseRole) EnableDatabase() error

EnableDatabase enables database secret engine It first checks whether database is enabled or not

func (*DatabaseRole) IsDatabaseEnabled

func (d *DatabaseRole) IsDatabaseEnabled() (bool, error)

IsDatabaseEnabled checks whether database is enabled or not

type DatabaseRoleInterface

type DatabaseRoleInterface interface {
	role.RoleInterface

	// EnableDatabase enables database secret engine
	EnableDatabase() error

	// IsDatabaseEnabled checks whether database is enabled or not
	IsDatabaseEnabled() (bool, error)

	// DeleteRole deletes role
	DeleteRole(name string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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