storage

package
v0.0.0-...-a851fb6 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelInfo

type ChannelInfo struct {
	ChannelColor tb.Attribute
}

type FeedStorage

type FeedStorage struct {
	Amap agingmap.AgingMapInterface
	// contains filtered or unexported fields
}

func MakeFeedStorage

func MakeFeedStorage(filename string, cap int) *FeedStorage

func (*FeedStorage) Add

func (s *FeedStorage) Add(key, value string)

func (*FeedStorage) DumpToStorage

func (s *FeedStorage) DumpToStorage()

func (*FeedStorage) Get

func (s *FeedStorage) Get(key string) string

func (*FeedStorage) LoadFromStorage

func (s *FeedStorage) LoadFromStorage() (loaded bool)

type RssEntry

type RssEntry struct {
	FeedTitle   string
	ItemTitle   string
	ItemSummary string
	ItemContent string
	URL         string
	ItemDate    time.Time
	State       RssEntryState
}

RssEntry represents OUR version of an entry. It's in a form that can be easily dumped to the view.

type RssEntryState

type RssEntryState uint8

RssEntryState represents the viewing status of the entry.

const (
	CollapsedEntryState RssEntryState = iota
	StandardEntryState
	ExpandedEntryState
	BrowserEntryState /* Temporary state; should get lowered immediately */
)

func CollapseEntryState

func CollapseEntryState(state RssEntryState) RssEntryState

CollapseEntryState returns the next smallest entry state.

func ExpandEntryState

func ExpandEntryState(state RssEntryState) RssEntryState

ExpandEntryState returns the next largest entry state.

type SavedViewStorage

type SavedViewStorage struct {
	ItemList       []*RssEntry
	ChannelInfoMap map[string]*ChannelInfo /* Title --> Info */
}

type ViewStorage

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

func MakeViewStorage

func MakeViewStorage(key string, cap int) *ViewStorage

func (*ViewStorage) AddItem

func (s *ViewStorage) AddItem(item *RssEntry)

func (*ViewStorage) ChangeColor

func (s *ViewStorage) ChangeColor(index int) error

func (*ViewStorage) ChangeItemState

func (s *ViewStorage) ChangeItemState(index int, expand bool) (RssEntryState, string)

func (*ViewStorage) DeleteItem

func (s *ViewStorage) DeleteItem(index int) error

func (*ViewStorage) DumpToStorage

func (s *ViewStorage) DumpToStorage()

func (*ViewStorage) GetChannelInfo

func (s *ViewStorage) GetChannelInfo(title string) *ChannelInfo

func (*ViewStorage) GetCopyOfSomeItems

func (s *ViewStorage) GetCopyOfSomeItems(n int) []RssEntry

func (*ViewStorage) LoadFromStorage

func (s *ViewStorage) LoadFromStorage() (loaded bool)

func (*ViewStorage) SetChannelInfo

func (s *ViewStorage) SetChannelInfo(title string, info *ChannelInfo)

Jump to

Keyboard shortcuts

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