Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostRepository ¶
type PostRepository interface { Create(p *models.Post) error GetAll() ([]*models.Post, error) FindByID(id int) (*models.Post, error) FindByIDAdmin(id int) (*models.Post, error) FindBySlug(slug string) (*models.Post, error) FindBySlugAdmin(slug string) (*models.Post, error) Exists(slug string) bool Delete(id int) error Update(p *models.Post) error Paginate(maxID int, perPage int, tags []string) ([]*models.Post, int, error) PaginateAdmin(maxID int, perPage int, tags []string) ([]*models.Post, int, error) GetTotalPostCount() (int, error) GetPublicPostCount() (int, error) ResetSeq() error GetLastID() (int, error) GetLastIDAdmin() (int, error) SearchQuery(string, []string) ([]*models.Post, error) }
PostRepository interface
func NewPostRepository ¶
func NewPostRepository(db *database.Postgres) PostRepository
NewPostRepository - creates a post repository instance
type UserRepository ¶
type UserRepository interface { Create(u *models.User) error CreateFirstAdmin(u *models.User) (bool, error) GetAll() ([]*models.User, error) GetAllDetailed() ([]*models.AuthUser, error) FindByID(id string) (*models.User, error) FindByIDDetailed(id string) (*models.User, error) FindByEmail(email string) (*models.User, error) FindByUsername(username string) (*models.User, error) Exists(email string) bool ExistsUsername(username string) bool Delete(id string) error Update(u *models.User) error }
UserRepository interface defines all functions that interact with the database
func NewUserRespository ¶
func NewUserRespository(db *database.Postgres) UserRepository
NewUserRespository returns a new user repository
Click to show internal directories.
Click to hide internal directories.