config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides functions to read in various configuration files into definded types. This includes the main configuration file specifying all details about a distributed setup of pluto.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthFile

type AuthFile struct {
	File      string
	Separator string
}

AuthFile provides information on authenticating user taken from a designated authorization text file.

type AuthPostgres added in v0.1.6

type AuthPostgres struct {
	IP       string
	Port     uint16
	Database string
	User     string
	Password string
	UseTLS   bool
}

AuthPostgres defines parameters for connecting to a Postgres database for authenticating users.

type Config

type Config struct {
	RootCertLoc     string
	IntlConnTimeout int
	IntlConnRetry   int
	IMAP            IMAP
	Distributor     Distributor
	Workers         map[string]Worker
	Storage         Storage
}

Config holds all information parsed from supplied config file.

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

LoadConfig takes in the path to the main config file of pluto in TOML syntax and places the values from the file in the corresponding struct.

type Distributor

type Distributor struct {
	PublicIP     string
	ListenIP     string
	Port         string
	AuthAdapter  string
	PublicTLS    TLS
	InternalTLS  TLS
	AuthFile     *AuthFile
	AuthPostgres *AuthPostgres
}

Distributor describes the configuration of the first entry point of a pluto setup, the IMAP request authenticator and distributor.

type IMAP

type IMAP struct {
	Greeting           string
	HierarchySeparator string
}

IMAP is the IMAP server related part of the TOML config file.

type Storage

type Storage struct {
	PublicIP      string
	ListenIP      string
	MailPort      string
	SyncPort      string
	MaildirRoot   string
	CRDTLayerRoot string
	TLS           TLS
}

Storage configures the global database node storing all user data in a very safe manner.

type TLS

type TLS struct {
	CertLoc string
	KeyLoc  string
}

TLS contains Transport Layer Security relevant parameters. Use this to provide paths to your TLS certificate and key.

type Worker

type Worker struct {
	PublicIP      string
	ListenIP      string
	MailPort      string
	SyncPort      string
	UserStart     int
	UserEnd       int
	MaildirRoot   string
	CRDTLayerRoot string
	TLS           TLS
}

Worker contains the connection and user sharding information for an individual IMAP worker node.

Jump to

Keyboard shortcuts

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