Documentation
¶
Index ¶
- Variables
- func CreateBoard(shortname, name, description string) (*models.Board, error)
- func CreateReply(boardID uint, threadID uint, content, author string, fileData []byte, ...) (*models.Post, error)
- func CreateThread(boardID uint, title, content, author string, fileData []byte, ...) (*models.Post, error)
- func GetAllBoards() ([]models.Board, error)
- func GetAllThreads() ([]models.Post, error)
- func GetBoardByID(id uint) (models.Board, error)
- func GetBoardByShortname(shortname string) (models.Board, error)
- func GetBoardThreads(boardID uint) ([]models.Post, error)
- func GetDB() *gorm.DB
- func GetFileByPostID(postID uint) (models.Post, error)
- func GetThreadWithReplies(threadID uint) (models.Post, []models.Post, error)
- func GetThumbnailByPostID(postID uint) (models.Post, error)
- func Initialize()
- func SeedSampleData() error
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func CreateBoard ¶
CreateBoard creates a new board
func CreateReply ¶
func CreateReply(boardID uint, threadID uint, content, author string, fileData []byte, fileName, fileType string) (*models.Post, error)
CreateReply creates a reply to a thread
func CreateThread ¶
func CreateThread(boardID uint, title, content, author string, fileData []byte, fileName, fileType string) (*models.Post, error)
CreateThread creates a new thread in the database
func GetAllBoards ¶
GetAllBoards gets all boards from the database
func GetAllThreads ¶
GetAllThreads gets all threads from the database
func GetBoardByID ¶
GetBoardByID gets a board by its ID
func GetBoardByShortname ¶
GetBoardByShortname gets a board by its shortname
func GetBoardThreads ¶
GetBoardThreads gets all threads for a specific board
func GetFileByPostID ¶
GetFileByPostID gets a file by post ID
func GetThreadWithReplies ¶
GetThreadWithReplies gets a thread and all its replies
func GetThumbnailByPostID ¶
GetThumbnailByPostID gets a thumbnail by post ID
func SeedSampleData ¶
func SeedSampleData() error
SeedSampleData adds some initial sample data if the database is empty
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.