repository

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

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDb

func GetDb() (db *sqlx.DB, err error)

Types

type ForecastRepo

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

ForecastRepo is the forecast repository

func GetPostgresRepo

func GetPostgresRepo() (*ForecastRepo, error)

func NewForecastRepo

func NewForecastRepo(db *sqlx.DB) *ForecastRepo

NewForecastRepo creates a new forecast repository

func (*ForecastRepo) Close

func (f *ForecastRepo) Close() error

func (*ForecastRepo) GetAlerts

func (r *ForecastRepo) GetAlerts(ctx context.Context, fromDate time.Time) ([]model.ForecastModel, error)

func (*ForecastRepo) GetForecast

func (r *ForecastRepo) GetForecast(ctx context.Context, fromDate time.Time) ([]model.ForecastModel, error)

func (*ForecastRepo) GetLastUpdate

func (r *ForecastRepo) GetLastUpdate(ctx context.Context) (time.Time, error)

func (*ForecastRepo) SaveForecast

func (r *ForecastRepo) SaveForecast(ctx context.Context, forecasts []model.ForecastModel) error

type SQLConfig

type SQLConfig struct {
	HOST           string
	PORT           string
	DATABASE       string
	USER           string
	PASSWORD       string
	REQUIRESSL     string
	MAX_CONNS      int
	MAX_IDLE_CONNS int
}

Jump to

Keyboard shortcuts

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