Documentation ¶
Index ¶
- type Config
- func (c Config) GetFilePath() (string, error)
- func (c *Config) GetLiveRoomByUrl(url string) (*LiveRoom, error)
- func (c *Config) Marshal() error
- func (c *Config) RefreshLiveRoomIndexCache()
- func (c *Config) RemoveLiveRoomByUrl(url string) error
- func (c *Config) UpdateLiveRoomByUrl(url string, room *LiveRoom) error
- func (c *Config) Verify() error
- type Feature
- type LiveRoom
- type Log
- type OnRecordFinished
- type RPC
- type VideoSplitStrategies
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { File string `yaml:"-"` // 配置文件路径 RPC RPC `yaml:"rpc"` // RPC配置 Debug bool `yaml:"debug"` // 是否启用调试模式 Interval int `yaml:"interval"` // 采集间隔 OutPutPath string `yaml:"out_put_path"` // 输出路径 FfmpegPath string `yaml:"ffmpeg_path"` // FFmpeg路径 Log Log `yaml:"log"` // 日志配置 Feature Feature `yaml:"feature"` // 特性配置 LiveRooms []LiveRoom `yaml:"live_rooms"` // 直播房间配置 OutputTmpl string `yaml:"out_put_tmpl"` // 输出模板 VideoSplitStrategies VideoSplitStrategies `yaml:"video_split_strategies"` // 视频分割策略 Cookies map[string]string `yaml:"cookies"` // Cookies配置 OnRecordFinished OnRecordFinished `yaml:"on_record_finished"` // 录制完成后的操作配置 TimeoutInUs int `yaml:"timeout_in_us"` // 超时时间(微秒) // contains filtered or unexported fields }
Config包含所有配置信息。
func NewConfigWithBytes ¶
NewConfigWithBytes 使用字节数组创建Config对象。
func NewConfigWithFile ¶
NewConfigWithFile 使用文件创建Config对象。
func (*Config) GetLiveRoomByUrl ¶
GetLiveRoomByUrl 通过URL获取直播房间。
func (*Config) RefreshLiveRoomIndexCache ¶
func (c *Config) RefreshLiveRoomIndexCache()
RefreshLiveRoomIndexCache 刷新直播房间索引缓存。
func (*Config) RemoveLiveRoomByUrl ¶
RemoveLiveRoomByUrl 通过URL移除直播房间。
func (*Config) UpdateLiveRoomByUrl ¶
UpdateLiveRoomByUrl 通过URL更新直播房间。
type Feature ¶
type Feature struct { UseNativeFlvParser bool `yaml:"use_native_flv_parser"` // 是否使用本地FLV解析器 RemoveSymbolOtherCharacter bool `yaml:"remove_symbol_other_character"` // 是否删除特殊符号 }
Feature包含特性相关信息。
type LiveRoom ¶
type LiveRoom struct { Url string `yaml:"url"` // 直播房间URL Listen bool `yaml:"listen"` // 监听 Listening bool `yaml:"is_listening"` // 监听状态 Record bool `yaml:"record"` // 录制 Recordind bool `yaml:"is_recording"` // 录制状态 LiveId live.ID `yaml:"-"` // 直播ID Quality int `yaml:"quality"` // 视频质量 Rtmp string `yaml:"rtmp"` // 转推地址 Push bool `yaml:"push"` // 转推 Pushing bool `yaml:"is_pushing"` // 转推状态 }
LiveRoom包含直播房间信息。
func NewLiveRoomsWithStrings ¶
NewLiveRoomsWithStrings 从字符串数组创建LiveRoom列表。
func (*LiveRoom) UnmarshalYAML ¶
UnmarshalYAML 实现了LiveRoom的自定义反序列化。
type Log ¶
type Log struct { OutPutFolder string `yaml:"out_put_folder"` // 输出日志文件夹 SaveLastLog bool `yaml:"save_last_log"` // 是否保存最后一条日志 SaveEveryLog bool `yaml:"save_every_log"` // 是否保存每一条日志 }
Log包含日志相关信息。
type OnRecordFinished ¶
type OnRecordFinished struct { ConvertToMp4 bool `yaml:"convert_to_mp4"` // 是否转换为MP4格式 DeleteFlvAfterConvert bool `yaml:"delete_flv_after_convert"` // 转换后是否删除FLV文件 CustomCommandline string `yaml:"custom_commandline"` // 自定义命令行操作 }
OnRecordFinished包含录制完成后的操作信息。
Click to show internal directories.
Click to hide internal directories.