database

package
v0.0.0-...-084f901 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2017 License: MIT Imports: 4 Imported by: 4

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)
	BoardPage(newsgroup string, pageno, perpage int) (*model.BoardPage, error)
}

func NewDBFromConfig

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

get new database connector from configuration

type PostgresDB

type PostgresDB struct {
}

func (*PostgresDB) BoardPage

func (db *PostgresDB) BoardPage(newsgroup string, pageno, perpage int) (page *model.BoardPage, 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