pkg

package
v0.0.0-...-55e1567 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

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

Publisher implements an amqp publisher.

func NewPublisher

func NewPublisher(conn *amqp.Connection, exchange string) (*Publisher, error)

func (*Publisher) Publish

func (p *Publisher) Publish(_ context.Context, task *VideoUploadTask) error

Publish publishes a message.

type Subscriber

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

Subscriber implements an amqp subscriber.

func NewSubscriber

func NewSubscriber(conn *amqp.Connection, exchange string) (*Subscriber, error)

NewSubscriber creates an amqp subscriber.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(c context.Context) (taskChan chan *VideoUploadTask, cleanUpFunc func(), err error)

Subscribe subscribes and returns a channel with video upload task.

func (*Subscriber) SubscribeRaw

func (s *Subscriber) SubscribeRaw(_ context.Context) (<-chan amqp.Delivery, func(), error)

SubscribeRaw subscribes and returns a channel with raw amqp delivery.

type VideoUploadTask

type VideoUploadTask struct {
	VideoTmpPath    string
	CoverTmpPath    string
	VideoUploadPath string
	CoverUploadPath string
}

VideoUploadTask define the task to get cover from videoTmpPath,and upload video and cover to minio.

Jump to

Keyboard shortcuts

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