config

package
v0.0.0-...-e474068 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2017 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemConfigPath = "/etc/syndication/config.toml"
)

Variables

View Source
var (
	DefaultDatabaseConfig = Database{
		Type:       "sqlite3",
		Connection: "/var/syndication/syndication.db",
	}

	DefaultServerConfig = Server{
		EnableRequestLogs:     false,
		EnablePanicPrintStack: true,
		AuthSecret:            "",
		AuthSecreteFilePath:   "",
		HTTPPort:              80,
	}

	DefaultAdminConfig = Admin{
		SocketPath:     "/var/syndication/syndication.admin",
		MaxConnections: 5,
	}

	DefaultSyncConfig = Sync{
		SyncInterval: time.Minute * 15,
	}

	DefaultConfig = Config{
		Databases: map[string]Database{
			"sqlite": DefaultDatabaseConfig,
		},
		Admin:  DefaultAdminConfig,
		Server: DefaultServerConfig,
		Sync:   DefaultSyncConfig,
	}
)

Functions

This section is empty.

Types

type Admin

type Admin struct {
	SocketPath     string `toml:"socket_path"`
	MaxConnections int    `toml:"max_connections"`
}

type Config

type Config struct {
	Database  `toml:"-"`
	Databases map[string]Database `toml:"database"`
	Server    Server
	Sync      Sync
	Admin     Admin
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(path string) (config Config, err error)

func NewEmptyConfig

func NewEmptyConfig(path string) Config

func (*Config) Save

func (c *Config) Save() error

type Database

type Database struct {
	Type       string `toml:"-"`
	Enable     bool
	Connection string
}

type FileSystemError

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

func (FileSystemError) Error

func (e FileSystemError) Error() string

type InvalidFieldValue

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

func (InvalidFieldValue) Error

func (e InvalidFieldValue) Error() string

type ParsingError

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

func (ParsingError) Error

func (e ParsingError) Error() string

type Server

type Server struct {
	AuthSecret            string        `toml:"auth_secret"`
	AuthSecreteFilePath   string        `toml:"auth_secret_file_path"`
	EnableTLS             bool          `toml:"enable_tls"`
	EnableRequestLogs     bool          `toml:"enable_http_requests_log"`
	EnablePanicPrintStack bool          `toml:"enable_panic_print_stack"`
	Domain                string        `toml:"domain"`
	CertCacheDir          string        `toml:"cert_cache_dir"`
	MaxShutdownTime       int           `toml:"max_shutdown_time"`
	HTTPPort              int           `toml:"http_port"`
	ShutdownTimeout       time.Duration `toml:"shutdown_timeout"`
	APIKeyExpiration      time.Duration `toml:"api_key_expiration"`
	TLSPort               int           `toml:"tls_port"`
}

type Sync

type Sync struct {
	SyncTime     time.Time     `toml:"time"`
	SyncInterval time.Duration `toml:"interval"`
}

Jump to

Keyboard shortcuts

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