config

package
v0.0.0-...-2ebb5e3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 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
}

type Config

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

func NewConfig

func NewConfig() Config

func (*Config) GetConfig

func (c *Config) GetConfig() *Config

func (*Config) LoadFromFile

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

type Database

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

type DatabaseCouchDB

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

type DatabaseLevelDB

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

type DatabaseSQLite

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

type RedisTransporter

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

type Transporter

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

Jump to

Keyboard shortcuts

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