config

package
v0.0.0-...-4e52b7f Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//AppName is the name representing the application.
	AppName = "Cordless"
	//AppNameLowercase is the representative name, but lowercase.
	//It us used for filepaths and such.
	AppNameLowercase = "cordless"

	//HourMinuteAndSeconds is the time format HH:MM:SS.
	HourMinuteAndSeconds = 0
	//HourAndMinute is the time format HH:MM.
	HourAndMinute = 1
	//NoTime means that not time at all will be displayed.
	NoTime = 2
)

Variables

This section is empty.

Functions

func GetConfigDirectory

func GetConfigDirectory() (string, error)

GetConfigDirectory is the parent directory in the os, that contains the settings for the application.

func GetConfigFile

func GetConfigFile() (string, error)

GetConfigFile returns the absolute path to the configuration file or an error in case of failure.

func PersistConfig

func PersistConfig() error

PersistConfig saves the current configuration onto the filesystem.

Types

type Config

type Config struct {
	//Token is the authorization token for accessing the discord API.
	Token string

	//Times decides on the time format (none, short and long).
	Times int

	//FocusChannelAfterGuildSelection will cause the widget focus to move over
	//to the channel tree after selecting a guild.
	FocusChannelAfterGuildSelection bool
	//FocusMessageInputAfterChannelSelection will cause the widget focus to
	//move over to the message input widget after channel selection
	FocusMessageInputAfterChannelSelection bool

	//ShowFrame decides wether the application will have a border and a title.
	ShowFrame bool
	//ShowChatHeader decides wether the box above the chat will be shown
	//or not.
	ShowChatHeader bool
	//ShowUserContainer decides wether the user container is part of the
	//layout or not.
	ShowUserContainer bool
	//UseFixedLayout defines whether the FixedSizeLeft and FixedSizeRight
	//values will be applied or not.
	UseFixedLayout bool
	//FixedSizeLeft determines the size of the guilds/channels/friends
	//container on the left side of the layout.
	FixedSizeLeft int
	//FixedSizeRight defines the size of the users container on the right.
	FixedSizeRight int
}

Config contains all possible configuration for the application.

func GetConfig

func GetConfig() *Config

GetConfig returns the currently loaded configuration.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the configuration initially and returns it.

Jump to

Keyboard shortcuts

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