live

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 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               bool // means isLiving, maybe better to rename it
	Listening, Recording bool
	Initializing         bool
	CustomLiveId         string
}

func (*Info) MarshalJSON

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

type InitializingFinishedParam added in v0.7.11

type InitializingFinishedParam struct {
	InitializingLive Live
	Live             Live
	Info             *Info
}

type InitializingLiveBuilder added in v0.7.11

type InitializingLiveBuilder interface {
	Build(Live, *url.URL, ...Option) (Live, error)
}
var (
	InitializingLiveBuilderInstance InitializingLiveBuilder
)

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)

type WrappedLive added in v0.7.11

type WrappedLive struct {
	Live
	// contains filtered or unexported fields
}

func (*WrappedLive) GetInfo added in v0.7.11

func (w *WrappedLive) GetInfo() (*Info, 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