Documentation ¶
Index ¶
- Constants
- Variables
- func LeaderElectionRunOrDie(leaseName string)
- func ParseHeaderAuthorization(val string) (user string, password string)
- type CustomConfig
- type FileSystem
- type HttpFileSystem
- type LocalFileSystem
- type RedisPool
- func (s *RedisPool) AddUser(info *UserInfo) (*UserInfo, error)
- func (s *RedisPool) Close()
- func (s *RedisPool) DeleteStream(key string) error
- func (s *RedisPool) DeleteUser(account string) error
- func (s *RedisPool) GetStreamInfo(stream string) (*StreamInfo, error)
- func (s *RedisPool) GetStreams(streams []string) ([]StreamInfo, error)
- func (s *RedisPool) GetUserInfo(account string) (*UserInfo, error)
- func (s *RedisPool) GetUsers(accounts []string) ([]UserInfo, error)
- func (s *RedisPool) InitAdminUser() string
- func (s *RedisPool) NewStream(key, owner string) (*StreamInfo, error)
- func (s *RedisPool) RefreshToken(info *UserInfo) (*UserInfo, error)
- func (s *RedisPool) SubscribeStream(key string, accounts []string) (*StreamInfo, error)
- func (s *RedisPool) TokenAuth(e *WebHookEvent) (int, string, *StreamInfo)
- func (s *RedisPool) UnsubscribeStream(key string, accounts []string) (*StreamInfo, error)
- func (s *RedisPool) UpdateStreamMetadata(key string, meta StreamMeta) (*StreamInfo, error)
- type S3Client
- type StreamDesc
- type StreamInfo
- type StreamMeta
- type UserInfo
- type WatcherDaemon
- type WebHookEvent
Constants ¶
View Source
const ( STREAM_PREFIX = "stream:" DEFAULT_VHOST = "__defaultVhost__" )
Variables ¶
View Source
var ( Conf CustomConfig PodIp string Hostname string Namespace string LeaderElection bool IsLeader bool )
Functions ¶
func LeaderElectionRunOrDie ¶
func LeaderElectionRunOrDie(leaseName string)
Types ¶
type CustomConfig ¶
type CustomConfig struct { RedisMode string `env:"redis_mode" envDefault:"Standalone"` RedislHost string `env:"redis_host" envDefault:"127.0.0.1"` RedisPort int `env:"redis_port" envDefault:"6379"` RedisMaster string `env:"redis_master" envDefault:"mymaster"` RedisPassword string `env:"redis_pass"` RedisDatabase int `env:"redis_database"` RedisMaxIdle int `env:"redis_pool_min" envDefault:"3"` RedisMaxActive int `env:"redis_pool_max" envDefault:"10"` Endpoint string `env:"minio_endpoint" envDefault:"play.min.io"` Port int `env:"minio_port" envDefault:"80"` AccessKeyID string `env:"minio_accessKey"` SecretAccessKey string `env:"minio_secretKey"` UseSSL bool `env:"minio_use_ssl" envDefault:"false"` BucketName string `env:"minio_bucketName"` BucketPrefix string `env:"minio_bucketPrefix"` DefaultAdminPasswd string `env:"DEFAULT_ADMIN_PASSWORD"` SrsApiServer string SrsCfgFile string SrsHlsPath string SrsProxyHost string SrsHlsExpire int64 DefaultTokenExpire int64 }
type FileSystem ¶
type HttpFileSystem ¶
type HttpFileSystem struct { Path string Client func() (*http.Response, error) // contains filtered or unexported fields }
func (*HttpFileSystem) Close ¶
func (fs *HttpFileSystem) Close() error
func (*HttpFileSystem) Open ¶
func (fs *HttpFileSystem) Open() (path string, err error)
type LocalFileSystem ¶
type LocalFileSystem struct { Path string // contains filtered or unexported fields }
func (*LocalFileSystem) Close ¶
func (fs *LocalFileSystem) Close() error
func (*LocalFileSystem) Open ¶
func (fs *LocalFileSystem) Open() (path string, err error)
type RedisPool ¶
type RedisPool struct {
// contains filtered or unexported fields
}
func (*RedisPool) DeleteStream ¶
func (*RedisPool) DeleteUser ¶
func (*RedisPool) GetStreamInfo ¶
func (s *RedisPool) GetStreamInfo(stream string) (*StreamInfo, error)
func (*RedisPool) GetStreams ¶
func (s *RedisPool) GetStreams(streams []string) ([]StreamInfo, error)
func (*RedisPool) InitAdminUser ¶
func (*RedisPool) RefreshToken ¶
func (*RedisPool) SubscribeStream ¶
func (s *RedisPool) SubscribeStream(key string, accounts []string) (*StreamInfo, error)
func (*RedisPool) TokenAuth ¶
func (s *RedisPool) TokenAuth(e *WebHookEvent) (int, string, *StreamInfo)
func (*RedisPool) UnsubscribeStream ¶
func (s *RedisPool) UnsubscribeStream(key string, accounts []string) (*StreamInfo, error)
func (*RedisPool) UpdateStreamMetadata ¶
func (s *RedisPool) UpdateStreamMetadata(key string, meta StreamMeta) (*StreamInfo, error)
type StreamDesc ¶
type StreamDesc struct { Key string Owner string Exists bool Meta StreamMeta }
type StreamInfo ¶
type StreamInfo struct { Users []string StreamDesc }
type StreamMeta ¶
type WatcherDaemon ¶
type WatcherDaemon struct{}
func NewWatcher ¶
func NewWatcher() *WatcherDaemon
func (*WatcherDaemon) ConfigFile ¶
func (fs *WatcherDaemon) ConfigFile(user, password string)
func (*WatcherDaemon) MediaFile ¶
func (fs *WatcherDaemon) MediaFile(root string)
type WebHookEvent ¶
type WebHookEvent struct { Action string `json:"action" binding:"required"` //ClientId string `json:"client_id"` Ip string `json:"ip" binding:"required"` Vhost string `json:"vhost" binding:"required"` App string `json:"app" binding:"required"` Stream string `json:"stream" binding:"required"` Param string `json:"param"` Url string `json:"url"` M3u8Url string `json:"m3u8_url"` }
Click to show internal directories.
Click to hide internal directories.