repository

package
v0.0.0-...-8bf14a4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateData = errors.New("duplicate data error")
View Source
var ErrNotExistsData = errors.New("not exists data error")
View Source
var ErrUserActivationNotFound = errors.New("no such user_name and activation_key")

Functions

This section is empty.

Types

type CommentRepository

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

func NewCommentRepository

func NewCommentRepository(db *sql.DB) *CommentRepository

func (*CommentRepository) Create

func (r *CommentRepository) Create(ctx context.Context, comment *model.Comment) (err error)

func (*CommentRepository) DeleteWhereID

func (r *CommentRepository) DeleteWhereID(ctx context.Context, id int64) (err error)

func (*CommentRepository) DeleteWhereUserName

func (r *CommentRepository) DeleteWhereUserName(ctx context.Context, userName string) (err error)

func (*CommentRepository) GetCommentsWherePostingID

func (r *CommentRepository) GetCommentsWherePostingID(ctx context.Context, postingID int64) (comments []model.Comment, err error)

func (*CommentRepository) GetWhereID

func (r *CommentRepository) GetWhereID(ctx context.Context, id int64) (comment model.Comment, err error)

type CommentRepositoryInterface

type CommentRepositoryInterface interface {
	Create(ctx context.Context, comment *model.Comment) (err error)
	GetCommentsWherePostingID(ctx context.Context, id int64) (comments []model.Comment, err error)
	GetWhereID(ctx context.Context, id int64) (comment model.Comment, err error)
	DeleteWhereID(ctx context.Context, id int64) (err error)
	DeleteWhereUserName(ctx context.Context, userName string) (err error)
}

type FollowRepository

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

func NewFollowRepository

func NewFollowRepository(db *sql.DB) *FollowRepository

func (*FollowRepository) Create

func (r *FollowRepository) Create(ctx context.Context, follow *model.Follow) (err error)

func (*FollowRepository) DeleteWhereFollowingFollowedUserName

func (r *FollowRepository) DeleteWhereFollowingFollowedUserName(ctx context.Context, followingUserName, followedUserName string) (err error)

func (*FollowRepository) DeleteWhereFollowingUserName

func (r *FollowRepository) DeleteWhereFollowingUserName(ctx context.Context, userName string) (err error)

type FollowRepositoryInterface

type FollowRepositoryInterface interface {
	Create(ctx context.Context, follow *model.Follow) (err error)
	DeleteWhereFollowingFollowedUserName(ctx context.Context, followingUserName, followedUserName string) (err error)
	DeleteWhereFollowingUserName(ctx context.Context, userName string) (err error)
}

type LikeRepository

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

func NewLikeRepository

func NewLikeRepository(db *sql.DB) *LikeRepository

func (*LikeRepository) Create

func (r *LikeRepository) Create(ctx context.Context, like *model.Like) (err error)

func (*LikeRepository) DeleteWhereID

func (r *LikeRepository) DeleteWhereID(ctx context.Context, id int64) (err error)

func (*LikeRepository) DeleteWhereUserName

func (r *LikeRepository) DeleteWhereUserName(ctx context.Context, userName string) (err error)

func (*LikeRepository) GetWhereID

func (r *LikeRepository) GetWhereID(ctx context.Context, id int64) (like model.Like, err error)

type LikeRepositoryInterface

type LikeRepositoryInterface interface {
	Create(ctx context.Context, like *model.Like) (err error)
	GetWhereID(ctx context.Context, id int64) (like model.Like, err error)
	DeleteWhereID(ctx context.Context, id int64) (err error)
	DeleteWhereUserName(ctx context.Context, userName string) (err error)
}

type NotificationRepository

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

func NewNotificationRepository

func NewNotificationRepository(db *sql.DB) *NotificationRepository

func (*NotificationRepository) Create

func (r *NotificationRepository) Create(ctx context.Context, notification *model.Notification) (err error)

func (*NotificationRepository) DeleteWhereID

func (r *NotificationRepository) DeleteWhereID(ctx context.Context, id int64) (err error)

func (*NotificationRepository) DeleteWhereVisitedName

func (r *NotificationRepository) DeleteWhereVisitedName(ctx context.Context, userName string) (err error)

func (*NotificationRepository) GetNotifications

func (r *NotificationRepository) GetNotifications(ctx context.Context, userName string) (notifications []model.Notification, err error)

type NotificationRepositoryInterface

type NotificationRepositoryInterface interface {
	Create(ctx context.Context, notification *model.Notification) (err error)
	GetNotifications(ctx context.Context, userName string) (notifications []model.Notification, err error)
	DeleteWhereID(ctx context.Context, id int64) (err error)
	DeleteWhereNotificationUserName(ctx context.Context, userName string) (err error)
}

type PostingRepository

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

func NewPostingRepository

func NewPostingRepository(db *sql.DB) *PostingRepository

func (*PostingRepository) Create

func (r *PostingRepository) Create(ctx context.Context, posting *model.Posting) (err error)

func (*PostingRepository) DeleteWhereID

func (r *PostingRepository) DeleteWhereID(ctx context.Context, id int64) (err error)

func (*PostingRepository) DeleteWhereUserName

func (r *PostingRepository) DeleteWhereUserName(ctx context.Context, userName string) (err error)

func (*PostingRepository) GetPostings

func (r *PostingRepository) GetPostings(ctx context.Context, sinceAt time.Time, limit int8, userName string) (postings []model.Posting, err error)

func (*PostingRepository) GetWhereID

func (r *PostingRepository) GetWhereID(ctx context.Context, id int64) (posting model.Posting, err error)

func (*PostingRepository) GetWhereIDUserName

func (r *PostingRepository) GetWhereIDUserName(ctx context.Context, id int64, userName string) (posting model.Posting, err error)

func (*PostingRepository) UpdateLikedCount

func (r *PostingRepository) UpdateLikedCount(ctx context.Context, id int64, increment bool) (err error)

type PostingRepositoryInterface

type PostingRepositoryInterface interface {
	Create(ctx context.Context, posting *model.Posting) (err error)
	GetPostings(ctx context.Context, sinceAt time.Time, limit int8) (postings []model.Posting, err error)
	GetWhereID(ctx context.Context, id int64) (posting model.Posting, err error)
	GetWhereIDUserName(ctx context.Context, id int64, userName string) (posting model.Posting, err error)
	UpdateLikedCount(ctx context.Context, id int64, increment bool) (err error)
	DeleteWhereID(ctx context.Context, id int64) (err error)
	DeleteWhereUserName(ctx context.Context, userName string) (err error)
}

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *sql.DB) *UserRepository

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, user *model.User) (err error)

func (*UserRepository) DeleteWhereName

func (r *UserRepository) DeleteWhereName(ctx context.Context, userName string) (err error)

func (*UserRepository) GetUserWhereEmail

func (r *UserRepository) GetUserWhereEmail(ctx context.Context, email string) (user model.User, err error)

func (*UserRepository) GetUserWhereName

func (r *UserRepository) GetUserWhereName(ctx context.Context, userName string) (user model.User, err error)

func (*UserRepository) GetUserWhereNameResetKey

func (r *UserRepository) GetUserWhereNameResetKey(ctx context.Context, userName, resetKey string, requestedAt time.Time) (user model.User, err error)

func (*UserRepository) ResetPassword

func (r *UserRepository) ResetPassword(ctx context.Context, password, userName, resetKey string) (err error)

func (*UserRepository) UpdateEmailVerifiedWhereNameActivationKey

func (r *UserRepository) UpdateEmailVerifiedWhereNameActivationKey(ctx context.Context, emailVerified bool, userName, activationKey string) (err error)

func (*UserRepository) UpdateFollowCount

func (r *UserRepository) UpdateFollowCount(ctx context.Context, userName string, increment bool) (err error)

func (*UserRepository) UpdateFollowedCount

func (r *UserRepository) UpdateFollowedCount(ctx context.Context, userName string, increment bool) (err error)

func (*UserRepository) UpdateIconWhereName

func (r *UserRepository) UpdateIconWhereName(ctx context.Context, iconURL, userName string) (err error)

func (*UserRepository) UpdateLikeCount

func (r *UserRepository) UpdateLikeCount(ctx context.Context, userName string, increment bool) (err error)

func (*UserRepository) UpdateLikedCount

func (r *UserRepository) UpdateLikedCount(ctx context.Context, postingID int64, increment bool) (err error)

func (*UserRepository) UpdatePasswordResetWhereEmail

func (r *UserRepository) UpdatePasswordResetWhereEmail(ctx context.Context, count uint8, resetKey string, expiresAt time.Time, email string) (err error)

func (*UserRepository) UpdatePasswordWhereName

func (r *UserRepository) UpdatePasswordWhereName(ctx context.Context, password, userName string) (err error)

func (*UserRepository) UpdateSelfIntroductionWhereName

func (r *UserRepository) UpdateSelfIntroductionWhereName(ctx context.Context, selfIntroduction, userName string) (err error)

type UserRepositoryInterface

type UserRepositoryInterface interface {
	Create(ctx context.Context, user *model.User) (err error)
	GetUserWhereEmail(ctx context.Context, email string) (user model.User, err error)
	GetUserWhereName(ctx context.Context, userName string) (user model.User, err error)
	GetUserWhereNameResetKey(ctx context.Context, userName string, resetKey string, requestedAt time.Time) (user model.User, err error)
	UpdatePasswordWhereName(ctx context.Context, password string, userName string) (err error)
	UpdateIconWhereName(ctx context.Context, iconURL string, userName string) (err error)
	UpdateSelfIntroductionWhereName(ctx context.Context, selfIntroduction string, userName string) (err error)
	UpdateEmailVerifiedWhereNameActivationKey(ctx context.Context, emailVerified bool, userName string, activationKey string) (err error)
	UpdatePasswordResetWhereEmail(ctx context.Context, count uint16, resetKey string, expiresAt time.Time, email string) (err error)
	ResetPassword(ctx context.Context, password string, userName string, resetKey string) (err error)
	UpdateLikeCount(ctx context.Context, userName string, increment bool) (err error)
	UpdateLikedCount(ctx context.Context, userName string) (err error)
	DeleteWhereName(ctx context.Context, userName string) (err error)
}

Jump to

Keyboard shortcuts

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