Documentation ¶
Index ¶
- type Connector
- func (c Connector) AddUserRole(role string, username string, database string) error
- func (c Connector) CreateLogin(username string, password string) error
- func (c Connector) CreateUser(username string, loginName string, database string) error
- func (c Connector) DeleteLogin(username string) error
- func (c Connector) DeleteUser(username string, database string) error
- func (c Connector) Execute(command string, args ...interface{}) error
- func (c Connector) GetLogin(username string) (*Login, error)
- func (c Connector) GetUser(username string, database string) (*User, error)
- func (c Connector) GetUserRoles(username string, database string) ([]string, error)
- func (c Connector) Query(query string, scanner func(*sql.Rows) error, args ...interface{}) error
- func (c Connector) RemoveUserRole(role string, username string, database string) error
- func (c Connector) UpdateLogin(username string, password string) error
- func (c Connector) UpdateUser(username string, loginName string) error
- type Login
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
ConnectionString string
}
Connector stores connection information for the SQL Server instance and contains instance methods that can run SQL queries and commands
func (Connector) AddUserRole ¶
func (Connector) CreateLogin ¶
CreateLogin connects to the SQL Database to create a login with the provided credentials
func (Connector) CreateUser ¶
func (Connector) DeleteLogin ¶
DeleteLogin connects to the SQL Database and removes a login with the provided username, if it exists. If it does not exist, this is a noop.
func (Connector) GetLogin ¶
GetLogin reads a login from the SQL Database, if it exists. If it does not, no error is returned, but the returned Login is nil
func (Connector) GetUserRoles ¶
func (Connector) RemoveUserRole ¶
func (Connector) UpdateLogin ¶
UpdateLogin updates the password of a login, if it exists.
Click to show internal directories.
Click to hide internal directories.