repository

package
v0.0.0-...-1582af6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnection

func GetConnection() (*gorm.DB, error)

Types

type Database

type Database struct {
	Connection *gorm.DB
	RiverRepo  RiverRepository
	GaugeRepo  GaugeRepository
	MetricRepo MetricRepository
}

func GetDatabase

func GetDatabase() (Database, error)

func GetDatabaseForConnection

func GetDatabaseForConnection(connection *gorm.DB) Database

type GaugeRepository

type GaugeRepository interface {
	GetAll() (*[]model.Gauge, error)
	GetRiverGauges(riverId uuid.UUID) (*[]model.Gauge, error)
	Get(uuid.UUID) (*model.Gauge, error)
	Create(river *model.Gauge) error
	Update(river *model.Gauge) error
	Delete(uuid.UUID) error
}

func GetGaugeRepository

func GetGaugeRepository(db *gorm.DB) GaugeRepository

type MetricRepository

type MetricRepository interface {
	GetAll() (*[]model.Metric, error)
	GetGaugeMetrics(gaugeId uuid.UUID) (*[]model.Metric, error)
	Get(uuid.UUID) (*model.Metric, error)
	Create(Metric *model.Metric) error
	Update(Metric *model.Metric) error
	Delete(uuid.UUID) error
	DeleteOldMetrics() error
}

func GetMetricRepository

func GetMetricRepository(db *gorm.DB) MetricRepository

type RiverRepository

type RiverRepository interface {
	GetAll() (*[]model.River, error)
	Get(uuid.UUID) (*model.River, error)
	Create(river *model.River) error
	Update(river *model.River) error
	Delete(uuid.UUID) error
}

func GetRiverRepository

func GetRiverRepository(db *gorm.DB) RiverRepository

Jump to

Keyboard shortcuts

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