accountsvr

package
v0.0.0-...-1f03512 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseKeyDSN      = "dsn"
	DatabaseKeyUsername = "username"
	DatabaseKeyPassword = "password"
	DatabaseKeyHost     = "host"
	DatabaseKeyPort     = "port"
	DatabaseKeySchema   = "schema"
	DatabaseKeyDatabase = "database"
	DatabaseKeyOnDelete = "onDelete"
)
View Source
const (
	PostgreSQLNameDataLen = 64
)

Variables

View Source
var (
	ErrInvalidName = errors.New("invalid name")

	ErrRoleExists = errors.New("role already exists")
)

Functions

func GenerateDSN

func GenerateDSN(secret *corev1.Secret) string

Types

type Server

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

func NewServer

func NewServer(ctx context.Context, connString string) (*Server, error)

func (*Server) CheckInvalidName

func (s *Server) CheckInvalidName(name string) (string, error)

func (*Server) Close

func (s *Server) Close(ctx context.Context) error

func (*Server) Connect

func (s *Server) Connect(ctx context.Context) error

func (*Server) CopyConfigToSecret

func (s *Server) CopyConfigToSecret(secret *corev1.Secret)

func (*Server) CreateDatabase

func (s *Server) CreateDatabase(ctx context.Context, dbName, roleName string) (string, error)

func (*Server) CreateRole

func (s *Server) CreateRole(ctx context.Context, roleName string) (string, string, error)

func (*Server) CreateSchema

func (s *Server) CreateSchema(ctx context.Context, schemaName, roleName string) error

func (*Server) Delete

func (s *Server) Delete(ctx context.Context, name string) error

func (*Server) IsDatabase

func (s *Server) IsDatabase(ctx context.Context, dbName string) (string, bool, error)

func (*Server) IsRole

func (s *Server) IsRole(ctx context.Context, roleName string) (bool, error)

func (*Server) ListUsers

func (s *Server) ListUsers(ctx context.Context) []string

func (*Server) UpdateRolePassword

func (s *Server) UpdateRolePassword(ctx context.Context, roleName string) (string, string, error)

Jump to

Keyboard shortcuts

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