Documentation ¶
Index ¶
- func Close() error
- func DeletePost(ctx context.Context, id string, userId string) error
- func GetPostById(ctx context.Context, id string) (*models.Post, error)
- func GetUserByEmail(ctx context.Context, email string) (*models.User, error)
- func GetUserById(ctx context.Context, id string) (*models.User, error)
- func InsertPost(ctx context.Context, post *models.Post) error
- func InsertUser(ctx context.Context, user *models.User) error
- func ListPost(ctx context.Context, page uint64) ([]*models.Post, error)
- func SetRepository(repository Repository)
- func UpdatePost(ctx context.Context, post *models.Post) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRepository ¶
func SetRepository(repository Repository)
Types ¶
type Repository ¶
type Repository interface { InsertUser(ctx context.Context, user *models.User) error GetUserById(ctx context.Context, id string) (*models.User, error) GetUserByEmail(ctx context.Context, email string) (*models.User, error) InsertPost(ctx context.Context, post *models.Post) error GetPostById(ctx context.Context, id string) (*models.Post, error) UpdatePost(ctx context.Context, post *models.Post) error DeletePost(ctx context.Context, id string, userId string) error ListPost(ctx context.Context, page uint64) ([]*models.Post, error) Close() error }
Click to show internal directories.
Click to hide internal directories.