services

package
v0.0.0-...-3b7a923 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageBrokerQueueTaskNew          = "task_new"
	MessageBrokerQueueTaskFinished     = "task_finished"
	MessageBrokerQueueTaskUpdateStatus = "task_update_status"
)
View Source
const (
	WorkerNew      = "worker_new"
	WorkerAssigned = "worker_assigned"
	WorkerStatus   = "worker_status"
)
View Source
const (
	KeyGetAllTaskProgress = "GetAllTaskProgress"
)
View Source
const (
	KeyGetAllVideo = "KeyGetAllVideo"
)
View Source
const (
	KeyGetAllWorker = "KeyGetAllWorker"
)
View Source
const (
	TaskHTTPEventStream = "task"
)
View Source
const (
	WorkerHTTPEventStream = "worker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler interface {
	GetAllTaskProgress() []*models.TaskProgressResponse
	CreateSplitTask(video *models.Video) error
	CreateTranscodeTask(task *models.Task) error
	CreateDashTask(task *models.Task) error
	CreateMergeTask(task *models.Task) error
	ReadMessages()
	//UpdateTask(task *models.Task) error
	DeleteTask(taskId string) error
}

func NewSchedulerService

func NewSchedulerService(
	taskRepo repositories.TaskRepository,
	videoRepo repositories.VideoRepository,
	messenger repositories.Messenger,
	sse *sse.Server,
	cache *cache.Cache,
) Scheduler

type VideoService

type VideoService interface {
	Inspect(filePath string) models.Video
	GetAll() ([]*models.Video, error)
}

func NewVideoService

func NewVideoService(vidRepo repositories.VideoRepository, schedulerSvc Scheduler, cache *cache.Cache) VideoService

type WorkerService

type WorkerService interface {
	//ReadMessage will read all message from message broker
	ReadMessage()
	Scale(replicaNum int32) (*autoscalingv1.Scale, error)
	Get(workerName string) models.Worker
	GetAll() ([]*models.Worker, error)
	Update(workerName string) models.Worker
	Terminate(workerName string) error
}

func NewWorkerService

func NewWorkerService(
	workerRepo repositories.WorkerRepository,
	mb repositories.Messenger,
	sse *sse.Server,
	cache *cache.Cache,
	k8sClient *kubernetes.Clientset,
) WorkerService

Jump to

Keyboard shortcuts

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