queue

package
v0.0.0-...-92255fb Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue manages the list of items to be tweeted.

func New

func New(config *config.Config, messages chan<- *scraper.Message) (*Queue, error)

New creates a new queue, loading existing data from disk if available. The queue also launches a goroutine to manage tweets.

func (*Queue) Add

func (q *Queue) Add(m *scraper.Message) error

Add inserts a message into the queue.

func (*Queue) Close

func (q *Queue) Close()

Close shuts down the queue and waits for the goroutine to exit.

func (*Queue) Delete

func (q *Queue) Delete(id int) error

Delete removes the specified message from the queue.

func (*Queue) LastTweet

func (q *Queue) LastTweet() time.Time

LastTweet retrieves the time of the last tweet being sent.

func (*Queue) Messages

func (q *Queue) Messages() []*scraper.Message

Messages retrieves the current list of queued messages.

func (*Queue) SetSettings

func (q *Queue) SetSettings(settings Settings) error

SetSettings stores the current settings for the queue.

func (*Queue) Settings

func (q *Queue) Settings() Settings

Settings retrieves the current settings for the queue.

type Settings

type Settings struct {
	QueueFrequency int `json:"queue_frequency"` // Time in minutes between tweets
}

Settings controls the behavior of the queue. This includes the interval between consecutive tweets for the account.

Jump to

Keyboard shortcuts

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