chaturbate

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResolutionFallbackUpscale   = "up"
	ResolutionFallbackDownscale = "down"
)

Variables

View Source
var (
	ErrChannelNotFound  = errors.New("channel not found")
	ErrChannelExists    = errors.New("channel already exists")
	ErrChannelNotPaused = errors.New("channel not paused")
	ErrChannelIsPaused  = errors.New("channel is paused")
	ErrListenNotFound   = errors.New("listen not found")
)

Functions

func ByteStr

func ByteStr(bytes int) string

func DurationStr

func DurationStr(seconds int) string

func MBStr

func MBStr(mibs int) string

Types

type Channel

type Channel struct {
	Username   string
	ChannelURL string

	LastStreamedAt     string
	Interval           int
	Framerate          int
	Resolution         int
	ResolutionFallback string
	SegmentDuration    int // Seconds
	SplitDuration      int // Minutes
	SegmentFilesize    int // Bytes
	SplitFilesize      int // MB
	IsOnline           bool
	IsPaused           bool

	Logs []string

	PauseChannel  chan bool
	UpdateChannel chan *Update
	ResumeChannel chan bool
	// contains filtered or unexported fields
}

func (*Channel) Filename

func (w *Channel) Filename() string

func (*Channel) Pause

func (w *Channel) Pause()

func (*Channel) Resume

func (w *Channel) Resume()

func (*Channel) Run

func (w *Channel) Run()

Run

func (*Channel) SegmentDurationStr

func (w *Channel) SegmentDurationStr() string

func (*Channel) SegmentFilesizeStr

func (w *Channel) SegmentFilesizeStr() string

func (*Channel) SplitDurationStr

func (w *Channel) SplitDurationStr() string

func (*Channel) SplitFilesizeStr

func (w *Channel) SplitFilesizeStr() string

func (*Channel) Stop

func (w *Channel) Stop()

type Config

type Config struct {
	Username           string
	FilenamePattern    string
	Framerate          int
	Resolution         int
	ResolutionFallback string
	SplitDuration      int
	SplitFilesize      int
	Interval           int
}

Config

type Manager

type Manager struct {
	Channels map[string]*Channel
	Updates  map[string]chan *Update
	// contains filtered or unexported fields
}

Manager

func NewManager

func NewManager(c *cli.Context) *Manager

NewManager

func (*Manager) CreateChannel

func (m *Manager) CreateChannel(conf *Config) error

CreateChannel

func (*Manager) DeleteChannel

func (m *Manager) DeleteChannel(username string) error

DeleteChannel

func (*Manager) GetChannel

func (m *Manager) GetChannel(username string) (*Channel, error)

GetChannel

func (*Manager) ListChannels

func (m *Manager) ListChannels() ([]*Channel, error)

ListChannels

func (*Manager) ListenUpdate

func (m *Manager) ListenUpdate() (<-chan *Update, string)

ListenUpdate

func (*Manager) LoadChannels added in v1.0.1

func (m *Manager) LoadChannels() error

LoadChannels

func (*Manager) PauseChannel

func (m *Manager) PauseChannel(username string) error

PauseChannel

func (*Manager) ResumeChannel

func (m *Manager) ResumeChannel(username string) error

ResumeChannel

func (*Manager) SaveChannels added in v1.0.1

func (m *Manager) SaveChannels() error

SaveChannels

func (*Manager) StopListenUpdate

func (m *Manager) StopListenUpdate(id string) error

StopListenUpdate

type Update

type Update struct {
	Username        string `json:"username"`
	Log             string `json:"log"`
	IsPaused        bool   `json:"is_paused"`
	IsOnline        bool   `json:"is_online"`
	IsStopped       bool   `json:"is_stopped"`
	Filename        string `json:"filename"`
	LastStreamedAt  string `json:"last_streamed_at"`
	SegmentDuration int    `json:"segment_duration"`
	SegmentFilesize int    `json:"segment_filesize"`
}

func (*Update) SegmentDurationStr

func (u *Update) SegmentDurationStr() string

func (*Update) SegmentFilesizeStr

func (u *Update) SegmentFilesizeStr() string

Jump to

Keyboard shortcuts

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