configuration

package
v0.0.0-...-8c0eaba Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Cadmium - multiprotocol crossplatform messenger. Copyright (c) 2017, Stanislav N aka pztrn. Copyright (c) 2017, Cadmium developers and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Cadmium - multiprotocol crossplatform messenger. Copyright (c) 2017, Stanislav N aka pztrn. Copyright (c) 2017, Cadmium developers and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Cadmium - multiprotocol crossplatform messenger. Copyright (c) 2017, Stanislav N aka pztrn. Copyright (c) 2017, Cadmium developers and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cc *context.Context)

Types

type Config

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

Config provides access to configuration storage. It also stores some basic variables that defined in temporary configuration storage. They can be accessed with these keys:

  • CONFIGPATH - application's configuration path, defaulting to /Users/<user>/Library/Application Support/Cadmium os macOS, ~/.config/Cadmium on Nixes and APPDATA/Roaming/Cadmiun on Windows. This path is used to build other paths, like database path, caches path, etc.
  • CACHEPATH - application's caches path.

func (*Config) GetTempValue

func (cfg *Config) GetTempValue(key string) string

GetTempValue returns value for key from temporary configuration storage.

func (*Config) GetValue

func (cfg *Config) GetValue(key string) string

GetValue returns value for key from persistent configuration storage.

func (*Config) Initialize

func (cfg *Config) Initialize()

Initialize initializes configuration storage and application paths for later access by e.g. Database.

func (*Config) LaterLoadConfig

func (cfg *Config) LaterLoadConfig()

LaterLoadConfig loads configuration from already initialized database and adds some events handlers.

func (*Config) SetTempValue

func (cfg *Config) SetTempValue(key string, value string)

SetTempValue sets value for key in temporary configuration storage.

func (*Config) SetValue

func (cfg *Config) SetValue(key string, value string)

SetValue sets value for key in persistent configuration storage.

type ConfigHandler

type ConfigHandler struct{}

ConfigHandler provides handler for ConfigurationInterface. It launching real functions from Config struct.

func (ConfigHandler) GetTempValue

func (ch ConfigHandler) GetTempValue(key string) string

func (ConfigHandler) GetValue

func (ch ConfigHandler) GetValue(key string) string

func (ConfigHandler) Initialize

func (ch ConfigHandler) Initialize()

func (ConfigHandler) LaterLoadConfig

func (ch ConfigHandler) LaterLoadConfig()

func (ConfigHandler) SetTempValue

func (ch ConfigHandler) SetTempValue(key string, value string)

func (ConfigHandler) SetValue

func (ch ConfigHandler) SetValue(key string, value string)

Directories

Path Synopsis
Cadmium - multiprotocol crossplatform messenger.
Cadmium - multiprotocol crossplatform messenger.

Jump to

Keyboard shortcuts

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