repository

package
v0.0.0-...-398d8f0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentRepository

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

func (*CommentRepository) Create

Create will insert a new data

func (*CommentRepository) Delete

func (cr *CommentRepository) Delete(id uint64) error

Delete will delete data based on its ID

func (*CommentRepository) Find

func (cr *CommentRepository) Find(id uint64) (model.Comment, error)

Find will fetch data based on its ID

func (*CommentRepository) GetAll

func (cr *CommentRepository) GetAll() ([]model.Comment, error)

func (*CommentRepository) Update

Update will update data based on its ID with request data supplied

type PhotoRepository

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

func (*PhotoRepository) Create

Create will insert a new data

func (*PhotoRepository) Delete

func (pr *PhotoRepository) Delete(id uint64) error

Delete will delete data based on its ID

func (*PhotoRepository) Find

func (pr *PhotoRepository) Find(id uint64) (model.Photo, error)

Find will fetch data based on its ID

func (*PhotoRepository) GetAll

func (pr *PhotoRepository) GetAll() ([]model.Photo, error)

func (*PhotoRepository) Update

Update will update data based on its ID with request data supplied

type Repository

type Repository struct {
	User        *UserRepository
	Photo       *PhotoRepository
	Comment     *CommentRepository
	SocialMedia *SocialMediaRepository
}

Repository collects every repositories in single struct

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

NewRepository creates every repository and return the collection of them

type SocialMediaRepository

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

func (*SocialMediaRepository) Create

Create will insert a new data

func (*SocialMediaRepository) Delete

func (smr *SocialMediaRepository) Delete(id uint64) error

Delete will delete data based on its ID

func (*SocialMediaRepository) Find

Find will fetch data based on its ID

func (*SocialMediaRepository) GetAll

func (smr *SocialMediaRepository) GetAll() ([]model.SocialMedia, error)

func (*SocialMediaRepository) Update

Update will update data based on its ID with request data supplied

type UserRepository

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

func (*UserRepository) Create

Create will insert a new data

func (*UserRepository) Delete

func (ur *UserRepository) Delete(id uint64) error

Delete will delete data based on its ID

func (*UserRepository) Find

func (ur *UserRepository) Find(id uint64) (model.User, error)

Find will fetch data based on its ID

func (*UserRepository) FindByEmail

func (ur *UserRepository) FindByEmail(email string) (model.User, error)

FindByEmail will return data via email lookup

func (*UserRepository) Update

func (ur *UserRepository) Update(id uint64, req model.UserUpdateRequest) (model.User, error)

Update will update data based on its ID with request data supplied

Jump to

Keyboard shortcuts

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