db

package
v0.0.0-...-6c16969 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() *sql.DB

func GetJobForPerson

func GetJobForPerson(db *sql.DB, personId int) (*[]Job, error)

func GetPersons

func GetPersons(db *sql.DB) (*[]Person, error)

func InsertJob

func InsertJob(db *sql.DB, job *Job) (int, error)

func InsertPerson

func InsertPerson(db *sql.DB, person *Person) (int, error)

Types

type Job

type Job struct {
	Id       int    `json:"id"`
	JobName  string `json:"job_name"`
	PersonId int    `json:"personId"`
}

func GetJob

func GetJob(db *sql.DB, jobId int) (*Job, error)

type Person

type Person struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	PersonId int    `json:"personId"`
	Admin    bool   `json:"admin"`
}

func GetPerson

func GetPerson(db *sql.DB, personId int) (*Person, error)

Jump to

Keyboard shortcuts

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