roaster

package
v0.0.0-...-665a8ad Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoasterToSQL

func RoasterToSQL(roaster *Roaster) *sql.Roaster

RoasterToSQL converts a Roaster object to its corresponding SQL representation. If the input roaster is nil, it returns nil.

Types

type Roaster

type Roaster struct {
	// The id for the roaster
	Id int `json:"id"`

	// The name for the roaster
	Name string `json:"name"`

	// The creation date of the roaster
	CreatedAt *time.Time `json:"created_at"`

	// The last update date of the roaster
	UpdatedAt *time.Time `json:"updated_at"`
}

Roaster

Represents a roaster for this application

A roaster is the professional who roasts coffee beans.

swagger:model

func SQLToRoaster

func SQLToRoaster(roaster *sql.Roaster) *Roaster

SQLToRoaster converts a *sql.Roaster object to a *Roaster object. If the input roaster is nil, it returns nil.

type RoasterService

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

func (*RoasterService) CreateRoasterByName

func (s *RoasterService) CreateRoasterByName(ctx context.Context, name string) (*Roaster, error)

func (*RoasterService) DeleteRoasterById

func (s *RoasterService) DeleteRoasterById(ctx context.Context, id int) error

func (*RoasterService) GetAllRoasters

func (s *RoasterService) GetAllRoasters(ctx context.Context) ([]Roaster, error)

func (*RoasterService) GetRoasterById

func (s *RoasterService) GetRoasterById(ctx context.Context, id int) (*Roaster, error)

func (*RoasterService) Ping

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

func (*RoasterService) UpdateRoasterById

func (s *RoasterService) UpdateRoasterById(ctx context.Context, id int, roaster *Roaster) (*Roaster, error)

type Service

type Service interface {
	CreateRoasterByName(ctx context.Context, name string) (*Roaster, error)
	GetRoasterById(ctx context.Context, id int) (*Roaster, error)
	GetAllRoasters(ctx context.Context) ([]Roaster, error)
	UpdateRoasterById(ctx context.Context, id int, roaster *Roaster) (*Roaster, error)
	DeleteRoasterById(ctx context.Context, id int) error
	Ping(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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