dbuser

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuffixA = "_a"
	SuffixB = "_b"
)

Variables

This section is empty.

Functions

func TrimUserSuffix added in v1.0.6

func TrimUserSuffix(in string) string

TrimUserSuffix removes the suffixes from the given string.

Types

type DBUser

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

DBUser is a struct that holds the usernames for a given role.

func NewDBUser

func NewDBUser(baseName string) DBUser

NewDBUser returns a new DBUser instance.

func (DBUser) GetUserA

func (dbu DBUser) GetUserA() string

GetUserA returns the username for UserA.

func (DBUser) GetUserB

func (dbu DBUser) GetUserB() string

GetUserB returns the username for UserB.

func (DBUser) IsUserChanged

func (dbu DBUser) IsUserChanged(currentUserName string) bool

IsUserChanged checks if the given currentUserName has changed compared to the rolename of the DBUser instance.

func (DBUser) NextUser

func (dbu DBUser) NextUser(curUser string) string

NextUser returns UserB unless the current user is already UserB. Invalid users also return UserB as the next user. This is to prevent changes in current behavior of the func.

Jump to

Keyboard shortcuts

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