live

package
v0.6.0-3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: GPL-3.0 Imports: 6 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) (Live, error)
}

type ID

type ID string

type Info

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

func (*Info) MarshalJSON

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

type Live

type Live interface {
	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) (live Live, err 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