config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationConfig

type ApplicationConfig interface {
	LoadFromFile(filePath string) error
	GetConfig() *Config
}

ApplicationConfig interface

type Config

type Config struct {
	ApplicationConfig `yaml:"-"`
	Debug             bool        `yaml:"debug"`
	Transporter       Transporter `yaml:"transporter"`
	Database          Database    `yaml:"database"`
}

Config file definition

func NewConfig

func NewConfig() Config

NewConfig creates new empty Config struct

func (*Config) GetConfig

func (c *Config) GetConfig() *Config

GetConfig returns Config struct options

func (*Config) LoadFromFile

func (c *Config) LoadFromFile(filePath string) error

LoadFromFile load config yaml file from path

type Database added in v0.1.1

type Database struct {
	LevelDB map[string]DatabaseLevelDB `yaml:"leveldb"`
	SQLite  map[string]DatabaseSQLite  `yaml:"sqlite"`
	CouchDB DatabaseCouchDB            `yaml:"couch_db"`
}

Database config options

type DatabaseCouchDB added in v0.1.1

type DatabaseCouchDB struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Prefix   string `yaml:"prefix"`
}

DatabaseCouchDB couchDB config options

type DatabaseLevelDB added in v0.1.1

type DatabaseLevelDB struct {
	DbPath          string `yaml:"path"`
	WriteBufferSize int    `yaml:"writeBufferSize"`
}

DatabaseLevelDB leveldb config options

type DatabaseSQLite added in v0.1.3

type DatabaseSQLite struct {
	DbPath             string `yaml:"path"`
	Options            string `yaml:"options"`
	MaxOpenConnections int    `yaml:"maxOpenConnections"`
}

DatabaseSQLite sqlite config option

type RedisTransporter added in v0.1.1

type RedisTransporter struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Db       uint   `yaml:"db"`
}

RedisTransporter config options

type Transporter added in v0.1.1

type Transporter struct {
	Timeout           uint                 `yaml:"timeout"`
	HeartbeatInterval uint                 `yaml:"heartbeatInterval"`
	DeliveryMethod    types.DeliveryMethod `yaml:"deliveryMethod"`
	Redis             *RedisTransporter    `yaml:"redis"`
}

Transporter configuration options

Jump to

Keyboard shortcuts

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