weatherdb

package
v0.1.4-alpha-deployment1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	DiscordID string `json:"discord_id"`
	Location  string `json:"location"`
}

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 {
	DiscordID string `json:"discord_id"`
	Location  string `json:"location"`
}

type Querier

type Querier interface {
	Create(ctx context.Context, arg CreateParams) (Weather, error)
	Find(ctx context.Context, discordID string) (string, error)
	Insert(ctx context.Context, arg InsertParams) error
	Update(ctx context.Context, location string) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) (Weather, error)

func (*Queries) Find

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

func (*Queries) Insert

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

func (*Queries) Update

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

func (*Queries) WithTx

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

type Weather

type Weather struct {
	ID        int32  `json:"id"`
	DiscordID string `json:"discord_id"`
	Location  string `json:"location"`
}

Jump to

Keyboard shortcuts

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