model

package
v0.0.0-...-d6eaca8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotFound = errors.New("user not found or wrong key")

Functions

func Connect

func Connect() error

func DeleteChannel

func DeleteChannel(userID, name string) error

func GetThumb

func GetThumb(channelName string) (d []byte, err error)

func PutThumb

func PutThumb(channelName string, d []byte) error

func SetUser

func SetUser(userID string, token *oauth2.Token, announce bool) error

func UpdateChannel

func UpdateChannel(userID, name string, announce bool) error

Types

type ChannelAuth

type ChannelAuth struct {
	UserID   string
	Name     string
	Announce bool
	Token    *oauth2.Token
}

func VerifyFTL

func VerifyFTL(channelID string, nonce, hmacProvided []byte) (auth ChannelAuth, err error)

func VerifyRTMP

func VerifyRTMP(u *url.URL) (auth ChannelAuth, err error)

type ChannelDef

type ChannelDef struct {
	Name     string `json:"name"`
	Key      string `json:"key"`
	Announce bool   `json:"announce"`
	FTLKey   string `json:"ftl_key"`

	RTMPDir  string `json:"rtmp_dir"`
	RTMPBase string `json:"rtmp_base"`
}

func CreateChannel

func CreateChannel(userID, name string) (def *ChannelDef, err error)

func ListChannelDefs

func ListChannelDefs(userID string) (defs []*ChannelDef, err error)

func (*ChannelDef) SetURL

func (d *ChannelDef) SetURL(base string)

type ChannelInfo

type ChannelInfo struct {
	Name      string `json:"name"`
	Live      bool   `json:"live"`
	Last      int64  `json:"last"`
	Thumb     string `json:"thumb"`
	LiveURL   string `json:"live_url"`
	WebURL    string `json:"web_url"`
	NativeURL string `json:"native_url"`
	Viewers   int    `json:"viewers"`
	RTC       bool   `json:"rtc"`
}

func ListChannelInfo

func ListChannelInfo() (ret []*ChannelInfo, err error)

func (*ChannelInfo) Equal

func (i *ChannelInfo) Equal(j *ChannelInfo) bool

Jump to

Keyboard shortcuts

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