live

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: GPL-3.0 Imports: 9 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRoomNotExist     = errors.New("room not exists")
	ErrRoomUrlIncorrect = errors.New("room url incorrect")
	ErrInternalError    = errors.New("internal error")
)
View Source
var CommonUserAgent = requests.UserAgent(userAgent)

Functions

func Register

func Register(domain string, b Builder)

Types

type Builder

type Builder interface {
	Build(*url.URL, ...Option) (Live, error)
}

type ID

type ID string

type Info

type Info struct {
	Live                         Live
	HostName, RoomName           string
	Status, Listening, Recording bool
	CustomLiveId                 string
}

func (*Info) MarshalJSON

func (i *Info) MarshalJSON() ([]byte, error)

type Live

type Live interface {
	SetLiveIdByString(string)
	GetLiveId() ID
	GetRawUrl() string
	GetInfo() (*Info, error)
	GetStreamUrls() ([]*url.URL, error)
	GetPlatformCNName() string
	GetLastStartTime() time.Time
	SetLastStartTime(time.Time)
}

func New

func New(url *url.URL, cache gcache.Cache, opts ...Option) (live Live, err error)

type Option added in v0.6.4

type Option func(*Options)

func WithKVStringCookies added in v0.6.4

func WithKVStringCookies(u *url.URL, cookies string) Option

func WithQuality added in v0.7.9

func WithQuality(quality int) Option

type Options added in v0.6.4

type Options struct {
	Cookies *cookiejar.Jar
	Quality int
}

func MustNewOptions added in v0.6.4

func MustNewOptions(opts ...Option) *Options

func NewOptions added in v0.6.4

func NewOptions(opts ...Option) (*Options, error)

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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