services

package
v0.0.0-...-7b951aa Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mutex = &sync.Mutex{}

Functions

func JobWorker

func JobWorker(messageChannel chan amqp.Delivery, returnChan chan JobWorkerResult, jobService JobService, job domain.Job, workerID int)

Types

type JobManager

type JobManager struct {
	Db               *gorm.DB
	Domain           domain.Job
	MessageChannel   chan amqp.Delivery
	JobReturnChannel chan JobWorkerResult
	RabbitMQ         *queue.RabbitMQ
}

func NewJobManager

func NewJobManager(db *gorm.DB, rabbitMQ *queue.RabbitMQ, jobReturnChannel chan JobWorkerResult, messageChannel chan amqp.Delivery) *JobManager

func (*JobManager) Start

func (j *JobManager) Start(ch *amqp.Channel)

type JobNotificationError

type JobNotificationError struct {
	Message string `json:"message"`
	Error   string `json:"error"`
}

type JobService

type JobService struct {
	Job           *domain.Job
	JobRepository repositories.JobRepository
	VideoService  VideoService
}

func (*JobService) Start

func (j *JobService) Start() error

type JobWorkerResult

type JobWorkerResult struct {
	Job     domain.Job
	Message *amqp.Delivery
	Error   error
}

type VideoService

type VideoService struct {
	Video           *domain.Video
	VideoRepository repositories.VideoRepository
}

func NewVideoService

func NewVideoService() VideoService

func (*VideoService) Download

func (v *VideoService) Download(BucketName string) error

func (*VideoService) Encode

func (v *VideoService) Encode() error

func (*VideoService) Finish

func (v *VideoService) Finish() error

func (*VideoService) Fragment

func (v *VideoService) Fragment() error

func (*VideoService) InsertVideo

func (v *VideoService) InsertVideo() error

type VideoUpload

type VideoUpload struct {
	Paths        []string
	VideoPath    string
	OutputBucket string
	Errors       []string
}

func NewVideoUpload

func NewVideoUpload() *VideoUpload

func (*VideoUpload) ProcessUpload

func (vu *VideoUpload) ProcessUpload(concurrency int, doneUpload chan string) error

func (*VideoUpload) UploadObject

func (vu *VideoUpload) UploadObject(objectPath string, client *storage.Client, ctx context.Context) error

Jump to

Keyboard shortcuts

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