uploader

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package uploader handles post cmds when show ends.

Index

Constants

This section is empty.

Variables

View Source
var DefaultHandlerFunc = TaskHandlerFunc(OliveDefault)
View Source
var DefaultTaskMux = &defaultTaskMux

Functions

func OliveArchive

func OliveArchive(t *Task) error

func OliveBiliup

func OliveBiliup(t *Task) error

func OliveDefault

func OliveDefault(t *Task) error

func OliveTrash

func OliveTrash(t *Task) error

Types

type Task

type Task struct {
	Filepath string
	StopChan chan struct{}
	Cmd      *exec.Cmd
	// contains filtered or unexported fields
}

type TaskGroup

type TaskGroup struct {
	Filepath string
	PostCmds []*exec.Cmd
	// contains filtered or unexported fields
}

type TaskHandler

type TaskHandler interface {
	Process(t *Task) error
}

type TaskHandlerFunc

type TaskHandlerFunc func(t *Task) error

func (TaskHandlerFunc) Process

func (f TaskHandlerFunc) Process(t *Task) error

type TaskMux

type TaskMux struct {
	// contains filtered or unexported fields
}

func (*TaskMux) MustGetHandler

func (mux *TaskMux) MustGetHandler(pattern string) TaskHandler

func (*TaskMux) RegisterHandler

func (mux *TaskMux) RegisterHandler(pattern string, handler TaskHandler)

type Uploader

type Uploader interface {
	// contains filtered or unexported methods
}

func NewUploader

func NewUploader(log *logrus.Logger, cfg *config.Config, taskGroup *TaskGroup) Uploader

type WorkerPool

type WorkerPool struct {
	// contains filtered or unexported fields
}
var UploaderWorkerPool *WorkerPool

func NewWorkerPool

func NewWorkerPool(log *logrus.Logger, concurrency uint, cfg *config.Config) *WorkerPool

func (*WorkerPool) AddTask

func (wp *WorkerPool) AddTask(tasks ...*TaskGroup)

func (*WorkerPool) BiliupPrerun

func (wp *WorkerPool) BiliupPrerun()

func (*WorkerPool) Run

func (wp *WorkerPool) Run()

func (*WorkerPool) Stop

func (wp *WorkerPool) Stop()

Jump to

Keyboard shortcuts

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