config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 2 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       ConfigTransporter `yaml:"transporter"`
	Database          ConfigDatabase    `yaml:"database"`
	/// ---
	RPC ConfigRPC `yaml:"rpc"`
}

func NewConfig

func NewConfig() Config

func (*Config) GetConfig

func (c *Config) GetConfig() *Config

func (*Config) LoadFromFile

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

LoadFromFile load config yaml file from path

type ConfigDatabase

type ConfigDatabase struct {
	LevelDB map[string]ConfigLevelDB `yaml:"leveldb"`
	CouchDB ConfigDatabaseCouchDB    `yaml:"couch_db"`
}

/ -----

type ConfigDatabaseCouchDB

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

type ConfigLevelDB

type ConfigLevelDB struct {
	DbPath string `yaml:"path"`
}

type ConfigRPC

type ConfigRPC struct {
	Active   bool   `yaml:"active"`
	BindHost string `yaml:"bind_host"`
	BindPort string `yaml:"bind_port"`
}

type ConfigRedisTransporter

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

type ConfigTransporter

type ConfigTransporter struct {
	Redis *ConfigRedisTransporter `yaml:"redis"`
}

-- Transporters -- //

Jump to

Keyboard shortcuts

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