dbuser

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorNotFound is returned when an database user was not found
	ErrorNotFound = errors.New("database user not found")
)

Functions

func DiffSpecs

func DiffSpecs(a, b *User) string

func EqualSpecs

func EqualSpecs(spec, atlas *User) bool

EqualSpecs returns true if the given users have the same specs

Types

type AtlasUsers

type AtlasUsers struct {
	// contains filtered or unexported fields
}

func NewAtlasDatabaseUsersService

func NewAtlasDatabaseUsersService(ctx context.Context, provider atlas.Provider, secretRef *types.NamespacedName, log *zap.SugaredLogger) (*AtlasUsers, error)

func NewAtlasUsers

func NewAtlasUsers(api admin.DatabaseUsersApi) *AtlasUsers

func (*AtlasUsers) Create

func (dus *AtlasUsers) Create(ctx context.Context, au *User) error

func (*AtlasUsers) Delete

func (dus *AtlasUsers) Delete(ctx context.Context, db, projectID, username string) error

func (*AtlasUsers) Get

func (dus *AtlasUsers) Get(ctx context.Context, db, projectID, username string) (*User, error)

func (*AtlasUsers) Update

func (dus *AtlasUsers) Update(ctx context.Context, au *User) error

type AtlasUsersService

type AtlasUsersService interface {
	Get(ctx context.Context, db, projectID, username string) (*User, error)
	Delete(ctx context.Context, db, projectID, username string) error
	Create(ctx context.Context, au *User) error
	Update(ctx context.Context, au *User) error
}

type User

type User struct {
	*akov2.AtlasDatabaseUserSpec
	Password  string
	ProjectID string
}

func NewUser

func NewUser(spec *akov2.AtlasDatabaseUserSpec, projectID, password string) (*User, error)

NewUser wraps and normalizes a Kubernetes Atlas User Spec pointer augmenting it with projectID and password.

Jump to

Keyboard shortcuts

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