db

package
v0.0.0-...-903fd05 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() []model.Person

Get returns the whole database

func InitDBConnector

func InitDBConnector() error

func Insert

func Insert(person model.Person)

Insert allows populating database

func LoadTestData

func LoadTestData(db *sqlx.DB)

Types

type DBConnector

type DBConnector struct {
	Connection *sqlx.DB
}
var DBConnect *DBConnector

func (*DBConnector) GetAllSpacecrafts

func (db *DBConnector) GetAllSpacecrafts() ([]model.Spacecraft, error)

func (*DBConnector) GetSpacecraftByProp

func (db *DBConnector) GetSpacecraftByProp(prop string, value string) (model.Spacecraft, error)

type FleetDBConnector

type FleetDBConnector interface {
	GetSpacecraftByProp(string, string) (model.Spacecraft, error)
	GetAllSpacecrafts() ([]model.Spacecraft, error)
}

Jump to

Keyboard shortcuts

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