* feat(backend): use channel of changed sessions instead of sync.Map * feat(backend): avoid memory alloc for message body in message iterator * feat(backend): removed unnecessary locks in file syncer * feat(backend): sync.Map with prev updates * feat(backend): improved write algorith (added bufio.Writer) * feat(backend): session writer refactoring * feat(backend): removed unnecessary type definition * feat(backend): added write retrier to avoid data losing * feat(backend): refactoring * feat(backend): added session file implementation
30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package sink
|
|
|
|
import (
|
|
"openreplay/backend/internal/config/common"
|
|
"openreplay/backend/internal/config/configurator"
|
|
)
|
|
|
|
type Config struct {
|
|
common.Config
|
|
FsDir string `env:"FS_DIR,required"`
|
|
FsUlimit uint16 `env:"FS_ULIMIT,required"`
|
|
FileBuffer int `env:"FILE_BUFFER,default=32768"`
|
|
SyncTimeout int `env:"SYNC_TIMEOUT,default=5"`
|
|
GroupSink string `env:"GROUP_SINK,required"`
|
|
TopicRawWeb string `env:"TOPIC_RAW_WEB,required"`
|
|
TopicRawIOS string `env:"TOPIC_RAW_IOS,required"`
|
|
TopicCache string `env:"TOPIC_CACHE,required"`
|
|
TopicTrigger string `env:"TOPIC_TRIGGER,required"`
|
|
CacheAssets bool `env:"CACHE_ASSETS,required"`
|
|
AssetsOrigin string `env:"ASSETS_ORIGIN,required"`
|
|
ProducerCloseTimeout int `env:"PRODUCER_CLOSE_TIMEOUT,default=15000"`
|
|
CacheThreshold int64 `env:"CACHE_THRESHOLD,default=5"`
|
|
CacheExpiration int64 `env:"CACHE_EXPIRATION,default=120"`
|
|
}
|
|
|
|
func New() *Config {
|
|
cfg := &Config{}
|
|
configurator.Process(cfg)
|
|
return cfg
|
|
}
|