Files
VptPassiveAdapter/config/dto.go
2026-03-13 00:06:39 +08:00

81 lines
2.5 KiB
Go

package config
type ApiConfig struct {
BaseUrl string `mapstructure:"baseUrl"`
}
type CacheConfig struct {
FileListTTLSeconds int `mapstructure:"fileListTTLSeconds"`
FileListMaxEntries int `mapstructure:"fileListMaxEntries"`
}
type RecordConfig struct {
Storage StorageConfig `mapstructure:"storage"`
Duration int `mapstructure:"duration"`
Cache CacheConfig `mapstructure:"cache"`
}
type StorageConfig struct {
Type string `mapstructure:"type"`
Path string `mapstructure:"path"`
S3 S3Config `mapstructure:"s3"`
AliOSS AliOSSConfig `mapstructure:"aliOss"`
}
type S3Config struct {
Region string `mapstructure:"region"`
Endpoint string `mapstructure:"endpoint"`
Bucket string `mapstructure:"bucket"`
Prefix string `mapstructure:"prefix"`
AkId string `mapstructure:"akId"`
AkSec string `mapstructure:"akSec"`
}
type AliOSSConfig struct {
Endpoint string `mapstructure:"endpoint"`
Bucket string `mapstructure:"bucket"`
Prefix string `mapstructure:"prefix"`
AccessKeyId string `mapstructure:"accessKeyId"`
AccessKeySecret string `mapstructure:"accessKeySecret"`
}
type DeviceMapping struct {
DeviceNo string `mapstructure:"deviceNo" json:"deviceNo"`
Name string `mapstructure:"name" json:"name"`
}
type FileNameConfig struct {
DateSeparator string `mapstructure:"dateSeparator"`
TimeSplit string `mapstructure:"timeSplit"`
FileExt string `mapstructure:"fileExt"`
UnfinishedFileExt string `mapstructure:"unFinExt"`
}
type ViidConfig struct {
Enabled bool `mapstructure:"enabled"`
ServerUrl string `mapstructure:"serverUrl"`
ScenicId int64 `mapstructure:"scenicId"`
Port int `mapstructure:"port"`
}
type DisconnectActionConfig struct {
Enabled bool `mapstructure:"enabled"`
ThresholdMinutes int `mapstructure:"thresholdMinutes"`
Command string `mapstructure:"command"`
}
type PreviewConfig struct {
Enabled bool `mapstructure:"enabled"`
Resolutions []int `mapstructure:"resolutions"`
}
type MainConfig struct {
Api ApiConfig `mapstructure:"api"`
Record RecordConfig `mapstructure:"record"`
Devices []DeviceMapping `mapstructure:"devices"`
FileName FileNameConfig `mapstructure:"fileName"`
Viid ViidConfig `mapstructure:"viid"`
DisconnectAction DisconnectActionConfig `mapstructure:"disconnectAction"`
Preview PreviewConfig `mapstructure:"preview"`
}