Documentation
¶
Index ¶
- Constants
- func Rollback(tx *sqlx.Tx, err *error)
- type Account
- type Cache
- func (c *Cache) RetrieveKrogerLocation(ctx context.Context, locationID string) (*CacheLocation, error)
- func (c *Cache) RetrieveKrogerProduct(ctx context.Context, productIDs ...string) ([]CacheProduct, []string, error)
- func (c *Cache) StoreKrogerLocation(ctx context.Context, location CacheLocation) error
- func (c *Cache) StoreKrogerProduct(ctx context.Context, products ...CacheProduct) error
- type CacheLocation
- type CacheProduct
- type CartProduct
- type Ingredient
- type List
- type ListCartProductsFilter
- type ListCartProductsIncludeStaples
- type ListListsFilter
- type ListListsFilterByName
- type ListListsOrderBy
- type ListRecipesFilter
- type ListRecipesFilterByAccountID
- type ListRecipesFilterByFavorites
- type ListRecipesFilterByName
- type ListRecipesFilterByVisibilities
- type ListRecipesOrderBy
- type Profile
- type Recipe
- type Repository
- func (r *Repository) AddCartProduct(ctx context.Context, accountID uuid.UUID, productID string, quantity int, ...) error
- func (r *Repository) ClearCartProducts(ctx context.Context, accountID uuid.UUID) error
- func (r *Repository) CreateAccount(ctx context.Context, krogerProfileID uuid.UUID) (Account, error)
- func (m *Repository) CreateIngredient(ctx context.Context, productID string, listID uuid.UUID, quantity int, ...) error
- func (r *Repository) CreateList(ctx context.Context, accountID uuid.UUID, name, description string) (uuid.UUID, error)
- func (r *Repository) CreateProfile(ctx context.Context, accountID uuid.UUID, displayName string) (Profile, error)
- func (r *Repository) CreateRecipe(ctx context.Context, accountID uuid.UUID, ...) (listID uuid.UUID, retErr error)
- func (r *Repository) CreateSession(ctx context.Context, accountID uuid.UUID) (Session, error)
- func (r *Repository) DeleteAccount(ctx context.Context, id uuid.UUID) (retErr error)
- func (m *Repository) DeleteIngredient(ctx context.Context, productID string, listID uuid.UUID) error
- func (r *Repository) DeleteList(ctx context.Context, id uuid.UUID) (retErr error)
- func (r *Repository) DeleteProfile(ctx context.Context, accountID uuid.UUID) error
- func (m *Repository) DeleteRecipe(ctx context.Context, listID uuid.UUID) (retErr error)
- func (r *Repository) DeleteSession(ctx context.Context, id uuid.UUID) error
- func (m *Repository) FavoriteRecipe(ctx context.Context, listID, accountID uuid.UUID) error
- func (r *Repository) GetAccountByID(ctx context.Context, id uuid.UUID) (Account, error)
- func (r *Repository) GetAccountByKrogerProfileID(ctx context.Context, krogerProfileID uuid.UUID) (Account, error)
- func (r *Repository) GetCartProduct(ctx context.Context, accountID uuid.UUID, productID string) (CartProduct, error)
- func (r *Repository) GetIngredient(ctx context.Context, listID uuid.UUID, productID string) (Ingredient, error)
- func (r *Repository) GetList(ctx context.Context, listID uuid.UUID) (List, error)
- func (r *Repository) GetProfileByAccountID(ctx context.Context, accountID uuid.UUID) (*Profile, error)
- func (r *Repository) GetRecipe(ctx context.Context, listID uuid.UUID, accountID uuid.UUID) (Recipe, error)
- func (r *Repository) GetSessionByID(ctx context.Context, id uuid.UUID) (Session, error)
- func (r *Repository) ListCartProducts(ctx context.Context, accountID uuid.UUID, filters ...ListCartProductsFilter) ([]*CartProduct, error)
- func (m *Repository) ListIngredients(ctx context.Context, listID uuid.UUID) ([]Ingredient, error)
- func (r *Repository) ListLists(ctx context.Context, accountID uuid.UUID, filters []ListListsFilter, ...) ([]List, error)
- func (r *Repository) ListProfiles(ctx context.Context, name string) ([]Profile, error)
- func (r *Repository) ListRecipes(ctx context.Context, accountID uuid.UUID, filters []ListRecipesFilter, ...) ([]Recipe, error)
- func (r *Repository) RemoveCartProduct(ctx context.Context, accountID uuid.UUID, productID string) error
- func (r *Repository) SetCartProduct(ctx context.Context, accountID uuid.UUID, productID string, quantity *int, ...) error
- func (m *Repository) UnfavoriteRecipe(ctx context.Context, listID, accountID uuid.UUID) error
- func (r *Repository) UpdateAccountHomepage(ctx context.Context, id uuid.UUID, homepage string) error
- func (r *Repository) UpdateAccountImageSize(ctx context.Context, id uuid.UUID, imageSize string) error
- func (r *Repository) UpdateAccountLocationID(ctx context.Context, id uuid.UUID, locationID *string) error
- func (m *Repository) UpdateIngredient(ctx context.Context, productID string, listID uuid.UUID, quantity int, ...) error
- func (r *Repository) UpdateList(ctx context.Context, list List) error
- func (r *Repository) UpdateProfileDisplayName(ctx context.Context, accountID uuid.UUID, displayName string) error
- func (r *Repository) UpdateRecipe(ctx context.Context, recipe Recipe) (retErr error)
- type Session
Constants ¶
View Source
const ( ImageSizeThumbnail = "thumbnail" ImageSizeSmall = "small" ImageSizeMedium = "medium" ImageSizeLarge = "large" ImageSizeExtraLarge = "xlarge" )
View Source
const ( HomepageOptionWelcome = "welcome" HomepageOptionRecipes = "recipes" HomepageOptionFavorites = "favorites" HomepageOptionExplore = "explore" )
View Source
const ( VisibilityPrivate = "private" VisibilityFriends = "friends" VisibilityPublic = "public" )
View Source
const ( InstructionTypeNone = "none" InstructionTypeText = "text" InstructionTypeLink = "link" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) RetrieveKrogerLocation ¶
func (*Cache) RetrieveKrogerProduct ¶
func (*Cache) StoreKrogerLocation ¶
func (c *Cache) StoreKrogerLocation(ctx context.Context, location CacheLocation) error
func (*Cache) StoreKrogerProduct ¶
func (c *Cache) StoreKrogerProduct(ctx context.Context, products ...CacheProduct) error
type CacheLocation ¶
type CacheProduct ¶
type CartProduct ¶
type Ingredient ¶
type Ingredient struct {
ProductID string `db:"product_id"`
ListID uuid.UUID `db:"list_id"`
Quantity int `db:"quantity"` // represents a percentage of the total product
Staple bool `db:"staple"`
}
func (Ingredient) QuantityDecimalString ¶
func (i Ingredient) QuantityDecimalString() string
type ListCartProductsFilter ¶
type ListCartProductsFilter interface {
// contains filtered or unexported methods
}
type ListCartProductsIncludeStaples ¶
type ListCartProductsIncludeStaples struct {
Include bool
}
type ListListsFilter ¶
type ListListsFilter interface {
// contains filtered or unexported methods
}
type ListListsFilterByName ¶
type ListListsFilterByName struct {
Name string
}
type ListListsOrderBy ¶
type ListRecipesFilter ¶
type ListRecipesFilter interface {
// contains filtered or unexported methods
}
type ListRecipesFilterByFavorites ¶
type ListRecipesFilterByFavorites struct{}
type ListRecipesFilterByName ¶
type ListRecipesFilterByName struct {
Name string
}
type ListRecipesFilterByVisibilities ¶
type ListRecipesFilterByVisibilities struct {
Visibilities []string
}
type ListRecipesOrderBy ¶
type Recipe ¶
type Recipe struct {
ListID uuid.UUID `db:"list_id"`
AccountID uuid.UUID `db:"account_id"`
Name string `db:"name"`
Description string `db:"description"`
InstructionType string `db:"instruction_type"`
Instructions string `db:"instructions"`
Visibility string `db:"visibility"`
Favorite bool `db:"favorite"`
}
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sqlx.DB) *Repository
func (*Repository) AddCartProduct ¶
func (*Repository) ClearCartProducts ¶
func (*Repository) CreateAccount ¶
func (*Repository) CreateIngredient ¶
func (*Repository) CreateList ¶
func (*Repository) CreateProfile ¶
func (*Repository) CreateRecipe ¶
func (*Repository) CreateSession ¶
func (*Repository) DeleteAccount ¶
func (*Repository) DeleteIngredient ¶
func (*Repository) DeleteList ¶
func (*Repository) DeleteProfile ¶
func (*Repository) DeleteRecipe ¶
func (*Repository) DeleteSession ¶
func (*Repository) FavoriteRecipe ¶
func (*Repository) GetAccountByID ¶
func (*Repository) GetAccountByKrogerProfileID ¶
func (*Repository) GetCartProduct ¶
func (r *Repository) GetCartProduct(ctx context.Context, accountID uuid.UUID, productID string) (CartProduct, error)
func (*Repository) GetIngredient ¶
func (r *Repository) GetIngredient(ctx context.Context, listID uuid.UUID, productID string) (Ingredient, error)
func (*Repository) GetProfileByAccountID ¶
func (*Repository) GetSessionByID ¶
func (*Repository) ListCartProducts ¶
func (r *Repository) ListCartProducts(ctx context.Context, accountID uuid.UUID, filters ...ListCartProductsFilter) ([]*CartProduct, error)
func (*Repository) ListIngredients ¶
func (m *Repository) ListIngredients(ctx context.Context, listID uuid.UUID) ([]Ingredient, error)
func (*Repository) ListLists ¶
func (r *Repository) ListLists(ctx context.Context, accountID uuid.UUID, filters []ListListsFilter, orderBys []ListListsOrderBy) ([]List, error)
func (*Repository) ListProfiles ¶
func (*Repository) ListRecipes ¶
func (r *Repository) ListRecipes(ctx context.Context, accountID uuid.UUID, filters []ListRecipesFilter, orderBys []ListRecipesOrderBy) ([]Recipe, error)
func (*Repository) RemoveCartProduct ¶
func (*Repository) SetCartProduct ¶
func (*Repository) UnfavoriteRecipe ¶
func (*Repository) UpdateAccountHomepage ¶
func (*Repository) UpdateAccountImageSize ¶
func (*Repository) UpdateAccountLocationID ¶
func (*Repository) UpdateIngredient ¶
func (*Repository) UpdateList ¶
func (r *Repository) UpdateList(ctx context.Context, list List) error
func (*Repository) UpdateProfileDisplayName ¶
func (*Repository) UpdateRecipe ¶
func (r *Repository) UpdateRecipe(ctx context.Context, recipe Recipe) (retErr error)
Click to show internal directories.
Click to hide internal directories.