sqlite

package
v0.0.0-...-041f5a1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sqlite

type Sqlite struct {
	DBFile string `toml:"db_file"`
}

Sqlite only requires a path to the database file

func (*Sqlite) AddCheck

func (s *Sqlite) AddCheck(check gogios.Check, output string) error

AddCheck makes sure an entry exists for the check and then adds to its history

func (*Sqlite) AddUser

func (s *Sqlite) AddUser(user gogios.User) error

AddUser inserts a new user into the database

func (*Sqlite) DeleteCheck

func (s *Sqlite) DeleteCheck(check gogios.Check, field string) error

DeleteCheck will remove a row from the check table based on the ID

func (*Sqlite) DeleteUser

func (s *Sqlite) DeleteUser(user gogios.User) error

DeleteUser sets the DeletedAt value of the user and blanks their password

func (*Sqlite) Description

func (s *Sqlite) Description() string

Description returns a brief explanation of the database

func (*Sqlite) GetAllChecks

func (s *Sqlite) GetAllChecks() ([]gogios.Check, error)

GetAllChecks returns all the rows in the check table

func (*Sqlite) GetCheck

func (s *Sqlite) GetCheck(searchField, searchType string) (gogios.Check, error)

GetCheck returns a single row. Searches using field (title or id) and returns the last record that matches

func (*Sqlite) GetCheckHistory

func (s *Sqlite) GetCheckHistory(check gogios.Check, amount int) ([]gogios.CheckHistory, error)

GetCheckHistory returns $amount of rows of history for a check

func (*Sqlite) GetUser

func (s *Sqlite) GetUser(user string) (*gogios.User, error)

GetUser looks up a user by username and returns their struct

func (*Sqlite) Init

func (s *Sqlite) Init() error

Init creates the database file and tables

func (*Sqlite) SampleConfig

func (s *Sqlite) SampleConfig() string

SampleConfig returns the default config for Sqlite

func (*Sqlite) SubConfig

func (s *Sqlite) SubConfig() string

SubConfig returns the default config ready for variable substitution

Jump to

Keyboard shortcuts

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