shot

package
v0.0.0-...-652937c Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShotToSQL

func ShotToSQL(shot *Shot) *sqlshot.Shot

ShotToSQL converts a Shot object to its corresponding SQL representation. If the input Shot is nil, it returns nil.

Types

type Service

type Service interface {
	CreateShot(ctx context.Context, shot *Shot) (*Shot, error)
	GetShotById(ctx context.Context, id int) (*Shot, error)
	GetAllShots(ctx context.Context) ([]Shot, error)
	UpdateShotById(ctx context.Context, id int, shot *Shot) (*Shot, error)
	DeleteShotById(ctx context.Context, id int) error
	Ping(ctx context.Context) error
}

type Shot

type Shot struct {
	Id                            int                                   `json:"id"`
	Sheet                         *sheet.Sheet                          `json:"sheet"`
	Beans                         *bean.Bean                            `json:"beans"`
	GrindSetting                  int                                   `json:"grind_setting"`
	QuantityIn                    float64                               `json:"quantity_in"`
	QuantityOut                   float64                               `json:"quantity_out"`
	ShotTime                      time.Duration                         `json:"shot_time"`
	WaterTemperature              float64                               `json:"water_temperature"`
	Rating                        float64                               `json:"rating"`
	IsTooBitter                   bool                                  `json:"is_too_bitter"`
	IsTooSour                     bool                                  `json:"is_too_sour"`
	ComparaisonWithPreviousResult sqlshot.ComparaisonWithPreviousResult `json:"comparaison_with_previous_result"`
	AdditionalNotes               string                                `json:"additional_notes"`
	CreatedAt                     *time.Time                            `json:"created_at"`
	UpdatedAt                     *time.Time                            `json:"updated_at"`
}

Shot

An espresso shot is made from coffee beans, ground at a specific setting, with a specific quantity of coffee in and out. It also has a specific shot time and water temperature.

The result of a shot can be rated and compared to the previous shot. It can also be too bitter or too sour.

swagger:model

func SQLToShot

func SQLToShot(shot *sqlshot.Shot) *Shot

SQLToShot converts a SQLShot object to a Shot object. If the input SQLShot is nil, it returns nil. Otherwise, it creates a new Shot object and populates its fields with the corresponding values from the SQLShot. The converted Shot object is then returned.

type ShotService

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

func New

func (*ShotService) CreateShot

func (s *ShotService) CreateShot(ctx context.Context, shot *Shot) (*Shot, error)

func (*ShotService) DeleteShotById

func (s *ShotService) DeleteShotById(ctx context.Context, id int) error

func (*ShotService) GetAllShots

func (s *ShotService) GetAllShots(ctx context.Context) ([]Shot, error)

func (*ShotService) GetShotById

func (s *ShotService) GetShotById(ctx context.Context, id int) (*Shot, error)

func (*ShotService) Ping

func (s *ShotService) Ping(ctx context.Context) error

func (*ShotService) UpdateShotById

func (s *ShotService) UpdateShotById(ctx context.Context, id int, shot *Shot) (*Shot, error)

Jump to

Keyboard shortcuts

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