awsu

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsUptime

type AwsUptime struct {
	ID      int     `json:"id"`
	Ts      string  `json:"ts"`
	Unit    string  `json:"unit"`
	Average float64 `json:"average"`
	Date    string  `json:"date"`
}

func Fake

func Fake() (a *AwsUptime)

func (*AwsUptime) Insertable

func (a *AwsUptime) Insertable() InsertParams

type AwsUptimeTracker

type AwsUptimeTracker struct {
	ID      int    `json:"id"`
	RunDate string `json:"run_date"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type InsertParams

type InsertParams struct {
	Ts      string  `json:"ts"`
	Unit    string  `json:"unit"`
	Date    string  `json:"date"`
	Average float64 `json:"average"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) Count

func (q *Queries) Count(ctx context.Context) (int64, error)

func (*Queries) Insert

func (q *Queries) Insert(ctx context.Context, arg InsertParams) (int, error)

func (*Queries) Oldest

func (q *Queries) Oldest(ctx context.Context) (string, error)

func (*Queries) Track

func (q *Queries) Track(ctx context.Context, runDate string) error

func (*Queries) WithTx

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

func (*Queries) Youngest

func (q *Queries) Youngest(ctx context.Context) (string, error)

Jump to

Keyboard shortcuts

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