admin

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePassword

func ChangePassword(ctx context.Context, pg *pgx.Conn, username, password string) error

func CreateUser

func CreateUser(ctx context.Context, pg *pgx.Conn, username string, password string) error

func GrantSuperuser

func GrantSuperuser(ctx context.Context, pg *pgx.Conn, username string) error

Types

type DbInfo

type DbInfo struct {
	Name  string   `json:"name"`
	Users []string `json:"users"`
}

func ListDatabases

func ListDatabases(ctx context.Context, pg *pgx.Conn) ([]DbInfo, error)

type UserInfo

type UserInfo struct {
	Username     string   `json:"username"`
	SuperUser    bool     `json:"superuser"`
	Databases    []string `json:"databases"`
	PasswordHash string   `json:"-"`
}

func FindUser

func FindUser(ctx context.Context, pg *pgx.Conn, username string) (*UserInfo, error)

func ListUsers

func ListUsers(ctx context.Context, pg *pgx.Conn) ([]UserInfo, error)

func (UserInfo) IsPassword

func (ui UserInfo) IsPassword(password string) bool

Jump to

Keyboard shortcuts

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