Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Application error codes
Functions ¶
This section is empty.
Types ¶
type Meal ¶
type Meal struct { ID int64 `json:"id"` CookSlackUID string `json:"cookSlackUID"` Date Date `json:"date"` Description string `json:"description"` SlackMessageID string `json:"slackMessageID"` }
Meal represents a meal in dinner rotation.
type MealService ¶
type MealService interface { // FindMealByID retrieves a meal by ID. // Returns ErrNotFound if meal does not exist. FindMealByID(id int64) (*Meal, error) // FindMealByDate retrieves a meal by Date. // Returns ErrNotFound if meal does not exist. FindMealByDate(date Date) (*Meal, error) // FindMealBySlackMessageID retrieves a meal by SlackMessageID. // Returns ErrNotFound if meal does not exist. FindMealBySlackMessageID(slackMessageID string) (*Meal, error) // CreateMeal creates a new meal. CreateMeal(m *Meal) error // UpdateMeal updates a meal object. UpdateMeal(id int64, upd MealUpdate) error // DeleteMeal permanently deletes a meal. DeleteMeal(id int64) error }
MealService represents a service for managing meals.
type MealUpdate ¶
MealUpdate represents a set of fields to be updated via UpdateMeal().
type Member ¶
type Member struct { ID int64 `json:"id"` SlackUID string `json:"slackUID"` FullName string `json:"fullName"` MealsEaten int64 `json:"mealsEaten"` MealsCooked int64 `json:"mealsCooked"` Leader bool `json:"leader"` }
Member represents a member of dinner rotation.
type MemberService ¶
type MemberService interface { // FindMemberByID retrieves a member by ID. // Returns ErrNotFound if meal does not exist. FindMemberByID(id int64) (*Member, error) // FindMemberBySlackUID retrieves a member by SlackID. // Returns ErrNotFound if meal does not exist. FindMemberBySlackUID(slackUID string) (*Member, error) // ListMembers retrieves a list of members. ListMembers() ([]*Member, error) // CreateMember creates a new member. CreateMember(m *Member) error // UpdateMember updates a member object. UpdateMember(id int64, upd MemberUpdate) error // DeleteMember permanently deletes a member. DeleteMember(id int64) error }
MemberService represents a service for managing members.
type MemberUpdate ¶
MemberUpdate represents a set of fields to be updated via UpdateMember().
Click to show internal directories.
Click to hide internal directories.