Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSQLDatastore ¶
Types ¶
type Datastore ¶
type Datastore interface { GetDiscussionByID(ctx context.Context, id string) (*model.Discussion, error) GetDiscussionsByIDs(ctx context.Context, ids []string) (map[string]*model.Discussion, error) GetDiscussionByLinkSlug(ctx context.Context, slug string) (*model.Discussion, error) GetDiscussionByModeratorID(ctx context.Context, moderatorID string) (*model.Discussion, error) CreateModerator(ctx context.Context, moderator model.Moderator) (*model.Moderator, error) GetModeratorByID(ctx context.Context, id string) (*model.Moderator, error) GetModeratorByUserID(ctx context.Context, id string) (*model.Moderator, error) GetModeratorByDiscussionID(ctx context.Context, discussionID string) (*model.Moderator, error) GetModeratorByUserIDAndDiscussionID(ctx context.Context, userID, discussionID string) (*model.Moderator, error) GetModeratedDiscussionsByUserID(ctx context.Context, userID string) DiscussionIter ListDiscussions(ctx context.Context) (*model.DiscussionsConnection, error) ListDiscussionsByUserID(ctx context.Context, userID string, state model.DiscussionUserAccessState) (*model.DiscussionsConnection, error) UpsertDiscussion(ctx context.Context, discussion model.Discussion) (*model.Discussion, error) AssignFlair(ctx context.Context, participant model.Participant, flairID *string) (*model.Participant, error) GetTotalParticipantCountByDiscussionID(ctx context.Context, discussionID string) int GetParticipantByID(ctx context.Context, participantID string) (*model.Participant, error) GetParticipantsByIDs(ctx context.Context, ids []string) (map[string]*model.Participant, error) GetParticipantsByDiscussionID(ctx context.Context, id string) ([]model.Participant, error) GetParticipantsByDiscussionIDUserID(ctx context.Context, discussionID string, userID string) ([]model.Participant, error) GetModeratorParticipantsByDiscussionID(ctx context.Context, discussionID string) ([]model.Participant, error) UpsertParticipant(ctx context.Context, participant model.Participant) (*model.Participant, error) SetParticipantsMutedUntil(ctx context.Context, participants []*model.Participant, mutedUntil *time.Time) ([]*model.Participant, error) GetPostsByDiscussionIDIter(ctx context.Context, discussionID string) PostIter GetPostsByDiscussionIDFromCursorIter(ctx context.Context, discussionID string, cursor string, limit int) PostIter GetPostsConnectionByDiscussionID(ctx context.Context, discussionID string, cursor string, limit int) (*model.PostsConnection, error) GetLastPostByDiscussionID(ctx context.Context, discussionID string) (*model.Post, error) GetPostContentByID(ctx context.Context, id string) (*model.PostContent, error) PutPost(ctx context.Context, tx *sql2.Tx, post model.Post) (*model.Post, error) PutPostContent(ctx context.Context, tx *sql2.Tx, postContent model.PostContent) error DeletePostByID(ctx context.Context, postID string, deletedReasonCode model.PostDeletedReason) (*model.Post, error) DeleteAllParticipantPosts(ctx context.Context, discussionID string, participantID string, deletedReasonCode model.PostDeletedReason) (int, error) GetUserProfileByID(ctx context.Context, id string) (*model.UserProfile, error) GetUserProfileByUserID(ctx context.Context, userID string) (*model.UserProfile, error) GetSocialInfosByUserProfileID(ctx context.Context, userProfileID string) ([]model.SocialInfo, error) UpsertSocialInfo(ctx context.Context, obj model.SocialInfo) (*model.SocialInfo, error) CreateOrUpdateUserProfile(ctx context.Context, userProfile model.UserProfile) (*model.UserProfile, bool, error) UpsertUser(ctx context.Context, user model.User) (*model.User, error) GetUserByID(ctx context.Context, userID string) (*model.User, error) GetUserDevicesByUserID(ctx context.Context, userID string) ([]model.UserDevice, error) UpsertUserDevice(ctx context.Context, userDevice model.UserDevice) (*model.UserDevice, error) GetViewersByIDs(ctx context.Context, viewerIDs []string) (map[string]*model.Viewer, error) UpsertViewer(ctx context.Context, viewer model.Viewer) (*model.Viewer, error) GetViewerForDiscussion(ctx context.Context, discussionID, userID string) (*model.Viewer, error) SetViewerLastPostViewed(ctx context.Context, viewerID, postID string, viewedTime time.Time) (*model.Viewer, error) GetPostByID(ctx context.Context, postID string) (*model.Post, error) PutActivity(ctx context.Context, tx *sql2.Tx, post *model.Post) error PutMediaRecord(ctx context.Context, tx *sql2.Tx, media model.Media) error GetMediaRecordByID(ctx context.Context, mediaID string) (*model.Media, error) GetNextShuffleTimeForDiscussionID(ctx context.Context, id string) (*model.DiscussionShuffleTime, error) PutNextShuffleTimeForDiscussionID(ctx context.Context, tx *sql2.Tx, id string, shuffleTime *time.Time) (*model.DiscussionShuffleTime, error) IncrementDiscussionShuffleCount(ctx context.Context, tx *sql.Tx, id string) (*int, error) GetDiscussionsToBeShuffledBeforeTime(ctx context.Context, tx *sql2.Tx, epoc time.Time) ([]model.Discussion, error) // Helper functions PostIterCollect(ctx context.Context, iter PostIter) ([]*model.Post, error) DiscussionIterCollect(ctx context.Context, iter DiscussionIter) ([]*model.Discussion, error) AccessRequestIterCollect(ctx context.Context, iter DiscussionAccessRequestIter) ([]*model.DiscussionAccessRequest, error) DuaIterCollect(ctx context.Context, iter DiscussionUserAccessIter) ([]*model.DiscussionUserAccess, error) GetDiscussionsByUserAccess(ctx context.Context, userID string, state model.DiscussionUserAccessState) DiscussionIter GetDiscussionUserAccess(ctx context.Context, discussionID, userID string) (*model.DiscussionUserAccess, error) GetDUAForEverythingNotifications(ctx context.Context, discussionID, userID string) DiscussionUserAccessIter GetDUAForMentionNotifications(ctx context.Context, discussionID string, userID string, mentionedUserIDs []string) DiscussionUserAccessIter UpsertDiscussionUserAccess(ctx context.Context, tx *sql2.Tx, dua model.DiscussionUserAccess) (*model.DiscussionUserAccess, error) DeleteDiscussionUserAccess(ctx context.Context, tx *sql2.Tx, discussionID, userID string) (*model.DiscussionUserAccess, error) GetDiscussionRequestAccessByID(ctx context.Context, id string) (*model.DiscussionAccessRequest, error) GetDiscussionAccessRequestsByDiscussionID(ctx context.Context, discussionID string) DiscussionAccessRequestIter GetDiscussionAccessRequestByDiscussionIDUserID(ctx context.Context, discussionID string, userID string) (*model.DiscussionAccessRequest, error) GetSentDiscussionAccessRequestsByUserID(ctx context.Context, userID string) DiscussionAccessRequestIter PutDiscussionAccessRequestRecord(ctx context.Context, tx *sql2.Tx, request model.DiscussionAccessRequest) (*model.DiscussionAccessRequest, error) UpdateDiscussionAccessRequestRecord(ctx context.Context, tx *sql2.Tx, request model.DiscussionAccessRequest) (*model.DiscussionAccessRequest, error) GetAccessLinkBySlug(ctx context.Context, slug string) (*model.DiscussionAccessLink, error) GetAccessLinkByDiscussionID(ctx context.Context, discussionID string) (*model.DiscussionAccessLink, error) PutAccessLinkForDiscussion(ctx context.Context, tx *sql.Tx, input model.DiscussionAccessLink) (*model.DiscussionAccessLink, error) GetDiscussionArchiveByDiscussionID(ctx context.Context, discussionID string) (*model.DiscussionArchive, error) UpsertDiscussionArchive(ctx context.Context, tx *sql.Tx, discArchive model.DiscussionArchive) (*model.DiscussionArchive, error) // TXN BeginTx(ctx context.Context) (*sql2.Tx, error) RollbackTx(ctx context.Context, tx *sql2.Tx) error CommitTx(ctx context.Context, tx *sql2.Tx) error }
type DiscussionAccessRequestIter ¶
type DiscussionAccessRequestIter interface { Next(request *model.DiscussionAccessRequest) bool Close() error }
type DiscussionIter ¶
type DiscussionIter interface { Next(discussion *model.Discussion) bool Close() error }
type DiscussionUserAccessIter ¶
type DiscussionUserAccessIter interface { Next(dua *model.DiscussionUserAccess) bool Close() error }
Source Files ¶
- access_link.go
- datastore.go
- discussion.go
- discussion_access.go
- discussion_archive.go
- discussion_shuffle_time.go
- invite_request.go
- media.go
- mention.go
- moderator.go
- participant.go
- post.go
- post_content.go
- prepared_statements.go
- social_info.go
- test_setup.go
- transaction.go
- user.go
- user_device.go
- user_profile.go
- viewer.go
Click to show internal directories.
Click to hide internal directories.