store

package
v0.0.0-...-dcb018a Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDbTime

func FromDbTime(s string) (time.Time, error)

Types

type Article

type Article struct {
	Header Header
	Body   []byte
}

type ArticleRecord

type ArticleRecord struct {
	PostedAt  time.Time
	Newsgroup string
	Subject   string
	Author    string
	MsgID     string
	ParentID  string
	Body      string
}

type DB

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

func Open

func Open(dbPath string) (*DB, error)

func (*DB) ArticleCount

func (db *DB) ArticleCount() (uint, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) CreateNewSpool

func (db *DB) CreateNewSpool(startDate time.Time, prefix string) error

func (*DB) DoesGroupMetadataExist

func (db *DB) DoesGroupMetadataExist(gm *GroupMetadata) (bool, error)

func (*DB) DoesMessageIDExist

func (db *DB) DoesMessageIDExist(msgID string) (bool, error)

func (*DB) FetchNewGroups

func (db *DB) FetchNewGroups(dt time.Time) ([]string, error)

func (*DB) FetchNewsgroups

func (db *DB) FetchNewsgroups() ([]string, error)

func (*DB) GetAllRowIDs

func (db *DB) GetAllRowIDs(group string) ([]RowID, error)

func (*DB) GetArticleByMsgID

func (db *DB) GetArticleByMsgID(msgID string) (*Article, error)

func (*DB) GetArticleByRowID

func (db *DB) GetArticleByRowID(rowID RowID) (*Article, error)

func (*DB) GetHeaderByMsgID

func (db *DB) GetHeaderByMsgID(msgID string) (*Header, error)

func (*DB) GetHeaderByRowID

func (db *DB) GetHeaderByRowID(rowID RowID) (*Header, error)

func (*DB) GetPrefix

func (db *DB) GetPrefix() (string, error)

func (*DB) GetRowIDs

func (db *DB) GetRowIDs(group string) ([]RowID, error)

func (*DB) GetStartDate

func (db *DB) GetStartDate() (*time.Time, error)

func (*DB) GroupArticleCount

func (db *DB) GroupArticleCount(group string) (int, error)

func (*DB) InsertArticleRecord

func (db *DB) InsertArticleRecord(ar *ArticleRecord) error

func (*DB) InsertGroupMetadata

func (db *DB) InsertGroupMetadata(gm *GroupMetadata) error

type GroupMetadata

type GroupMetadata struct {
	Name         string
	DateCreated  time.Time
	DaysRetained uint
}
type Header struct {
	PostedAt  string
	Newsgroup string
	Subject   string
	Author    string
	MsgID     string
	ParentID  string
}

type RowID

type RowID uint

Jump to

Keyboard shortcuts

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