backend

package
v0.0.0-...-7693fda Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Init sets up this database's connections.
	Init() error

	// Close destroys this database's connections.
	Close() error

	// Refresh renews this database's connections.
	Refresh() error

	// PopulateBoard fetches a board by name.
	PopulateBoard(boardName string, b *tchan.BoardOverview, ok *bool) error

	// PopulateThread fetches the thread with the specified post in it.
	PopulateThread(boardName string, postID int64, thr *tchan.Thread, ok *bool) error

	// CreateThread adds a new thread to a board, setting the OP's post ID.
	CreateThread(boardName string, topic string, op *tchan.Post) error

	// AddPostToThread adds a reply to a thread, setting the post's ID in the process.
	AddReply(boardName string, postID int64, post *tchan.Post, ok *bool) error
}

DB handles all database interactions.

func New

func New(opts *config.Settings) DB

New creates a new backend which has yet to be initialized.

Jump to

Keyboard shortcuts

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