config

package
v0.0.0-...-6edac6f Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindOptions

func BindOptions(m map[string]interface{}, v interface{}) error

func Init

func Init()

Types

type Broker

type Broker struct {
	Name    string                 `json:"name" structs:"name" mapstructure:"name"`
	Type    string                 `json:"type" structs:"type" mapstructure:"type"`
	Options map[string]interface{} `json:"options" structs:"options" mapstructure:"options"`
}

type Bus

type Bus struct {
	Debug   bool                   `json:"debug" yaml:"debug" mapstructure:"debug" structs:"debug"`
	Trace   bool                   `json:"trace" yaml:"trace" mapstructure:"trace" structs:"trace"`
	Brokers []Broker               `json:"broker" structs:"broker" mapstructure:"broker"`
	Options map[string]interface{} `json:"options" structs:"options" mapstructure:"options"`
}

func DefaultBusConfig

func DefaultBusConfig() Bus

type Cache

type Cache struct {
	Store             string `json:"store" yaml:"store" mapstructure:"store"`
	DefaultExpiration int    `json:"default_expiration" yaml:"default_expiration" mapstructure:"default_expiration"`
}

func DefaultCacheConfig

func DefaultCacheConfig() Cache

type Config

type Config struct {
	Debug    bool     `json:"debug" yaml:"debug" mapstructure:"debug"`
	Logger   Logger   `json:"logger" yaml:"logger" mapstructure:"logger"`
	Database Database `json:"database" yaml:"database" mapstructure:"database"`
	Bus      Bus      `json:"bus" yaml:"bus" mapstructure:"bus"`
	Cache    Cache    `json:"cache" yaml:"cache" mapstructure:"cache"`
	Server   Server   `json:"server" yaml:"server" mapstructure:"server"`
	Modules  []Module `json:"modules" yaml:"modules" mapstructure:"modules"`
}

func DefaultConfig

func DefaultConfig() Config

func NewConfig

func NewConfig(v *viper.Viper) (*Config, error)

type Database

type Database struct {
	Dialect  string `json:"dialect" yaml:"dialect"`
	URL      string `json:"url" yaml:"url"`
	Host     string `json:"host" yaml:"host"`
	User     string `json:"user" yaml:"user"`
	Password string `json:"password" yaml:"password"`
	Database string `json:"database" yaml:"database"`
	SSLMode  string `json:"ssl_mode" yaml:"ssl_mode"`
}

func DefaultDatabaseConfig

func DefaultDatabaseConfig() Database

func (Database) ConnString

func (dbc Database) ConnString() string

func (Database) Driver

func (dbc Database) Driver() driver.Driver

func (Database) EntDialect

func (dbc Database) EntDialect() string

type FileStore

type FileStore struct {
	Provider string                 `json:"provider" yaml:"provider"`
	Options  map[string]interface{} `json:"options" yaml:"options"`
}

type Logger

type Logger struct {
	Outputs map[string]Output `json:"outputs" yaml:"outputs" mapstructure:"outputs"`
}

func DefaultLoggerConfig

func DefaultLoggerConfig() Logger

type Module

type Module struct {
	Name    string                 `json:"name" yaml:"name" mapstructure:"name"`
	Type    string                 `json:"type" yaml:"type" mapstructure:"type"`
	Source  message.Path           `json:"source" yaml:"source" mapstructure:"source"`
	Sink    message.Path           `json:"sink" yaml:"sink" mapstructure:"sink"`
	Options map[string]interface{} `json:"options" yaml:"options" mapstructure:"options"`
}

func DefaultModuleConfig

func DefaultModuleConfig() []Module

type Output

type Output struct {
	Type    string                 `json:"type" yaml:"type" mapstructure:"type"`
	Options map[string]interface{} `json:"options" yaml:"options" mapstructure:"options"`
}

type Processor

type Processor struct {
	Name    string
	Type    string
	Options map[string]interface{}
}

type Server

type Server struct {
	Host          string       `json:"host" yaml:"host" mapstructure:"host" yaml.mapstructure:"host"`
	Port          string       `json:"port" yaml:"port" mapstructure:"port" yaml.mapstructure:"port"`
	EnableMetrics bool         `json:"enable_metrics" yaml:"enable_metrics" mapstructure:"enable_metrics" yaml.mapstructure:"enable_metrics"`
	Health        ServerHealth `json:"health" yaml:"health" mapstructure:"health"`
}

func DefaultServerConfig

func DefaultServerConfig() Server

func (Server) HostPort

func (c Server) HostPort() string

type ServerHealth

type ServerHealth struct {
	Enabled  bool   `json:"enabled" yaml:"enabled" mapstructure:"enabled"`
	Path     string `json:"path" yaml:"path" mapstructure:"path"`
	Listener string `json:"listener" yaml:"listener" mapstructure:"listener"`
}

Jump to

Keyboard shortcuts

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