configs

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ConfigsSet contains project configs

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name string `mapstructure:"name"`
	Port string `mapstructure:"port"`
	Mode string `mapstructure:"mode"`
}

MetricsConfig holds the main app configurations

func NewAppConfig

func NewAppConfig(c *Configurator) *AppConfig

func (AppConfig) IsProduction

func (ac AppConfig) IsProduction() bool

IsProduction Check is application running in production mode

type Configurator

type Configurator struct{}

Configurator dummy

func NewConfigurator

func NewConfigurator() *Configurator

type DbColl

type DbColl struct {
	Db   string
	Coll string
}

DbColl represent database and collection names

type FilterConfig

type FilterConfig struct {
	Db          string              `mapstructure:"db"`
	Collections map[string][]string `mapstructure:"collections"`
}

FilterConfig use for filter collections and operations

type ListenerConfig

type ListenerConfig struct {
	Filter    []FilterConfig    `mapstructure:"filter"`
	TopicsMap map[string]string `mapstructure:"topicsMap"`

	MappedFilter map[string][]string
}

ListenerConfig holds the main app configurations

func NewListenerConfig

func NewListenerConfig(c *Configurator) *ListenerConfig

func (*ListenerConfig) GetDbCollBySubject

func (c *ListenerConfig) GetDbCollBySubject(subj string) *DbColl

GetDbCollBySubject return db and collection names by subject

func (*ListenerConfig) GetSubject

func (c *ListenerConfig) GetSubject(db, coll string) string

GetSubject make subj from db and collection names

func (*ListenerConfig) GetTopicBySubject

func (c *ListenerConfig) GetTopicBySubject(subj string) string

GetTopicBySubject map subject to topic

type LogFormat added in v1.2.0

type LogFormat string
var (
	LogJsonFormat   LogFormat = "json"
	LogPrettyFormat LogFormat = "pretty"
)

type LoggerConfig added in v1.2.0

type LoggerConfig struct {
	Level  slog.Level `mapstructure:"level"`
	Format LogFormat  `mapstructure:"format"`
}

MetricsConfig holds the main app configurations

func NewLoggerConfig added in v1.2.0

func NewLoggerConfig(c *Configurator) *LoggerConfig

type MetricsConfig added in v1.2.0

type MetricsConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

MetricsConfig holds the main app configurations

func NewMetricsConfig added in v1.2.0

func NewMetricsConfig(c *Configurator) *MetricsConfig

func (*MetricsConfig) IsEnabled added in v1.2.0

func (c *MetricsConfig) IsEnabled() bool

IsEnabled Checks of metrics enabled

type MongoConfig

type MongoConfig struct {
	URI   string `mapstructure:"uri"`
	Debug bool   `mapstructure:"debug"`
}

func NewMongoConfig

func NewMongoConfig(c *Configurator) *MongoConfig

type PublisherConfig

type PublisherConfig struct {
	// HINT: default topic
	Topic       string                  `mapstructure:"topic"`
	TopicPrefix string                  `mapstructure:"topicPrefix"`
	Addr        string                  `mapstructure:"uri"`
	Type        publisher.PublisherType `mapstructure:"type"`
}

PublisherConfig holds the main app configurations

func NewPublisherConfig

func NewPublisherConfig(c *Configurator) *PublisherConfig

func (*PublisherConfig) Config

Jump to

Keyboard shortcuts

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