openreplay/backend/internal/config/storage/config.go
Alexander a68351d509
[Backend] Zstd support for mob files (#1732)
* feat(backend): added zstd compression support to storage service

* feat(backend): try to ignore content-encoding for zstd compression
2023-12-04 16:00:59 +01:00

33 lines
1.3 KiB
Go

package storage
import (
"openreplay/backend/internal/config/common"
"openreplay/backend/internal/config/configurator"
"openreplay/backend/internal/config/objectstorage"
"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() *Config {
cfg := &Config{}
configurator.Process(cfg)
return cfg
}