Documentation
¶
Index ¶
- func NewRedisClient(host, password string) (*redis.Client, error)
- type DB
- func (db *DB) Close() error
- func (db *DB) DeleteComment(comment *domain.CommentDelete) error
- func (db *DB) DeleteCommentReply(reply *domain.CommentDeleteReply) error
- func (db *DB) DeleteLink(blockID, linkID, url string) error
- func (db *DB) FetchPermission(documentVersionId, userID string) (domain.Permission, error)
- func (db *DB) SaveComment(comment *domain.CommentAdd) error
- func (db *DB) SaveCommentReply(reply *domain.CommentReply) error
- func (db *DB) SaveLink(blockID, linkType, linkID, url, title string) error
- func (db *DB) SetCommentDone(comment *domain.CommentDone) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisClient ¶
NewRedisClient will initialize an connection to the redis server
Types ¶
type DB ¶
DB will implement the method to satisfy the sampleDBInterface
func NewPostgresClient ¶
NewPostgresClient will initialize a connection to the postgres database
func (*DB) DeleteComment ¶
func (db *DB) DeleteComment(comment *domain.CommentDelete) error
DeleteComment will flag the given comment as archived
func (*DB) DeleteCommentReply ¶
func (db *DB) DeleteCommentReply(reply *domain.CommentDeleteReply) error
DeleteCommentReply will flag the given comment as archived
func (*DB) DeleteLink ¶
DeleteLink will mark the given link as archived. Note that we need to preserve the links to allow users to access links from restored document versions
func (*DB) FetchPermission ¶
func (db *DB) FetchPermission(documentVersionId, userID string) (domain.Permission, error)
FetchPermission will check for permissions for the given user on the document
func (*DB) SaveComment ¶
func (db *DB) SaveComment(comment *domain.CommentAdd) error
SaveComment will add the given comment information to the database and assign it to the given process
func (*DB) SaveCommentReply ¶
func (db *DB) SaveCommentReply(reply *domain.CommentReply) error
SaveCommentReply will add the given comment reply
func (*DB) SetCommentDone ¶
func (db *DB) SetCommentDone(comment *domain.CommentDone) error
SetCommentDone will flag the given comment as done