config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides specific directories for Heb12 with the apppaths module

Index

Constants

This section is empty.

Variables

View Source
var DataDirs = struct {
	Bibles string
	Gratis string
	Sword  string
}{
	"bibles",
	"bibles/gratis",
	"bibles/sword",
}

DataDirs contains the directories in which different data is stored

View Source
var DataFiles = struct {
	Highlights string
	Bookmarks  string
}{
	"highlights.json",
	"bookmarks.json",
}

DataFiles contains the different files in the data dir that have im

Functions

func GetScope

func GetScope() *gap.Scope

GetScope returns the gap scope for Heb12

func GratisDir

func GratisDir() (string, error)

A shortcut to get the directory for the Gratis versions

func InitDirs

func InitDirs() error

InitDirs makes all of the directories required for storing data and configuration

func WriteConfig

func WriteConfig(config Config) error

Write config writes config information to the config file

Types

type Config

type Config struct {
	GUI ConfigGUI `json:"gui"`
}

Config contains all the configuration needed for all apps

func ReadConfig

func ReadConfig() (Config, error)

ReadConfig reads the config file and marshals it into a Config

type ConfigGUI

type ConfigGUI struct {
	// Locale is localization code currently being used
	Locale string `json:"locale"`
	// Book is the ID of the last book loaded
	Book string `json:"book"`
	// Chapter is the last chapter of the last book loaded
	Chapter int `json:"chapter"`
	// Translation is the translation code of the last translation loaded
	Translation string `json:"translation"`
	// Theme is the color theme chosen
	Theme string `json:"theme"`
	Font  Font   `json:"font"`
}

ConfigGUI contains all the data stored in the config file for GUI apps

type Font

type Font struct {
	Family string `json:"family"`
	Size   int    `json:"size"`
}

Font contains font configuration information

Jump to

Keyboard shortcuts

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