repository

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

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisClient

func NewRedisClient(host, password string) (*redis.Client, error)

NewRedisClient will initialize an connection to the redis server

Types

type DB

type DB struct {
	Session *sqlx.DB
}

DB will implement the method to satisfy the sampleDBInterface

func NewPostgresClient

func NewPostgresClient(config database.Config) (*DB, error)

NewPostgresClient will initialize a connection to the postgres database

func (*DB) Close

func (db *DB) Close() error

Close will terminate the database connections

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 *DB) DeleteLink(blockID, linkID, url string) error

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 *DB) SaveLink(blockID, linkType, linkID, url, title string) error

SaveLink will save the given link information

func (*DB) SetCommentDone

func (db *DB) SetCommentDone(comment *domain.CommentDone) error

SetCommentDone will flag the given comment as done

Jump to

Keyboard shortcuts

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