database

package
v0.0.0-...-9113971 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database represents a database connection and operations

func NewDatabase

func NewDatabase(cfg config.DatabaseConfig) (*Database, error)

NewDatabase creates a new database connection

func (*Database) Close

func (d *Database) Close() error

Close closes the database connection

func (*Database) GetLatestWeatherData

func (d *Database) GetLatestWeatherData() (*models.WeatherData, error)

GetLatestWeatherData retrieves the most recent weather data

func (*Database) GetWeatherDataRange

func (d *Database) GetWeatherDataRange(start, end time.Time) ([]*models.WeatherData, error)

GetWeatherDataRange retrieves weather data for a specific time range

func (*Database) SaveWeatherData

func (d *Database) SaveWeatherData(data *models.WeatherData) error

SaveWeatherData saves weather data to the database

Jump to

Keyboard shortcuts

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