db

package
v0.0.0-...-e96b286 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: MIT Imports: 6 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 struct {
	Conn   *sql.DB
	Config *config.DBConfig
}

func New

func New(cfg *config.DBConfig) *DB

func (*DB) Connect

func (db *DB) Connect() error

func (*DB) GetSchedulerComments

func (db *DB) GetSchedulerComments(delaySecs int) (*sql.Rows, error)

Get all post and comments which haven't been checked for new comments

in over delaySecs seconds.
Exclude comments which have a parent as sub-comments cannot
  have more comments

func (*DB) GetSchedulerPosts

func (db *DB) GetSchedulerPosts(delaySecs int) (*sql.Rows, error)

Get all the pages which haven't been checked for new posts

in over delaySecs seconds (or never)

func (*DB) Initialize

func (db *DB) Initialize() error

func (*DB) InsertComment

func (db *DB) InsertComment(comment_id string, post_id, parent_id string, user_id string) error

func (*DB) InsertPost

func (db *DB) InsertPost(id string) error

func (*DB) SetScheduled

func (db *DB) SetScheduled(entryType string, id string) error

func (*DB) UpdateLastCheck

func (db *DB) UpdateLastCheck(entryType string, id string, last_check int64) error

Jump to

Keyboard shortcuts

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