database

package
v0.0.0-...-a46ed7a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB()

InitDB connects to the database

func InsertTimezone

func InsertTimezone(timezone Timezone) (int, error)

InsertTimezone returns a single timezone from the DB for the given identifier

Types

type Config

type Config struct {
	User string `envconfig:"DBUSER"`
	Name string `envconfig:"DBNAME"`
	Host string `envconfig:"DBHOST"`
	Port string `envconfig:"DBPORT"`
}

Config is a struct that pulls in env vars to configure the database

type Timezone

type Timezone struct {
	ID         int
	Created    string
	Modified   string
	Name       string
	Timeoffset int
	Identifier string
}

func GetAllTimezones

func GetAllTimezones() ([]Timezone, error)

GetAllTimezones returns all timezones from the DB

func GetTimezone

func GetTimezone(identifier string) (Timezone, error)

GetTimezone returns a single timezone from the DB for the given identifier

Jump to

Keyboard shortcuts

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