config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName      = "Bookmarker"
	AppNameLower = "bookmarker"
	Version      = "0.1.0"
)

Variables

This section is empty.

Functions

func CreateDirectory

func CreateDirectory(dir string) error

func CreateFile

func CreateFile(name string) error

func DirectoryExists

func DirectoryExists(dir string) (bool, error)

func EnsureConfigDirExists

func EnsureConfigDirExists() error

func EnsureFileExists

func EnsureFileExists(name string) error

func FileExists

func FileExists(file string) (bool, error)

func GetConfigDirectory

func GetConfigDirectory() (string, error)

func SaveConfig

func SaveConfig(conf *ApplicationConfig) error

Types

type ApplicationConfig

type ApplicationConfig struct {
	LogLevel               string   `toml:"log_level"`
	HideArchived           bool     `toml:"default_hide_archived"`
	DefaultMetadata        []string `toml:"default_metadata_fields"`
	DataBase               string   `toml:"database_file"`
	Log                    string   `toml:"log_file"`
	AutoComplete           bool     `toml:"autocomplete"`
	AutoCompleteMaxResults int      `toml:"autocomplete_max_results"`
	EnableFullTextSearch   bool     `toml:"full_text_search"`
	Colors                 Colors
	Shortcuts              Shortcuts
	// contains filtered or unexported fields
}
var Configuration *ApplicationConfig = &ApplicationConfig{}

func ReadConfigFile

func ReadConfigFile(file string) (*ApplicationConfig, error)

ReadConfigFile reads config file from given file. If file is empty, use default location provided by os

func (*ApplicationConfig) ConfigDir

func (a *ApplicationConfig) ConfigDir() string

func (*ApplicationConfig) DbFile

func (a *ApplicationConfig) DbFile() string

func (*ApplicationConfig) Logfile

func (a *ApplicationConfig) Logfile() string

func (*ApplicationConfig) ParseLogLevel

func (a *ApplicationConfig) ParseLogLevel() (logrus.Level, error)

type ColorBookmarkForm

type ColorBookmarkForm struct {
	Background      tcell.Color
	Label           tcell.Color
	Text            tcell.Color
	TextSelected    tcell.Color
	TextBackground  tcell.Color
	TextPlaceHolder tcell.Color
}

type ColorBookmarks

type ColorBookmarks struct {
	Background         tcell.Color
	Background2nd      tcell.Color
	BackgroundSelected tcell.Color
	Text               tcell.Color
	TextSelected       tcell.Color
	HeaderText         tcell.Color
	HeaderBackground   tcell.Color
}

type ColorHelpPage

type ColorHelpPage struct {
	Background tcell.Color
	Text       tcell.Color
	Headers    tcell.Color
}

type ColorMetadata

type ColorMetadata struct {
	Background         tcell.Color
	BackgroundEditable tcell.Color
	Label              tcell.Color
	Text               tcell.Color
	TextSelected       tcell.Color
	TextBackground     tcell.Color
	TextEdited         tcell.Color
}

type ColorNavBar

type ColorNavBar struct {
	Background       tcell.Color
	BackgroundFocus  tcell.Color
	Text             tcell.Color
	TextFocus        tcell.Color
	ButtonBackground tcell.Color
	ButtonFocus      tcell.Color
	Shortcut         tcell.Color
	ShortcutFocus    tcell.Color
}

func (*ColorNavBar) ToNavBar

func (c *ColorNavBar) ToNavBar() *twidgets.NavBarColors

type ColorProjects

type ColorProjects struct {
	Background         tcell.Color
	BackgroundSelected tcell.Color
	Text               tcell.Color
	TextSelected       tcell.Color
	Header             tcell.Color
}

type ColorTags

type ColorTags struct {
	Background         tcell.Color
	BackgroundSelected tcell.Color
	Text               tcell.Color
	TextSelected       tcell.Color
	EmptyTag           tcell.Color
	Count              tcell.Color
}

type Colors

type Colors struct {
	Background               tcell.Color
	TextPrimary              tcell.Color
	TextPrimaryLight         tcell.Color
	TextPrimaryDim           tcell.Color
	SelectionBackground      tcell.Color
	SelectionText            tcell.Color
	Border                   tcell.Color
	BorderFocus              tcell.Color
	ButtonBackground         tcell.Color
	ButtonBackgroundSelected tcell.Color
	ButtonLabel              tcell.Color
	ButtonLabelSelected      tcell.Color
	ModalBackground          tcell.Color
	NavBar                   ColorNavBar
	Bookmarks                ColorBookmarks
	Projects                 ColorProjects
	BookmarkForm             ColorBookmarkForm
	Tags                     ColorTags
	Metadata                 ColorMetadata
	HelpPage                 ColorHelpPage
}
type NavBar struct {
	Help        tcell.Key
	NewBookmark tcell.Key
	OpenBrowser tcell.Key
	Menu        tcell.Key
	Quit        tcell.Key
}

type Shortcuts

type Shortcuts struct {
	NavBar NavBar
}

Jump to

Keyboard shortcuts

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