database

package
v0.0.0-...-be527b4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB()

CreateDB creates an empty database

func InitDB

func InitDB()

InitDB From article by Karl Seguin (http://openmymind.net/Golang-Hot-Configuration-Reload/)

func LoadDB

func LoadDB(fail bool)

LoadDB is a method to load the database into memory

Types

type UserDatabase

type UserDatabase struct {
	Users []pwMan.UserInformation `json:"users"`
}

UserDatabase is the base JSON where users are stored

func GetDB

func GetDB() *UserDatabase

GetDB returns the database

func (*UserDatabase) AddUser

func (udb *UserDatabase) AddUser(u pwMan.UserInformation) string

AddUser adds a user

func (*UserDatabase) FindUser

func (udb *UserDatabase) FindUser(username string) *pwMan.UserInformation

FindUser returns user object if found

func (*UserDatabase) Save

func (udb *UserDatabase) Save()

Save saves the JSON db :-)

Jump to

Keyboard shortcuts

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