sqlite

package
v0.0.0-...-8bfef16 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func New

func New(storagePath string) (*Storage, error)

func (*Storage) AddTarget

func (s *Storage) AddTarget(missionID int64, name, country, notes string) (int64, error)

func (*Storage) AssignCatToMission

func (s *Storage) AssignCatToMission(missionID, catID int64) error

func (*Storage) CatExists

func (s *Storage) CatExists(id int64) (bool, error)

func (*Storage) CreateCat

func (s *Storage) CreateCat(name string, yearsOfExperience int, breed string, salary float64) (int64, error)

func (*Storage) CreateMission

func (s *Storage) CreateMission(catID sql.NullInt64, targets []common.Target, complete bool) (int64, error)

func (*Storage) DeleteCat

func (s *Storage) DeleteCat(id int64) error

func (*Storage) DeleteMission

func (s *Storage) DeleteMission(missionIDs []int64) error

DeleteMission always deletes the mission, regardless of whether it is assigned to a cat.

func (*Storage) DeleteTarget

func (s *Storage) DeleteTarget(targetID int64) error

func (*Storage) DeleteUnassignedMission

func (s *Storage) DeleteUnassignedMission(missionIDs []int64) error

DeleteUnassignedMission only deletes the mission if it is not assigned to a cat.

func (*Storage) GetAllCats

func (s *Storage) GetAllCats() ([]spycat.SpyCat, error)

func (*Storage) GetAllMissions

func (s *Storage) GetAllMissions() ([]common.Mission, error)

func (*Storage) GetCatByID

func (s *Storage) GetCatByID(id int64) (*spycat.SpyCat, error)

func (*Storage) GetMission

func (s *Storage) GetMission(id int64) (*common.Mission, error)

func (*Storage) MissionExists

func (s *Storage) MissionExists(id int64) (bool, error)

func (*Storage) TargetExists

func (s *Storage) TargetExists(targetID int64) (bool, error)

func (*Storage) UpdateCatSalary

func (s *Storage) UpdateCatSalary(id int64, salary float64) error

func (*Storage) UpdateCompleteStatus

func (s *Storage) UpdateCompleteStatus(targetID int64, complete bool) error

func (*Storage) UpdateMissionCompleteStatus

func (s *Storage) UpdateMissionCompleteStatus(id int64, complete bool) error

func (*Storage) UpdateNotes

func (s *Storage) UpdateNotes(targetID int64, notes string) error

func (*Storage) UpdateTarget

func (s *Storage) UpdateTarget(id int64, target common.Target) error

Jump to

Keyboard shortcuts

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