models

package
v0.0.0-...-3088141 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CURRENT_MIGRATION_VERSION = 1
)

Variables

This section is empty.

Functions

func CreateMigrationTable

func CreateMigrationTable(db *sql.DB) error

func PrepareDB

func PrepareDB() *sql.DB

func WriteSchedules

func WriteSchedules(schedules []*Schedule, db *sql.DB) error

Types

type Migration

type Migration struct {
	ID   int
	Time time.Time
}

func GetLatestMigration

func GetLatestMigration(db *sql.DB) (*Migration, error)

func (*Migration) Write

func (m *Migration) Write(db *sql.DB) error

type Schedule

type Schedule struct {
	ID            int
	Path          string
	Size          int64
	ModTime       time.Time
	TimeToDestroy time.Time
}

func FindSchedule

func FindSchedule(path string, db *sql.DB) (*Schedule, error)

func GetAllSchedules

func GetAllSchedules(db *sql.DB) ([]*Schedule, error)

func GetDueSchedules

func GetDueSchedules(db *sql.DB) ([]*Schedule, error)

func (*Schedule) Remove

func (s *Schedule) Remove(db *sql.DB) error

Jump to

Keyboard shortcuts

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