common

package
v0.0.0-...-b6245c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENCODE_NOT_EXIST = iota
	ENCODE_INIT
	ENCODE_TS_ENCODING
	ENCODE_TS_ENODE_DONE
	ENCODE_MP4_DONE
)
View Source
const RET_ID_NOT_EXIST = 501
View Source
const RET_OK = 200

Variables

View Source
var ENCODE_STATUS_DSCR = []string{"id not exist", "encode init", "encoding ts files", "encode ts done", "encode mp4 done"}

Functions

func CheckFileIsExist

func CheckFileIsExist(filename string) bool

func CopyFile

func CopyFile(dstName, srcName string) (written int64, err error)

func MakeDir

func MakeDir(dirpath string) error

func MakeDirAll

func MakeDirAll(dirpath string) error

func NewId

func NewId() string

Types

type EncodeFileInfo

type EncodeFileInfo struct {
	Filename    string
	Id          string
	Profilename string
	Timestamp   int64
}

type EncodeInfo

type EncodeInfo struct {
	Srcfile     string `json:"srcfile`
	Destsubdir  string `json:"destsubdir"`
	Destfile    string `json:"destfile`
	Profilename string `json:"profilename`
}

type EncodeNotification

type EncodeNotification interface {
	EncodeNotify(info *EncodeFileInfo) error
}

type EncodeStatInfo

type EncodeStatInfo struct {
	Code        int    `json:"code`
	Id          string `json:"id`
	Statuscode  int    `json:"statuscode`
	Dscr        string `json:"dscr`
	Tstotal     int    `json:"tstotal`
	Tsleftcount int    `json:"tsleftcount`
	Starttime   int64  `json:"starttime`
	Endtime     int64  `json:"endtime`
	Costtime    int64  `json:"costtime`
}

type EncodedCheckI

type EncodedCheckI interface {
	IsEncodedDone(key string) bool
	UpdateEncodeStat(info *EncodeStatInfo) error
	GetEncodeStat(Id string) (info *EncodeStatInfo, err error)
}

type FileNotification

type FileNotification interface {
	Notify(filename string) error
}

type FileUploadI

type FileUploadI interface {
	UploadFile(filename string) (url string, err error)
	UploadFileEx(filename string, subpath string, outputFilename string) (url string, err error)
}

type Writer

type Writer interface {
	WriteMsg(info *EncodeInfo) (string, error)
	GetEncodeStatInfo(ID string) (info *EncodeStatInfo)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL