Documentation ¶
Index ¶
- func ShotToSQL(shot *Shot) *sqlshot.Shot
- type Service
- type Shot
- type ShotService
- func (s *ShotService) CreateShot(ctx context.Context, shot *Shot) (*Shot, error)
- func (s *ShotService) DeleteShotById(ctx context.Context, id int) error
- func (s *ShotService) GetAllShots(ctx context.Context) ([]Shot, error)
- func (s *ShotService) GetShotById(ctx context.Context, id int) (*Shot, error)
- func (s *ShotService) Ping(ctx context.Context) error
- func (s *ShotService) UpdateShotById(ctx context.Context, id int, shot *Shot) (*Shot, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
type ShotService ¶
type ShotService struct {
// contains filtered or unexported fields
}
func New ¶
func New(repo repository.ShotRepository) *ShotService
func (*ShotService) CreateShot ¶
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 (*ShotService) UpdateShotById ¶
Click to show internal directories.
Click to hide internal directories.