backend

package
v0.0.0-...-9917ce2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(port string, db *sql.DB)

Run the server on the given port, connecting to the given database.

func SetPassword

func SetPassword(user, password string, db *sql.DB) error

SetPassword sets the given user's password. TODO: We should not need to export this.

Types

type DB

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

func NewDB

func NewDB(db *sql.DB) DB

func (DB) DeleteUser

func (d DB) DeleteUser(user string) error

DeleteUser removes the given user.

func (DB) Init

func (d DB) Init()

Init clears and initialises the database with the expected tables. TODO: Figure out how to handle errors (DROP TABLEs can fail, but nothing

else).

func (DB) SetIsManager

func (d DB) SetIsManager(user string, isManager bool) error

SetIsManager updates the manager flag on the given user.

Jump to

Keyboard shortcuts

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