Documentation ¶
Index ¶
- Variables
- type MealItem
- type Nutrition
- type Repository
- type SQLiteRepository
- func (r *SQLiteRepository) All() ([]MealItem, error)
- func (r *SQLiteRepository) Create(mealitem MealItem) (*MealItem, error)
- func (r *SQLiteRepository) Delete(id int64) error
- func (r *SQLiteRepository) GetByName(name string) (*MealItem, error)
- func (r *SQLiteRepository) Migrate() error
- func (r *SQLiteRepository) Update(id int64, updated MealItem) (*MealItem, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type MealItem ¶
type MealItem struct { ID int64 Name string Calories int Carbs int Fat int Protein int Nutrition *Nutrition }
func NewMealItem ¶
type Nutrition ¶
type Repository ¶
type SQLiteRepository ¶
type SQLiteRepository struct {
// contains filtered or unexported fields
}
func NewSQLiteRepository ¶
func NewSQLiteRepository(db *sql.DB) *SQLiteRepository
func (*SQLiteRepository) All ¶
func (r *SQLiteRepository) All() ([]MealItem, error)
func (*SQLiteRepository) Create ¶
func (r *SQLiteRepository) Create(mealitem MealItem) (*MealItem, error)
func (*SQLiteRepository) Delete ¶
func (r *SQLiteRepository) Delete(id int64) error
func (*SQLiteRepository) GetByName ¶
func (r *SQLiteRepository) GetByName(name string) (*MealItem, error)
func (*SQLiteRepository) Migrate ¶
func (r *SQLiteRepository) Migrate() error
Click to show internal directories.
Click to hide internal directories.