provider

package
v0.0.0-...-e3b2a5e Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChatGPTProvider

func NewChatGPTProvider(apiKey string) (coffee.Service, error)

func NewDatabase

func NewDatabase(db DBTX) coffee.Service

Types

type Coffee

type Coffee struct {
	ID              uuid.UUID
	Specie          string
	Owner           string
	CountryOfOrigin string
	Company         sql.NullString
	Aroma           float32
	Flavor          float32
	Aftertaste      float32
	Acidity         float32
	Body            float32
	Sweetness       float32
}

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 InsertCoffeeParams

type InsertCoffeeParams struct {
	Specie          string
	Owner           string
	CountryOfOrigin string
	Company         string
	Aroma           float32
	Flavor          float32
	Aftertaste      float32
	Acidity         float32
	Body            float32
	Sweetness       float32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetCoffeeById

func (q *Queries) GetCoffeeById(ctx context.Context, id uuid.UUID) (Coffee, error)

func (*Queries) InsertCoffee

func (q *Queries) InsertCoffee(ctx context.Context, arg InsertCoffeeParams) (uuid.UUID, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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