db

package
v0.0.0-...-42982c7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBClient *gorm.DB

Functions

func ChatDelete

func ChatDelete(id uint64) error

Deletes the chat with the provided id

func ChatList

func ChatList(eager bool) ([]models.Chat, error)

Gets the data of all the chats

func ChatPatch

func ChatPatch(chat *models.Chat) error

Patch update the chat with the provided id

func ChatRead

func ChatRead(id uint64, eager bool) (models.Chat, error)

Gets the data of the chat with the provided id

func ChatUpsert

func ChatUpsert(chat *models.Chat) error

Updater or creates a chat if the id provided within the chat is found or not, respectively

func CommentDelete

func CommentDelete(id uint64) error

Deletes the comment with the provided id

func CommentList

func CommentList() ([]models.ReadCommentDTO, error)

Gets the data of all the comments

func CommentListByPostID

func CommentListByPostID(postID uint64) ([]models.ReadCommentDTO, error)

Gets the data of the comments with the provided post id

func CommentListByUserID

func CommentListByUserID(userID uint64) ([]models.ReadCommentDTO, error)

Gets the data of the comments with the provided user id

func CommentPatch

func CommentPatch(c *models.Comment) error

Patch update the comment with the provided id

func CommentRead

func CommentRead(id uint64) (models.ReadCommentDTO, error)

Gets the data of the comment with the provided id

func CommentUpsert

func CommentUpsert(c *models.Comment) error

Updates or creates a comment if the id provided within the comment is found or not, respectively

func Connect

func Connect() *gorm.DB

func Disconnect

func Disconnect()

func MessageDelete

func MessageDelete(id uint64) error

Deletes the message with the provided id

func MessageList

func MessageList() ([]models.ReadMessageDTO, error)

Gets the data of all the messages

func MessageListByChatID

func MessageListByChatID(chatID uint64) ([]models.ReadMessageDTO, error)

Gets the data of the messages with the provided chat id

func MessageListByChatIDAndUserID

func MessageListByChatIDAndUserID(chatID uint64, userID uint64) ([]models.ReadMessageDTO, error)

Gets the data of the messages with the provided chat id and user id

func MessageListByUserID

func MessageListByUserID(userID uint64) ([]models.ReadMessageDTO, error)

Gets the data of the messages with the provided user id

func MessagePatch

func MessagePatch(m *models.Message) error

Patch update the message with the provided id

func MessageRead

func MessageRead(id uint64) (models.ReadMessageDTO, error)

Gets the data of the message with the provided id

func MessageUpsert

func MessageUpsert(m *models.Message) error

Updater or creates a message if the id provided within the message is found or not, respectively

func PostDelete

func PostDelete(id uint64) error

Deletes the post with the provided id

func PostList

func PostList() ([]models.ReadPostDTO, error)

Gets the data of all the posts

func PostListByUserID

func PostListByUserID(userID uint64) ([]models.ReadPostDTO, error)

Gets the data of the posts with the provided user id

func PostPatch

func PostPatch(post *models.Post) error

Patch update the post with the provided id

func PostRead

func PostRead(id uint64) (models.ReadPostDTO, error)

Gets the data of the post with the provided id

func PostUpsert

func PostUpsert(post *models.Post) error

Updater or creates a post if the id provided within the post is found or not, respectively

func RedisConnect

func RedisConnect() *redis.Client

RedisConnect returns a redis client

func RedisDisconnect

func RedisDisconnect()

RedisDisconnect disconnects from redis

func RedisGet

func RedisGet(key string) (string, error)

RedisGet gets a value from redis

func RedisPing

func RedisPing() (string, error)

RedisPing pings redis

func RedisSet

func RedisSet(key string, value interface{}) error

RedisSet sets a key-value pair in redis

func Reset

func Reset()

func Seed

func Seed()

func UserDelete

func UserDelete(id uint64) error

Deletes the user with the provided id

func UserFindByEmail

func UserFindByEmail(email string) ([]models.ReadUserDTO, error)

Gets the data of the user with the provided email

func UserList

func UserList() ([]models.ReadUserDTO, error)

Gets the data of all the users

func UserPatch

func UserPatch(u *models.User) error

Patch update the user with the provided id

func UserRead

func UserRead(id uint64) (models.ReadUserDTO, error)

Gets the data of the user with the provided id

func UserUpsert

func UserUpsert(u *models.User) error

Updates or creates a user if the id provided within the user is found or not, respectively

Types

This section is empty.

Jump to

Keyboard shortcuts

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