database

package
v0.0.0-...-7277db8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

database driver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	ThreadByMessageID(msgid string) (*model.Thread, error)
	ThreadByHash(hash string) (*model.Thread, error)
	MessageIDByHash(hash string) (string, error)
	BoardPage(newsgroup string, pageno, perpage int) (*model.BoardPage, error)
	StorePost(post model.Post) error
	Init() error
}

func NewDBFromConfig

func NewDBFromConfig(c *config.DatabaseConfig) (db Database, err error)

get new database connector from configuration

type PostgresDB

type PostgresDB struct {
	// contains filtered or unexported fields
}

func (*PostgresDB) BoardPage

func (db *PostgresDB) BoardPage(newsgroup string, pageno, perpage int) (page *model.BoardPage, err error)

func (*PostgresDB) Init

func (db *PostgresDB) Init() (err error)

func (*PostgresDB) MessageIDByHash

func (db *PostgresDB) MessageIDByHash(hash string) (msgid string, err error)

func (*PostgresDB) StorePost

func (db *PostgresDB) StorePost(post model.Post) (err error)

func (*PostgresDB) ThreadByHash

func (db *PostgresDB) ThreadByHash(hash string) (thread *model.Thread, err error)

func (*PostgresDB) ThreadByMessageID

func (db *PostgresDB) ThreadByMessageID(msgid string) (thread *model.Thread, err error)

Jump to

Keyboard shortcuts

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