provider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(db DBTX) coffee.Service

Types

type Coffee

type Coffee struct {
	ID              pgtype.UUID
	Specie          string
	Owner           string
	CountryOfOrigin string
	Company         pgtype.Text
	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 GeminiClient

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

func NewGeminiClient

func NewGeminiClient(apiKey string) (*GeminiClient, error)

func (*GeminiClient) GetCoffeeOptionsByCharacteristics

func (c *GeminiClient) GetCoffeeOptionsByCharacteristics(ctx context.Context, filter coffee.Filter) ([]coffee.OptionProvider, error)

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 pgtype.UUID) (Coffee, error)

func (*Queries) InsertCoffee

func (q *Queries) InsertCoffee(ctx context.Context, arg InsertCoffeeParams) (pgtype.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