maConf

package
v0.0.0-...-81639f7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package maConf reads and writes the configurations.

Index

Constants

View Source
const (
	// VERSION contains the mahou version.
	VERSION = "0.0.1"
	// PATH contains relative or absolute default path to the configuration
	// file.
	PATH = "mahou.conf"
)

Variables

This section is empty.

Functions

func PopulateConfig

func PopulateConfig(file string) error

PopulateConfig copies the sample config to <path>.

Types

type Config

type Config struct {
	Login *Login
	Prefs *Preferences
	// contains filtered or unexported fields
}

Config represents the whole mahou configuration, containing all the needed substructures.

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig reads the configuration file.

func (*Config) UpdateCredentials

func (conf *Config) UpdateCredentials(userID string, accessToken string,
	homeServer string) error

UpdateCredentials writes access token to the config and redacts localpart and password.

type Login

type Login struct {
	Localpart  string
	Password   string
	HomeServer string

	UserID      string
	AccessToken string
}

Login represents the information needed to log into a Matrix server.

type Preferences

type Preferences struct {
}

Preferences represents settings that are not required.

Jump to

Keyboard shortcuts

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