config

package
v0.0.0-...-161b4be Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteEmptyConf

func WriteEmptyConf(fname string) error

WriteEmptyConf writes a new, empty configuration file to the filename with the given name. The configuration file is in TOML format and contains some sensible defaults for most non-sensitive key/value pairs.

Types

type Config

type Config struct {
	Providers  map[string]ProviderConfig
	MemStore   MemStoreConfig
	WebService WebServiceConfig
	Sync       SyncConfig
}

Config contains the application configuration.

func NewConfig

func NewConfig(fname string) (Config, error)

NewConfig returns a app configuration struct, loaded from a TOML file. If a file path is included in the file name, the file will be loaded from that path. Otherwise, NewConfig will assume that the file is available in the same directory as the autobot executable and attempt to load it from there.

type FtpConfig

type FtpConfig struct {
	Host       string
	Port       int
	User       string
	Password   string
	Dir        string
	FilePrefix string
}

FtpConfig contains FTP connection configuration.

type LookupConfig

type LookupConfig struct {
	LookupSupported bool
	LookupSecure    bool
	LookupHost      string
	LookupPath      string
	LookupKey       string
}

LookupConfig contains configuration for performing direct vehicle lookups via an API.

type MemStoreConfig

type MemStoreConfig struct {
	Host     string
	Port     int
	Password string
	DB       int
}

MemStoreConfig contains configuration for memory store / Redis.

type ProviderConfig

type ProviderConfig struct {
	FtpConfig
	LookupConfig
}

ProviderConfig contains configuration for the data provider.

type SyncConfig

type SyncConfig struct {
	SyncedFileString string
	VehicleMap       string
	VINSortedSet     string
	RegNrSortedSet   string
	HistorySortedSet string
	EarliestRegDate  date
}

SyncConfig contains configuration related to the actual synchronization algorithm.

type WebServiceConfig

type WebServiceConfig struct {
	Schedule string
}

WebServiceConfig contains configuration related to the web service and sync scheduler.

Jump to

Keyboard shortcuts

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