repositories

package
v0.0.0-...-7d38a10 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BCRYPT_COST = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	ID       int64
	Password string
}

type Ingredient

type Ingredient struct {
	Ingredient       *string `json:"ingredient"`
	IngredientNumber *int    `json:"ingredient_number"`
	Amount           *string `json:"amount"`
	Measurement      *string `json:"measurement"`
	Preparation      *string `json:"preparation"`
}

type IngredientsRepository

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

func NewIngredientsRepository

func NewIngredientsRepository(db *sql.DB) *IngredientsRepository

func (*IngredientsRepository) GetForRecipe

func (r *IngredientsRepository) GetForRecipe(recipeID int64) ([]*Ingredient, error)

type Recipe

type Recipe struct {
	ID          *int64  `json:"id"`
	Name        *string `json:"name"`
	Description *string `json:"description"`
	Creator     *string `json:"creator,omitempty"`
	Servings    *int    `json:"servings,omitempty"`
	PrepTime    *string `json:"prep_time,omitempty"`
	CookTime    *string `json:"cook_time,omitempty"`
	CoolTime    *string `json:"cool_time,omitempty"`
	TotalTime   *string `json:"total_time,omitempty"`
	Source      *string `json:"source,omitempty"`
}

type RecipesRepository

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

func NewRecipesRepository

func NewRecipesRepository(db *sql.DB) *RecipesRepository

func (*RecipesRepository) Get

func (r *RecipesRepository) Get(id, userID int64) (*Recipe, error)

func (*RecipesRepository) Insert

func (r *RecipesRepository) Insert(recipe *Recipe, userID int64) (int64, error)

func (*RecipesRepository) List

func (r *RecipesRepository) List(userID int64) ([]*Recipe, error)

type RedisRepository

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

func NewRedisRepository

func NewRedisRepository(client redis.Cmdable) *RedisRepository

func (*RedisRepository) DeleteTokenDetails

func (r *RedisRepository) DeleteTokenDetails(uuid string) (int64, error)

func (*RedisRepository) RetrieveTokenDetails

func (r *RedisRepository) RetrieveTokenDetails(details *token.AccessDetails) (int64, error)

func (*RedisRepository) StoreTokenDetails

func (r *RedisRepository) StoreTokenDetails(userID int64, details *token.Details) error

type Step

type Step struct {
	StepNumber   *int    `json:"step_number"`
	Instructions *string `json:"instructions"`
}

type StepsRepository

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

func NewStepsRepository

func NewStepsRepository(db *sql.DB) *StepsRepository

func (*StepsRepository) GetForRecipe

func (r *StepsRepository) GetForRecipe(recipeID int64) ([]*Step, error)

type User

type User struct {
	Username string
	Email    string
}

type UsersRepository

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

func NewUsersRepository

func NewUsersRepository(db *sql.DB) *UsersRepository

func (*UsersRepository) ExistsByEmail

func (u *UsersRepository) ExistsByEmail(email string) (bool, error)

func (*UsersRepository) ExistsByUsername

func (u *UsersRepository) ExistsByUsername(username string) (bool, error)

func (*UsersRepository) Insert

func (u *UsersRepository) Insert(username, email, password string) (int64, error)

func (*UsersRepository) Verify

func (u *UsersRepository) Verify(login, password string) (bool, int64, error)

Jump to

Keyboard shortcuts

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