weather

package
v0.0.0-...-23c0a96 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type InsertMeasurementParams

type InsertMeasurementParams struct {
	RecordedAt  time.Time
	Temperature float64
	Humidity    float64
	Pressure    float64
	Location    string
}

type Measurement

type Measurement struct {
	ID          int64
	RecordedAt  time.Time
	Temperature float64
	Humidity    float64
	Pressure    float64
	Location    string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetRecentMeasurements

func (q *Queries) GetRecentMeasurements(ctx context.Context, limit int32) ([]Measurement, error)

func (*Queries) GetTrends

func (q *Queries) GetTrends(ctx context.Context, period time.Duration) (Trend, error)

func (*Queries) InsertMeasurement

func (q *Queries) InsertMeasurement(ctx context.Context, arg InsertMeasurementParams) (Measurement, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Trend

type Trend struct {
	Temperature string
	Humidity    string
	Pressure    string
}

Jump to

Keyboard shortcuts

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