database

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BumpThread

func BumpThread(post *model.Post) error

BumpThread updates the parent thread from a given post.

func DeleteOldThreads

func DeleteOldThreads() error

DeleteOldThreads deletes any thread that's fallen from the index.

func DeletePost

func DeletePost(data *model.DeleteData) error

DeletePost returns an error that should be checked in the handler. Warning: if the post started a thread (parent_thread == nil), it will delete every post in the thread (parent_thread == id).

func GetIndex

func GetIndex() ([]model.Post, error)

GetIndex returns every post that started a thread.

func GetPost

func GetPost(id uint64) (*model.Post, error)

GetPost returns a post given its ID.

func GetThread

func GetThread(id uint64) ([]model.Post, error)

GetThread returns every post that belong to a thread.

func SavePost

func SavePost(post *model.Post) (*model.DeleteData, error)

SavePost returns a struct with the ID and delete code of the inserted post.

func UpdatePost

func UpdatePost(data *model.UpdateData) error

UpdatePost returns an error that should be checked in the handler. Warning: the post must start a thread (parent_thread == nil), or else this will fail.

Types

This section is empty.

Jump to

Keyboard shortcuts

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