Documentation ¶
Index ¶
- Constants
- Variables
- func GetDirID(dir_name string) (dir_id string, err error)
- func InitGDrive()
- func InitLogger()
- func LoadCfgRecorder()
- func MakeDir(dir_name string, parent_id ...string) (dir_id string, err error)
- func NewDownloader(url, filePath string) *downloader
- func ReadConfig(configFilePath string) error
- type Config
- type DownloadCBCodeType
- type GDriveUploader
- type IRecorderMngr
- type RecordConfig
- type Recorder
- type Rule
- type Uploader
- type UploaderType
Constants ¶
View Source
const ERROR_CONTENT_DEF = "err_content"
View Source
const MIN_UPLOAD_FILE_SIZE int64 = 1024 * 256 // 最小上传大小
Variables ¶
View Source
var ( GDRIVE_ROOT_DIR = "LiveAuto" // 所有上传所在根目录 GDRIVE_ROOT_DIR_ID = "" // 查询出来的根目录ID )
View Source
var Logger *logrus.Logger
Functions ¶
func InitGDrive ¶
func InitGDrive()
func InitLogger ¶
func InitLogger()
func NewDownloader ¶
func NewDownloader(url, filePath string) *downloader
func ReadConfig ¶
Types ¶
type Config ¶
type Config struct { XMLName xml.Name `xml:"config"` PieceSize int64 `xml:"piece_size"` Proxy string `xml:"proxy"` CheckInterval int `xml:"check_interval"` OutPutDirPath string `xml:"out_put_dir_path"` RecordRules recordRules `xml:"record_rules"` }
var G_Config *Config
type DownloadCBCodeType ¶
type DownloadCBCodeType int
const ( NORMAL_END DownloadCBCodeType = iota // 通常的情况 live流中断、结束 WRITE_ERROR // 写入硬盘错误 空间满了 NEXT_PIECE // 单片段达到大小上限 UNSTART_ERROR STOP_SELF // 主动停止 LIVE_STREAM_NIL )
downloader返回值定义
type GDriveUploader ¶
type GDriveUploader struct { Recorder *Recorder // contains filtered or unexported fields }
func (*GDriveUploader) DoUpload ¶
func (self *GDriveUploader) DoUpload(file_path string)
type IRecorderMngr ¶
type IRecorderMngr interface { AddRecorder(*Recorder) error RemoveRecorder(id api.LiveId) error GetRecorder(id api.LiveId) *Recorder GetAllRecorder() []*Recorder }
func GetIRecorderMngr ¶
func GetIRecorderMngr() IRecorderMngr
type RecordConfig ¶
type RecordConfig struct { // 循环 Loop bool // TODO BeginTime int EndTime int EnableUploaders []UploaderType AutoRemove bool // 上传成功后删除本地文件 }
type Recorder ¶
type Recorder struct { RecordConfig Live api.Live Uploaders []Uploader IndexID int // 递增int标识 // contains filtered or unexported fields }
func NewRecorder ¶
func NewRecorder(live_url string, config RecordConfig) (*Recorder, error)
type Uploader ¶
type Uploader interface {
DoUpload(file_path string)
}
func NewUploader ¶
func NewUploader(_type UploaderType, owner *Recorder) Uploader
type UploaderType ¶
type UploaderType int
const ( GDRIVE UploaderType = iota // gdrive网盘 MAX_SUPPORT_UPLOADER YOUTUBE // youtube )
Click to show internal directories.
Click to hide internal directories.