* feat(backend): try a new approach for logs formatting (http) * feat(backend): added logger module * feat(backend): added project/session info to /i endpoint * feat(backend): found a solution for correct caller information * feat(backend): finished logs for http handlers * feat(backend): finished logs for mobile http handlers * feat(backend): finished ender * feat(backend): finished assets * feat(backend): finished heuristics * feat(backend): finished image-storage * feat(backend): finished sink * feat(backend): finished storage * feat(backend): formatted logs in all services * feat(backend): finished foss part * feat(backend): added missed foss part * feat(backend): fixed panic in memory manager and sink service * feat(backend): connectors
34 lines
1.4 KiB
Go
34 lines
1.4 KiB
Go
package storage
|
|
|
|
import (
|
|
"openreplay/backend/internal/config/common"
|
|
"openreplay/backend/internal/config/configurator"
|
|
"openreplay/backend/internal/config/objectstorage"
|
|
"openreplay/backend/pkg/logger"
|
|
"time"
|
|
)
|
|
|
|
type Config struct {
|
|
common.Config
|
|
objectstorage.ObjectsConfig
|
|
FSDir string `env:"FS_DIR,required"`
|
|
FileSplitSize int `env:"FILE_SPLIT_SIZE,required"`
|
|
RetryTimeout time.Duration `env:"RETRY_TIMEOUT,default=2m"`
|
|
GroupStorage string `env:"GROUP_STORAGE,required"`
|
|
TopicTrigger string `env:"TOPIC_TRIGGER,required"`
|
|
GroupFailover string `env:"GROUP_STORAGE_FAILOVER"`
|
|
TopicFailover string `env:"TOPIC_STORAGE_FAILOVER"`
|
|
DeleteTimeout time.Duration `env:"DELETE_TIMEOUT,default=48h"`
|
|
ProducerCloseTimeout int `env:"PRODUCER_CLOSE_TIMEOUT,default=15000"`
|
|
UseFailover bool `env:"USE_FAILOVER,default=false"`
|
|
MaxFileSize int64 `env:"MAX_FILE_SIZE,default=524288000"`
|
|
UseSort bool `env:"USE_SESSION_SORT,default=true"`
|
|
UseProfiler bool `env:"PROFILER_ENABLED,default=false"`
|
|
CompressionAlgo string `env:"COMPRESSION_ALGO,default=gzip"` // none, gzip, brotli, zstd
|
|
}
|
|
|
|
func New(log logger.Logger) *Config {
|
|
cfg := &Config{}
|
|
configurator.Process(log, cfg)
|
|
return cfg
|
|
}
|