Files
VptPassiveAdapter/config/dto.go
Jerry Yan 11f508342d feat(config): 更新配置文件并新增自定义时间类型
- 修改 config.yaml 中的 API 地址、存储配置及设备信息
- 新增 Viid 配置项支持新功能模块
- 在 go.mod 和 go.sum 中更新依赖包版本,引入新的第三方库
- 添加 model/custom_time.go 文件实现自定义时间类型的 JSON 序列化与反序列化
- 调整 DTO 结构体以适配新的配置项
- 升级 OTLP 导出器相关依赖并移除旧的标准输出导出器
- 引入 Gin 框架及相关中间件提升服务性能
- 更新 Protobuf 和 gRPC 相关依赖至最新版本
- 增加 zap 日志库和 lumberjack 日志轮转支持
- 添加 sonic、json-iterator 等高性能 JSON 处理库优化数据解析效率
- 引入 testify 断言库增强测试代码可读性
- 更新 sync 包版本提高并发安全性
- 添加 mock 工具支持单元测试模拟对象
- 引入 validator/v10 实现请求参数校验功能
- 更新 crypto、net、text 等标准库依赖确保安全性和兼容性
- 增加 mimetype 库用于文件类型识别
- 引入 quic-go 支持 HTTP/3 协议通信
- 添加 base64x
2025-11-24 16:12:31 +08:00

53 lines
1.5 KiB
Go

package config
type ApiConfig struct {
BaseUrl string `mapstructure:"baseUrl"`
}
type RecordConfig struct {
Storage StorageConfig `mapstructure:"storage"`
Duration int `mapstructure:"duration"`
}
type StorageConfig struct {
Type string `mapstructure:"type"`
Path string `mapstructure:"path"`
S3 S3Config `mapstructure:"s3"`
}
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 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 MainConfig struct {
Api ApiConfig `mapstructure:"api"`
Record RecordConfig `mapstructure:"record"`
Devices []DeviceMapping `mapstructure:"devices"`
FileName FileNameConfig `mapstructure:"fileName"`
Viid ViidConfig `mapstructure:"viid"`
}