database

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

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

Go to latest
Published: Feb 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SimpleDateFormat        = "2006-01-02"
	DBconnectAttempt        = 3
	DBconnectBackoffSeconds = 10
)

Variables

This section is empty.

Functions

func GetExclusionList

func GetExclusionList(db *gorm.DB) []int

func GetPicksForDay

func GetPicksForDay(db *gorm.DB, day time.Time) []int

func InitPostgres

func InitPostgres(cfg *config.AppConfig) *gorm.DB

func ParsePicksToIntArr

func ParsePicksToIntArr(pickStr string) []int

func PersistPicks

func PersistPicks(db *gorm.DB, today time.Time, picks []int) error

func SimpleDay

func SimpleDay(t time.Time) time.Time

Types

type History

type History struct {
	Date     string
	Projects string
}

func (*History) Render

func (c *History) Render(w http.ResponseWriter, r *http.Request) error

type HistoryList

type HistoryList []*History

func GetHistoryDB

func GetHistoryDB(db *gorm.DB) HistoryList

type Pick

type Pick struct {
	gorm.Model
	// 1,2,3,4,5 format
	Picks string
	// day of pick
	Date time.Time `gorm:"unique"`
}

Jump to

Keyboard shortcuts

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