Documentation ¶
Index ¶
Constants ¶
View Source
const ( SourceTypeBook = "book" SourceTypeUrl = "url" SourceTypeCustom = "custom" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recipe ¶
type Recipe struct { ID primitive.ObjectID `bson:"_id,omitempty"` Title string `bson:"title,omitempty"` Source primitive.ObjectID `bson:"source,omitempty"` SourceAnnotation string `bson:"sourceAnnotation,omitempty"` Category string `bson:"category,omitempty"` Allergens []string `bson:"allergens,omitempty"` }
type RecipeIDNotValidError ¶
type RecipeIDNotValidError struct {
ID string
}
func (*RecipeIDNotValidError) Error ¶
func (err *RecipeIDNotValidError) Error() string
type RecipeNotFoundError ¶
type RecipeNotFoundError struct {
ID string
}
func (*RecipeNotFoundError) Error ¶
func (err *RecipeNotFoundError) Error() string
type RecipeRepository ¶
type RecipeRepository interface { GetRecipes(ctx context.Context) ([]Recipe, error) GetRecipeByID(ctx context.Context, id string) (Recipe, error) AddRecipe(ctx context.Context, recipe *Recipe) error UpdateRecipe(ctx context.Context, recipe Recipe) error DeleteRecipe(ctx context.Context, recipe Recipe) error }
type SourceIDNotValidError ¶
type SourceIDNotValidError struct {
ID string
}
func (*SourceIDNotValidError) Error ¶
func (err *SourceIDNotValidError) Error() string
type SourceNotFoundError ¶
type SourceNotFoundError struct {
ID string
}
func (*SourceNotFoundError) Error ¶
func (err *SourceNotFoundError) Error() string
type SourceRepository ¶
type SourceRepository interface { GetSources(ctx context.Context) ([]Source, error) GetSourceByID(ctx context.Context, id string) (Source, error) AddSource(ctx context.Context, source *Source) error UpdateSource(ctx context.Context, source Source) error DeleteSource(ctx context.Context, source Source) error }
type SourceTypeNotValidError ¶
type SourceTypeNotValidError struct {
SourceType sourceType
}
func (*SourceTypeNotValidError) Error ¶
func (err *SourceTypeNotValidError) Error() string
Click to show internal directories.
Click to hide internal directories.