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"`
	PubID   string `json:"pub_id"`
	Viewers int    `json:"viewers"`
	RTC     bool   `json:"rtc"`
}

func ListChannelInfo

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