Documentation ¶
Index ¶
- Constants
- func NewDumper() *dumper
- func NewSSHClient() *sshClient
- func NewScpInfo() *scpInfo
- func NewSwarmCli() (*swarmCli, error)
- type DockerFFmpegMp4ToM3u8
- type GeneralService
- func (service *GeneralService) GetEnv() []string
- func (service *GeneralService) GetOption() types.ServiceCreateOptions
- func (service *GeneralService) GetReplicas() *uint64
- func (service *GeneralService) GetServiceSpec() swarm.ServiceSpec
- func (service *GeneralService) GetUpdateConfig() *swarm.UpdateConfig
- func (service *GeneralService) Image() string
- func (service *GeneralService) Init()
- func (service *GeneralService) SetAnnotationsName(annotationsName string)
- func (service *GeneralService) SetContainerSpecImage(containerSpecImage string)
- func (service *GeneralService) SetEnv(key, value string)
- func (service *GeneralService) SetID(id string)
- func (service *GeneralService) SetMount(mountType mount.Type, target, source string)
- func (service *GeneralService) SetNetwork(target string)
- func (service *GeneralService) SetPortConfig(protocol swarm.PortConfigProtocol, targetPort, publishedPort uint32)
- func (service *GeneralService) SetReplicas(replicas uint64)
- type JenkinsConn
- type SwarmService
Constants ¶
View Source
const DockerffmpegCutJPEGCmd = "docker run -v {{.Mp4FileDir}}:/temp/ jrottenberg/ffmpeg " +
"-ss {{.CutTime}} " +
"-i /temp/{{.FileName}} " +
"-r 1 " +
"-vframes 1 " +
"-y /temp/{{.OutPutDir}}/{{.OnlyName}}.jpeg"
View Source
const DockerffmpegToM3U8Cmd = "docker run -v {{.Mp4FileDir}}:/temp/ jrottenberg/ffmpeg " +
"-i /temp/{{.FileName}} " +
"-f segment -segment_time 10 -segment_format mpegts " +
"-segment_list /temp/{{.OutPutDir}}/{{.OnlyName}}.m3u8 " +
"-c copy -bsf:v h264_mp4toannexb -map 0 /temp/{{.OutPutDir}}/{{.OnlyName}}-%08d.ts"
View Source
const (
ReplicasAny = uint64(1)
)
Variables ¶
This section is empty.
Functions ¶
func NewSSHClient ¶
func NewSSHClient() *sshClient
func NewScpInfo ¶
func NewScpInfo() *scpInfo
func NewSwarmCli ¶
func NewSwarmCli() (*swarmCli, error)
Types ¶
type DockerFFmpegMp4ToM3u8 ¶
type DockerFFmpegMp4ToM3u8 struct {
// contains filtered or unexported fields
}
func (*DockerFFmpegMp4ToM3u8) DockerMp4CutJpeg ¶
func (f *DockerFFmpegMp4ToM3u8) DockerMp4CutJpeg(mp4FilePath string, outputDir string, ssTime string) error
* 使用docker 进行mp4文件截图 @param string mp4FilePath mp4文件地址 @param string outputDir 相对mp4文件地址的目录 @param string ssTime 时间格式, 例如00:01:22
func (*DockerFFmpegMp4ToM3u8) DockerMp4ToM3u8 ¶
func (f *DockerFFmpegMp4ToM3u8) DockerMp4ToM3u8(mp4FilePath string, outputDir string) error
* 使用docker 进行mp4文件转换m3u8 @param string mp4FilePath mp4文件地址 @param string outputDir 相对mp4文件地址的目录
type GeneralService ¶
type GeneralService struct { ID string ServiceSpec swarm.ServiceSpec Option types.ServiceCreateOptions NetworkAttachmentConfig []swarm.NetworkAttachmentConfig PortConfig []swarm.PortConfig MountList []mount.Mount AnnotationsName string //service name ContainerSpecImageName string //使用image Replicas uint64 //重启方式 EnvList []string //环境变量 }
func (*GeneralService) GetEnv ¶
func (service *GeneralService) GetEnv() []string
func (*GeneralService) GetOption ¶
func (service *GeneralService) GetOption() types.ServiceCreateOptions
func (*GeneralService) GetReplicas ¶
func (service *GeneralService) GetReplicas() *uint64
func (*GeneralService) GetServiceSpec ¶
func (service *GeneralService) GetServiceSpec() swarm.ServiceSpec
func (*GeneralService) GetUpdateConfig ¶
func (service *GeneralService) GetUpdateConfig() *swarm.UpdateConfig
* 服务更新方式
func (*GeneralService) Init ¶
func (service *GeneralService) Init()
func (*GeneralService) SetAnnotationsName ¶
func (service *GeneralService) SetAnnotationsName(annotationsName string)
* 设置服务名称
func (*GeneralService) SetContainerSpecImage ¶
func (service *GeneralService) SetContainerSpecImage(containerSpecImage string)
* 设置镜像名称
func (*GeneralService) SetID ¶
func (service *GeneralService) SetID(id string)
func (*GeneralService) SetMount ¶
func (service *GeneralService) SetMount(mountType mount.Type, target, source string)
* 设置mount
func (*GeneralService) SetPortConfig ¶
func (service *GeneralService) SetPortConfig(protocol swarm.PortConfigProtocol, targetPort, publishedPort uint32)
* 设置端口配置
func (*GeneralService) SetReplicas ¶
func (service *GeneralService) SetReplicas(replicas uint64)
type JenkinsConn ¶
type JenkinsConn struct {
// contains filtered or unexported fields
}
func CreateJenkinsConn ¶
func CreateJenkinsConn(jenkinsUrl, jenkinsAccount, jenkinsPassword string) (jenkinsConn *JenkinsConn, err error)
连接jenkins
func (*JenkinsConn) BuildJobWithGitParam ¶
func (jenkinsConn *JenkinsConn) BuildJobWithGitParam(jobName, paramName, paramValue string) error
build job
type SwarmService ¶
type SwarmService interface { Init() GetOption() types.ServiceCreateOptions GetServiceSpec() swarm.ServiceSpec SetNetwork(target string) SetID(id string) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.