repository

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

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func DeletePost

func DeletePost(ctx context.Context, id string, userId string) error

func GetPostById

func GetPostById(ctx context.Context, id string) (*models.Post, error)

func GetUserByEmail

func GetUserByEmail(ctx context.Context, email string) (*models.User, error)

func GetUserById

func GetUserById(ctx context.Context, id string) (*models.User, error)

func InsertPost

func InsertPost(ctx context.Context, post *models.Post) error

func InsertUser

func InsertUser(ctx context.Context, user *models.User) error

func ListPost

func ListPost(ctx context.Context, page uint64) ([]*models.Post, error)

func SetRepository

func SetRepository(repository Repository)

func UpdatePost

func UpdatePost(ctx context.Context, post *models.Post) error

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
}

Jump to

Keyboard shortcuts

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