tv

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 15 Imported by: 2

README

tv

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITv

type ITv interface {
	Refresh()
	StreamUrl() (string, bool)
	RoomName() (string, bool)
	StreamerName() (string, bool)
}

type Info

type Info struct {
	Timestamp int64
	// contains filtered or unexported fields
}

type Option

type Option func(*Tv) error

type Parms

type Parms struct {
	Cookie string
}

type RoomUrl

type RoomUrl string
Example
package main

import (
	"fmt"

	"github.com/go-olive/tv"
)

func main() {
	tv, err := tv.Snap(tv.NewRoomUrl("https://www.huya.com/518512"), nil)
	if err != nil {
		println(err.Error())
		return
	}

	fmt.Println(tv)
}
Output:

func NewRoomUrl

func NewRoomUrl(roomUrl string) RoomUrl

func (RoomUrl) SiteID

func (this RoomUrl) SiteID() string

func (RoomUrl) Stream

func (this RoomUrl) Stream() *Tv

type Site

type Site interface {
	Name() string
	Snap(*Tv) error
	Permit(RoomUrl) *Tv
}

func Sniff

func Sniff(siteID string) (Site, bool)

type Streamer

type Streamer interface {
	Stream() *Tv
}

type Tv

type Tv struct {
	SiteID string
	RoomID string
	*Parms
	*Info
}
Example
package main

import (
	"fmt"

	"github.com/go-olive/tv"
)

func main() {
	tv, err := tv.Snap(tv.NewTv("huya", "518512"), nil)

	if err != nil {
		println(err.Error())
		return
	}

	fmt.Println(tv)
}
Output:

func NewTv

func NewTv(siteID, roomID string) *Tv

func Snap

func Snap(streamer Streamer, parms *Parms) (*Tv, error)

func (*Tv) Refresh

func (tv *Tv) Refresh()

func (*Tv) RoomName

func (tv *Tv) RoomName() (string, bool)

func (*Tv) Stream

func (tv *Tv) Stream() *Tv

func (*Tv) StreamUrl

func (tv *Tv) StreamUrl() (string, bool)

func (*Tv) StreamerName

func (tv *Tv) StreamerName() (string, bool)

func (*Tv) String

func (tv *Tv) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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