Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigsSet = wire.NewSet( NewConfigurator, NewAppConfig, NewMongoConfig, NewListenerConfig, NewPublisherConfig, NewLoggerConfig, NewMetricsConfig, wire.Bind(new(publisher.IPublisherConfigFactory), new(*PublisherConfig)), )
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 ¶
IsProduction Check is application running in production mode
type Configurator ¶
type Configurator struct{}
Configurator dummy
func NewConfigurator ¶
func NewConfigurator() *Configurator
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 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 ¶
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 ¶
func (p *PublisherConfig) Config() publisher.PublisherConfig
Click to show internal directories.
Click to hide internal directories.