pwchadm

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(cfg *Config) error

func ChangeUserStatus

func ChangeUserStatus(email string, enable bool, cfg *Config) bool

This function either enables or disables a user in the database.

func InitializeDatabase

func InitializeDatabase(cfg *Config, sqlSchema string) error

Executes the sql schema against the database This is the minimum requirement for the database.

func IsValidEmail

func IsValidEmail(email string) bool

func PrintBuildInfo

func PrintBuildInfo(version string)

func ReadFile

func ReadFile(cfg *Config, configPath string) error

reads config file.

Types

type Config

type Config struct {
	DB struct {
		Host     string `yaml:"host"`
		DBName   string `yaml:"db_name"`
		User     string `yaml:"user"`
		Password string `yaml:"password"`
		SSLMode  string `yaml:"ssl_mode"`
	} `yaml:"db"`
	Bcrypt struct {
		Cost int `yaml:"cost"`
	} `yaml:"bcrypt"`
}

Jump to

Keyboard shortcuts

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