base

package
v0.0.0-...-27de488 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMod

func GetMod(modName string) *config.ModuleConfig

get mod config & ctx statically

func NoLiving

func NoLiving(Provide string, Name string)

Types

type BaseMonitor

type BaseMonitor struct {
	Ctx      MonitorCtx
	Provider string
}

func (*BaseMonitor) CheckLive

func (b *BaseMonitor) CheckLive(usersConfig config.UsersConfig) bool

func (*BaseMonitor) CreateVideo

func (b *BaseMonitor) CreateVideo(usersConfig config.UsersConfig) *interfaces.VideoInfo

func (*BaseMonitor) DownloadProvider

func (b *BaseMonitor) DownloadProvider() string

func (*BaseMonitor) GetCtx

func (b *BaseMonitor) GetCtx() *MonitorCtx

type HeadersConfig

type HeadersConfig struct {
	HttpHeaders map[string]string
}

type LiveInfo

type LiveInfo struct {
	Title         string
	StreamingLink string
}

type Mock

type Mock struct {
	Video  *interfaces.VideoInfo
	IsLive bool
}

func (*Mock) CheckLive

func (m *Mock) CheckLive(usersConfig config.UsersConfig) bool

func (*Mock) CreateVideo

func (m *Mock) CreateVideo(usersConfig config.UsersConfig) *interfaces.VideoInfo

type MonitorCtx

type MonitorCtx struct {
	Client         *http.Client
	ExtraModConfig map[string]interface{}
}

func CreateMonitorCtx

func CreateMonitorCtx(module config.ModuleConfig) MonitorCtx

monitorCtx contains mod's extraConfig and its own http client

func GetCtx

func GetCtx(modName string) *MonitorCtx

func (*MonitorCtx) GetHeaders

func (c *MonitorCtx) GetHeaders() map[string]string

func (*MonitorCtx) GetProxy

func (c *MonitorCtx) GetProxy() (string, bool)

func (*MonitorCtx) HttpGet

func (c *MonitorCtx) HttpGet(url string, header map[string]string) ([]byte, error)

HttpGet wraps the raw HttpGet with monitor's global header

func (*MonitorCtx) HttpPost

func (c *MonitorCtx) HttpPost(url string, header map[string]string, data []byte) ([]byte, error)

type VideoMonitor

type VideoMonitor interface {
	CheckLive(usersConfig config.UsersConfig) bool
	CreateVideo(usersConfig config.UsersConfig) *interfaces.VideoInfo
	GetCtx() *MonitorCtx
	DownloadProvider() string
}

Jump to

Keyboard shortcuts

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