spool

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ROWID_TTL = time.Duration(5) * time.Second

Variables

View Source
var ErrArticleNumNotFound = errors.New("article not found")

Functions

This section is empty.

Types

type Credentials

type Credentials = reddit.Credentials

type FetchSubArgs

type FetchSubArgs struct {
	Subreddit      string
	StartDateTime  time.Time
	PageFetchLimit uint
	ConcLimit      uint
	IgnoreTick     bool
}

type Spool

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

func New

func New(fname string, concLimit uint, creds *reddit.Credentials) (*Spool, error)

func (*Spool) AddGroupMetadata

func (s *Spool) AddGroupMetadata(name string, dateCreated time.Time, daysRetained uint) error

func (*Spool) ArticleCount

func (s *Spool) ArticleCount() (uint, error)

func (*Spool) ArticleNumToRowIDCached

func (s *Spool) ArticleNumToRowIDCached(group string, articleNum uint) (store.RowID, error)

func (*Spool) Close

func (s *Spool) Close() error

func (*Spool) FetchSubreddit

func (s *Spool) FetchSubreddit(args FetchSubArgs) error

func (*Spool) GetArticleByMsgID

func (s *Spool) GetArticleByMsgID(group string, msgID string) (*data.Article, error)

func (*Spool) GetArticleByNGNum

func (s *Spool) GetArticleByNGNum(group string, articleNum uint) (*data.Article, error)

func (*Spool) GetArticleNumsFromGroup

func (s *Spool) GetArticleNumsFromGroup(group string) ([]uint, error)

func (*Spool) GetHeaderByMsgID

func (s *Spool) GetHeaderByMsgID(msgID string) (*data.Header, error)

func (*Spool) GetHeaderByNGNum

func (s *Spool) GetHeaderByNGNum(group string, articleNum uint) (*data.Header, error)

func (*Spool) GetRowIDsFromCache

func (s *Spool) GetRowIDsFromCache(group string) ([]store.RowID, error)

func (*Spool) GroupArticleCount

func (s *Spool) GroupArticleCount(group string) (int, error)

func (*Spool) Init

func (s *Spool) Init(startDate time.Time, prefix string) error

func (*Spool) NewGroups

func (s *Spool) NewGroups(dt time.Time) ([]string, error)

func (*Spool) Newsgroups

func (s *Spool) Newsgroups() ([]string, error)

func (*Spool) Prefix

func (s *Spool) Prefix() (string, error)

func (*Spool) StartDate

func (s *Spool) StartDate() (*time.Time, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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