livestream

package
v0.0.0-...-8c0e7b3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LiveStream

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

Defines a generic livestream. A livestream is identified by its url.

func New

func New(url string, done chan *LiveStream, mq *internal.MessageQueue, db *internal.MemoryDB) *LiveStream

func (*LiveStream) Kill

func (l *LiveStream) Kill() error

Kills a livestream process and signal its completition

func (*LiveStream) Start

func (l *LiveStream) Start() error

Start the livestream monitoring process, once completion signals on the done channel

func (*LiveStream) WaitTime

func (l *LiveStream) WaitTime() <-chan time.Duration

type LiveStreamStatus

type LiveStreamStatus = map[string]Status

type Monitor

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

func NewMonitor

func NewMonitor(mq *internal.MessageQueue, db *internal.MemoryDB) *Monitor

func (*Monitor) Add

func (m *Monitor) Add(url string)

func (*Monitor) Persist

func (m *Monitor) Persist() error

Persist the monitor current state to a file. The file is located in the configured config directory

func (*Monitor) Remove

func (m *Monitor) Remove(url string) error

func (*Monitor) RemoveAll

func (m *Monitor) RemoveAll() error

func (*Monitor) Restore

func (m *Monitor) Restore() error

Restore a saved state and resume the monitored livestreams

func (*Monitor) Schedule

func (m *Monitor) Schedule()

Detect each livestream completition, if done detach it from the monitor.

func (*Monitor) Status

func (m *Monitor) Status() LiveStreamStatus

type Status

type Status = struct {
	Status   int           `json:"status"`
	WaitTime time.Duration `json:"waitTime"`
	LiveDate time.Time     `json:"liveDate"`
}

Jump to

Keyboard shortcuts

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