Documentation
¶
Index ¶
- type DB
- type TweetsPGRepository
- type UsersPGRepository
- func (ur *UsersPGRepository) CreateUser(ctx context.Context, user domain.User) (domain.User, error)
- func (ur *UsersPGRepository) FollowUser(ctx context.Context, userID uuid.UUID, followedID uuid.UUID) error
- func (ur *UsersPGRepository) GetFollowedUserIDs(ctx context.Context, userID uuid.UUID) ([]uuid.UUID, error)
- func (ur *UsersPGRepository) GetFollowerIDs(ctx context.Context, userID uuid.UUID) ([]uuid.UUID, error)
- func (ur *UsersPGRepository) GetUser(ctx context.Context, id uuid.UUID) (domain.User, error)
- func (ur *UsersPGRepository) GetUserTimeline(ctx context.Context, userID uuid.UUID) ([]domain.Tweet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents a PostgreSQL database connection pool.
type TweetsPGRepository ¶
type TweetsPGRepository struct {
// contains filtered or unexported fields
}
func NewTweetRepository ¶
func NewTweetRepository(db *DB) *TweetsPGRepository
func (*TweetsPGRepository) CreateTweet ¶
type UsersPGRepository ¶
type UsersPGRepository struct {
// contains filtered or unexported fields
}
*
- UsersPGRepository implements port.UsersRepository interface
- and provides an access to the postgres database
func NewUserRepository ¶
func NewUserRepository(db *DB) *UsersPGRepository
NewUserRepository creates a new user repository instance
func (*UsersPGRepository) CreateUser ¶
func (*UsersPGRepository) FollowUser ¶
func (*UsersPGRepository) GetFollowedUserIDs ¶
func (*UsersPGRepository) GetFollowerIDs ¶
func (*UsersPGRepository) GetUserTimeline ¶
Click to show internal directories.
Click to hide internal directories.