Documentation ¶
Overview ¶
Package preferences provides a struct with methods to get some user preferences values. They can come from the user's model or from the session.
Index ¶
- type Pair
- type Preferences
- func (p *Preferences) BookmarkListLayout() Pair
- func (p *Preferences) FontList() [][2]string
- func (p *Preferences) FontSizes() []string
- func (p *Preferences) LineHeights() []string
- func (p *Preferences) ReaderFont() Pair
- func (p *Preferences) ReaderFontSize() Pair
- func (p *Preferences) ReaderLineHeight() Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Preferences ¶
type Preferences struct {
// contains filtered or unexported fields
}
Preferences contains the user preferences after initilization.
func New ¶
func New(user *users.User, session *sessions.Session) *Preferences
New returns a new Preferences instance. It computes the values for each preference at this moment.
func (*Preferences) BookmarkListLayout ¶
func (p *Preferences) BookmarkListLayout() Pair
BookmarkListLayout returns the bookmark list layout.
func (*Preferences) FontList ¶
func (p *Preferences) FontList() [][2]string
FontList returns the available font faces.
func (*Preferences) FontSizes ¶
func (p *Preferences) FontSizes() []string
FontSizes returns the available sizes.
func (*Preferences) LineHeights ¶
func (p *Preferences) LineHeights() []string
LineHeights returns the available line heights.
func (*Preferences) ReaderFont ¶
func (p *Preferences) ReaderFont() Pair
ReaderFont returns the user's reader font.
func (*Preferences) ReaderFontSize ¶
func (p *Preferences) ReaderFontSize() Pair
ReaderFontSize returns the user's reader font size.
func (*Preferences) ReaderLineHeight ¶
func (p *Preferences) ReaderLineHeight() Pair
ReaderLineHeight returns the user's reader line height.