Documentation ¶
Index ¶
- type AppleWhereAndOrderFunc
- type DealSliceResultFunc
- type ForumRepo
- func (f *ForumRepo) GetAnonyID(ctx context.Context, userID uid.UID, threadID uid.UID) (string, error)
- func (f *ForumRepo) GetMainTags(ctx context.Context) ([]string, error)
- func (f *ForumRepo) GetPost(ctx context.Context, search *entity.PostSearch) (*entity.Post, error)
- func (f *ForumRepo) GetPostCount(ctx context.Context, search *entity.PostsSearch) (int, error)
- func (f *ForumRepo) GetPostQuotedCount(ctx context.Context, id uid.UID) (int, error)
- func (f *ForumRepo) GetPostSlice(ctx context.Context, search *entity.PostsSearch, query entity.SliceQuery) (*entity.PostSlice, error)
- func (f *ForumRepo) GetPosts(ctx context.Context, search *entity.PostsSearch) ([]*entity.Post, error)
- func (f *ForumRepo) GetTags(ctx context.Context, search *entity.TagSearch) ([]*entity.Tag, error)
- func (f *ForumRepo) GetThread(ctx context.Context, search *entity.ThreadSearch) (*entity.Thread, error)
- func (f *ForumRepo) GetThreadCatalog(ctx context.Context, id uid.UID) ([]*entity.ThreadCatalogItem, error)
- func (f *ForumRepo) GetThreadSlice(ctx context.Context, search *entity.ThreadsSearch, query entity.SliceQuery) (*entity.ThreadSlice, error)
- func (f *ForumRepo) InsertPost(ctx context.Context, post *entity.Post) error
- func (f *ForumRepo) InsertThread(ctx context.Context, thread *entity.Thread) error
- func (f *ForumRepo) SetMainTags(ctx context.Context, tags []string) error
- func (f *ForumRepo) UpdatePost(ctx context.Context, id uid.UID, update *entity.PostUpdate) error
- func (f *ForumRepo) UpdateThread(ctx context.Context, id uid.UID, update *entity.ThreadUpdate) error
- type NotiRepo
- func (n *NotiRepo) GetNotiByKey(ctx context.Context, userID uid.UID, key string) (*entity.Notification, error)
- func (n *NotiRepo) GetNotiSlice(ctx context.Context, user *entity.User, query entity.SliceQuery) (*entity.NotiSlice, error)
- func (n *NotiRepo) GetUserUnreadCount(ctx context.Context, user *entity.User) (int, error)
- func (n *NotiRepo) InsertNoti(ctx context.Context, noti *entity.Notification) error
- func (n *NotiRepo) ToEntityNoti(noti *NotificationQuery) *entity.Notification
- func (n *NotiRepo) UpdateNotiContent(ctx context.Context, noti *entity.Notification) error
- func (n *NotiRepo) UpdateReadID(ctx context.Context, userID uid.UID, id uid.UID) error
- type Notification
- type NotificationQuery
- type Post
- type Tag
- type Thread
- type User
- type UserRepo
- func (u *UserRepo) DelCode(ctx context.Context, code string) error
- func (u *UserRepo) GetCodeEmail(ctx context.Context, code string) (string, error)
- func (u *UserRepo) GetToken(ctx context.Context, tok string) (*entity.Token, error)
- func (u *UserRepo) GetUserByAuthInfo(ctx context.Context, ai entity.AuthInfo) (*entity.User, error)
- func (u *UserRepo) InsertUser(ctx context.Context, user *entity.User, ex time.Duration) (*entity.User, error)
- func (u *UserRepo) SetCode(ctx context.Context, email string, code string, ex time.Duration) error
- func (u *UserRepo) SetToken(ctx context.Context, token *entity.Token) error
- func (u *UserRepo) UpdateUser(ctx context.Context, id uid.UID, update *entity.UserUpdate) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppleWhereAndOrderFunc ¶
type DealSliceResultFunc ¶
type ForumRepo ¶
type ForumRepo struct {
// contains filtered or unexported fields
}
func (*ForumRepo) GetAnonyID ¶
func (*ForumRepo) GetMainTags ¶
func (*ForumRepo) GetPostCount ¶
func (*ForumRepo) GetPostQuotedCount ¶
func (*ForumRepo) GetPostSlice ¶
func (f *ForumRepo) GetPostSlice( ctx context.Context, search *entity.PostsSearch, query entity.SliceQuery, ) (*entity.PostSlice, error)
func (*ForumRepo) GetThreadCatalog ¶
func (*ForumRepo) GetThreadSlice ¶
func (f *ForumRepo) GetThreadSlice( ctx context.Context, search *entity.ThreadsSearch, query entity.SliceQuery, ) (*entity.ThreadSlice, error)
func (*ForumRepo) InsertPost ¶
func (*ForumRepo) InsertThread ¶
func (*ForumRepo) SetMainTags ¶
func (*ForumRepo) UpdatePost ¶
func (*ForumRepo) UpdateThread ¶
type NotiRepo ¶
type NotiRepo struct{}
func (*NotiRepo) GetNotiByKey ¶
func (*NotiRepo) GetNotiSlice ¶
func (*NotiRepo) GetUserUnreadCount ¶
func (*NotiRepo) InsertNoti ¶
func (*NotiRepo) ToEntityNoti ¶
func (n *NotiRepo) ToEntityNoti(noti *NotificationQuery) *entity.Notification
func (*NotiRepo) UpdateNotiContent ¶
type Notification ¶
type Notification struct { Key string `pg:"key,pk"` SortKey uid.UID `pg:"sort_key"` CreatedAt time.Time `pg:"created_at"` UpdatedAt time.Time `pg:"updated_at"` Type entity.NotiType `pg:"type,use_zero"` Receivers []entity.Receiver `pg:"receivers,array"` Content map[string]interface{} `pg:"content,json_use_number"` // contains filtered or unexported fields }
type NotificationQuery ¶
type NotificationQuery struct { Notification `pg:",inherit"` HasRead bool `pg:"has_read"` }
type Post ¶
type Post struct { ID uid.UID `pg:"id,pk"` CreatedAt time.Time `pg:"created_at"` UpdatedAt time.Time `pg:"updated_at"` ThreadID uid.UID `pg:"thread_id,use_zero"` UserID uid.UID `pg:"user_id,use_zero"` Anonymous bool `pg:"anonymous,use_zero"` Guest bool `pg:"guest,use_zero"` Author string `pg:"author"` Blocked *bool `pg:"blocked"` Content string `pg:"content,use_zero"` QuotedIDs []uid.UID `pg:"quoted_ids,array"` // contains filtered or unexported fields }
type Thread ¶
type Thread struct { ID uid.UID `pg:"id,pk"` LastPostID uid.UID `pg:"last_post_id,use_zero"` CreatedAt time.Time `pg:"created_at"` UpdatedAt time.Time `pg:"updated_at"` UserID uid.UID `pg:"user_id,use_zero"` Anonymous bool `pg:"anonymous,use_zero"` Guest bool `pg:"guest,use_zero"` Author string `pg:"author"` Title *string `pg:"title"` Content string `pg:"content,use_zero"` Locked bool `pg:"locked,use_zero"` Blocked bool `pg:"blocked,use_zero"` Tags []string `pg:"tags,array"` // contains filtered or unexported fields }
type User ¶
type User struct { ID uid.UID `pg:"id,pk" json:"id"` CreatedAt time.Time `pg:"created_at" json:"created_at"` UpdatedAt time.Time `pg:"updated_at" json:"-"` Email *string `pg:"email,use_zero" json:"-"` Name *string `pg:"name" json:"-"` Role entity.Role `pg:"role,use_zero" json:"role"` LastReadNoti uid.UID `pg:"last_read_noti,use_zero" json:"-"` Tags []string `pg:"tags,array" json:"tags"` // contains filtered or unexported fields }
type UserRepo ¶
type UserRepo struct { Redis *redis.Client Forum *ForumRepo }
func (*UserRepo) GetCodeEmail ¶
func (*UserRepo) GetUserByAuthInfo ¶
func (*UserRepo) InsertUser ¶
func (*UserRepo) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.