repository

package
v0.0.0-...-de159e6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserPreferences

type UserPreferences struct {
	Id                 uint   `bson:"_id,minsize"`
	BeerId             uint   `bson:"beer_id,minsize"`
	BeerName           string `bson:"beer_name"`
	UserEmail          string `bson:"user_email"`
	DrunkTheBeerBefore bool   `bson:"drunk_the_beer_before"`
	GotDrunk           bool   `bson:"got_drunk"`
	LastTime           string `bson:"last_time"`
	Rating             uint   `bson:"rating,minsize"`
	Comment            string `bson:"comment"`
}

type UserPreferencesCrudRepository

type UserPreferencesCrudRepository interface {
	Save(preferences *UserPreferences) error
	FindById(id uint) (*UserPreferences, error)
	FindByBeerId(id uint) (*UserPreferences, error)
	FindByUserEmail(email string) ([]*UserPreferences, error)
}

type UserPreferencesRepository

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

func NewUserPreferencesRepository

func NewUserPreferencesRepository(
	ctx context.Context,
	client *mongo.Client,
) *UserPreferencesRepository

func (*UserPreferencesRepository) FindByBeerId

func (u *UserPreferencesRepository) FindByBeerId(beerId uint) (*UserPreferences, error)

func (*UserPreferencesRepository) FindById

func (*UserPreferencesRepository) FindByUserEmail

func (u *UserPreferencesRepository) FindByUserEmail(email string) ([]*UserPreferences, error)

func (*UserPreferencesRepository) Save

func (u *UserPreferencesRepository) Save(preferences *UserPreferences) error

type UserProfile

type UserProfile struct {
	Email      string
	LastUpdate time.Time
}

type UserProfileCrudRepository

type UserProfileCrudRepository interface {
	Save(user *UserProfile) error
	FindByEmail(email string) (*UserProfile, error)
}

type UserProfileRepository

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

func NewUserProfileRepository

func NewUserProfileRepository(
	ctx context.Context,
	db *sql.DB,
) *UserProfileRepository

func (*UserProfileRepository) FindByEmail

func (u *UserProfileRepository) FindByEmail(email string) (*UserProfile, error)

func (*UserProfileRepository) Save

func (u *UserProfileRepository) Save(user *UserProfile) error

Jump to

Keyboard shortcuts

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