live

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

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, Recoding, Uploading bool
}

func (*Info) MarshalJSON

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

type Live

type Live interface {
	GetLiveId() ID
	NeedUpload() bool
	SetUpload(bool)
	SetUploadPath(string)
	GetUploadPath() string
	GetRawUrl() string
	GetInfo() (*Info, error)
	GetUploadInfo() bool
	SetUploadInfo(bool)
	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

type Option func(*Options)

func WithKVStringCookies

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

type Options

type Options struct {
	Cookies *cookiejar.Jar
}

func MustNewOptions

func MustNewOptions(opts ...Option) *Options

func NewOptions

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