Documentation ¶
Index ¶
- func CreateMessagesTable(db *sql.DB)
- func DeleteWebhook(id int) error
- func FindHighestVideoQualityIndex(qualities []models.StreamOutputVariant) int
- func GetChatDisabled() bool
- func GetCustomStyles() string
- func GetDatabase() *sql.DB
- func GetDirectoryEnabled() bool
- func GetDirectoryRegistrationKey() string
- func GetExternalActions() []models.ExternalAction
- func GetExtraPageBodyContent() string
- func GetFfMpegPath() string
- func GetForbiddenUsernameList() []string
- func GetHTTPListenAddress() string
- func GetHTTPPortNumber() int
- func GetLastDisconnectTime() (*utils.NullTime, error)
- func GetLogoPath() string
- func GetNSFW() bool
- func GetPeakOverallViewerCount() int
- func GetPeakSessionViewerCount() int
- func GetRTMPPortNumber() int
- func GetS3Config() models.S3
- func GetS3StorageEnabled() bool
- func GetServerMetadataTags() []string
- func GetServerName() string
- func GetServerSummary() string
- func GetServerURL() string
- func GetServerWelcomeMessage() string
- func GetSocialHandles() []models.SocialHandle
- func GetStreamKey() string
- func GetStreamLatencyLevel() models.LatencyLevel
- func GetStreamOutputVariants() []models.StreamOutputVariant
- func GetStreamTitle() string
- func GetVideoCodec() string
- func GetWebhooks() ([]models.Webhook, error)
- func GetWebhooksForEvent(event models.EventType) []models.Webhook
- func HasPopulatedDefaults() bool
- func InsertWebhook(url string, events []models.EventType) (int, error)
- func PopulateDefaults()
- func SetChatDisabled(disabled bool) error
- func SetCustomStyles(styles string) error
- func SetDirectoryEnabled(enabled bool) error
- func SetDirectoryRegistrationKey(key string) error
- func SetExternalActions(actions []models.ExternalAction) error
- func SetExtraPageBodyContent(content string) error
- func SetFfmpegPath(path string) error
- func SetForbiddenUsernameList(usernames []string) error
- func SetHTTPListenAddress(address string) error
- func SetHTTPPortNumber(port float64) error
- func SetLastDisconnectTime(disconnectTime time.Time) error
- func SetLogoPath(logo string) error
- func SetNSFW(isNSFW bool) error
- func SetPeakOverallViewerCount(count int) error
- func SetPeakSessionViewerCount(count int) error
- func SetRTMPPortNumber(port float64) error
- func SetS3Config(config models.S3) error
- func SetS3StorageEnabled(enabled bool) error
- func SetServerMetadataTags(tags []string) error
- func SetServerName(name string) error
- func SetServerSummary(summary string) error
- func SetServerURL(url string) error
- func SetServerWelcomeMessage(welcomeMessage string) error
- func SetSocialHandles(socialHandles []models.SocialHandle) error
- func SetStreamKey(key string) error
- func SetStreamLatencyLevel(level float64) error
- func SetStreamOutputVariants(variants []models.StreamOutputVariant) error
- func SetStreamTitle(title string) error
- func SetVideoCodec(codec string) error
- func SetWebhookAsUsed(id string) error
- func SetupPersistence(file string) error
- func VerifySettings() error
- type ConfigEntry
- type Datastore
- func (ds *Datastore) Get(key string) (ConfigEntry, error)
- func (ds *Datastore) GetBool(key string) (bool, error)
- func (ds *Datastore) GetCachedValue(key string) ([]byte, error)
- func (ds *Datastore) GetNumber(key string) (float64, error)
- func (ds *Datastore) GetString(key string) (string, error)
- func (ds *Datastore) Reset()
- func (ds *Datastore) Save(e ConfigEntry) error
- func (ds *Datastore) SetBool(key string, value bool) error
- func (ds *Datastore) SetCachedValue(key string, b []byte)
- func (ds *Datastore) SetNumber(key string, value float64) error
- func (ds *Datastore) SetString(key string, value string) error
- func (ds *Datastore) Setup()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMessagesTable ¶
CreateMessagesTable will create the chat messages table if needed.
func DeleteWebhook ¶
DeleteWebhook will delete a webhook from the database.
func FindHighestVideoQualityIndex ¶
func FindHighestVideoQualityIndex(qualities []models.StreamOutputVariant) int
FindHighestVideoQualityIndex will return the highest quality from a slice of variants.
func GetCustomStyles ¶
func GetCustomStyles() string
GetCustomStyles will return a string with CSS to insert into the page.
func GetDatabase ¶
GetDatabase will return the shared instance of the actual database.
func GetDirectoryEnabled ¶
func GetDirectoryEnabled() bool
GetDirectoryEnabled will return if this server should register to YP.
func GetDirectoryRegistrationKey ¶
func GetDirectoryRegistrationKey() string
GetDirectoryRegistrationKey will return the YP protocol registration key.
func GetExternalActions ¶
func GetExternalActions() []models.ExternalAction
GetExternalActions will return the registered external actions.
func GetExtraPageBodyContent ¶
func GetExtraPageBodyContent() string
GetExtraPageBodyContent will return the user-supplied body content.
func GetForbiddenUsernameList ¶
func GetForbiddenUsernameList() []string
GetForbiddenUsernameList will return the blocked usernames as a comma separated string.
func GetHTTPListenAddress ¶
func GetHTTPListenAddress() string
GetHTTPListenAddress will return the HTTP listen address.
func GetHTTPPortNumber ¶
func GetHTTPPortNumber() int
GetHTTPPortNumber will return the server HTTP port.
func GetLastDisconnectTime ¶
GetLastDisconnectTime will return the time the last stream ended.
func GetLogoPath ¶
func GetLogoPath() string
GetLogoPath will return the path for the logo, relative to webroot.
func GetPeakOverallViewerCount ¶
func GetPeakOverallViewerCount() int
GetPeakOverallViewerCount will return the overall max number of viewers.
func GetPeakSessionViewerCount ¶
func GetPeakSessionViewerCount() int
GetPeakSessionViewerCount will return the max number of viewers for this stream.
func GetRTMPPortNumber ¶
func GetRTMPPortNumber() int
GetRTMPPortNumber will return the server RTMP port.
func GetS3Config ¶
GetS3Config will return the external storage configuration.
func GetS3StorageEnabled ¶
func GetS3StorageEnabled() bool
GetS3StorageEnabled will return if external storage is enabled.
func GetServerMetadataTags ¶
func GetServerMetadataTags() []string
GetServerMetadataTags will return the metadata tags.
func GetServerSummary ¶
func GetServerSummary() string
GetServerSummary will return the server summary text.
func GetServerWelcomeMessage ¶
func GetServerWelcomeMessage() string
GetServerWelcomeMessage will return the server welcome message text.
func GetSocialHandles ¶
func GetSocialHandles() []models.SocialHandle
GetSocialHandles will return the external social links.
func GetStreamKey ¶
func GetStreamKey() string
GetStreamKey will return the inbound streaming password.
func GetStreamLatencyLevel ¶
func GetStreamLatencyLevel() models.LatencyLevel
GetStreamLatencyLevel will return the stream latency level.
func GetStreamOutputVariants ¶
func GetStreamOutputVariants() []models.StreamOutputVariant
GetStreamOutputVariants will return all of the stream output variants.
func GetStreamTitle ¶
func GetStreamTitle() string
GetStreamTitle will return the name of the current stream.
func GetVideoCodec ¶
func GetVideoCodec() string
GetVideoCodec returns the codec to use for transcoding video.
func GetWebhooks ¶
GetWebhooks will return all the webhooks.
func GetWebhooksForEvent ¶
GetWebhooksForEvent will return all of the webhooks that want to be notified about an event type.
func HasPopulatedDefaults ¶
func HasPopulatedDefaults() bool
HasPopulatedDefaults will determine if the defaults have been inserted into the database.
func InsertWebhook ¶
InsertWebhook will add a new webhook to the database.
func PopulateDefaults ¶
func PopulateDefaults()
PopulateDefaults will set default values in the database.
func SetChatDisabled ¶
SetChatDisabled will disable chat if set to true.
func SetCustomStyles ¶
SetCustomStyles will save a string with CSS to insert into the page.
func SetDirectoryEnabled ¶
SetDirectoryEnabled will set if this server should register to YP.
func SetDirectoryRegistrationKey ¶
SetDirectoryRegistrationKey will set the YP protocol registration key.
func SetExternalActions ¶
func SetExternalActions(actions []models.ExternalAction) error
SetExternalActions will save external actions.
func SetExtraPageBodyContent ¶
SetExtraPageBodyContent will set the user-supplied body content.
func SetFfmpegPath ¶
SetFfmpegPath will set the custom ffmpeg path.
func SetForbiddenUsernameList ¶
SetForbiddenUsernameList set the username blocklist as a comma separated string.
func SetHTTPListenAddress ¶
SetHTTPListenAddress will set the server HTTP listen address.
func SetHTTPPortNumber ¶
SetHTTPPortNumber will set the server HTTP port.
func SetLastDisconnectTime ¶
SetLastDisconnectTime will set the time the last stream ended.
func SetLogoPath ¶
SetLogoPath will set the path for the logo, relative to webroot.
func SetPeakOverallViewerCount ¶
SetPeakOverallViewerCount will set the overall max number of viewers.
func SetPeakSessionViewerCount ¶
SetPeakSessionViewerCount will set the max number of viewers for this stream.
func SetRTMPPortNumber ¶
SetRTMPPortNumber will set the server RTMP port.
func SetS3Config ¶
SetS3Config will set the external storage configuration.
func SetS3StorageEnabled ¶
SetS3StorageEnabled will enable or disable external storage.
func SetServerMetadataTags ¶
SetServerMetadataTags will return the metadata tags.
func SetServerName ¶
SetServerName will set the server name text.
func SetServerSummary ¶
SetServerSummary will set the server summary text.
func SetServerWelcomeMessage ¶
SetServerWelcomeMessage will set the server welcome message text.
func SetSocialHandles ¶
func SetSocialHandles(socialHandles []models.SocialHandle) error
SetSocialHandles will set the external social links.
func SetStreamKey ¶
SetStreamKey will set the inbound streaming password.
func SetStreamLatencyLevel ¶
SetStreamLatencyLevel will set the stream latency level.
func SetStreamOutputVariants ¶
func SetStreamOutputVariants(variants []models.StreamOutputVariant) error
SetStreamOutputVariants will set the stream output variants.
func SetStreamTitle ¶
SetStreamTitle will set the name of the current stream.
func SetVideoCodec ¶
SetVideoCodec will set the codec used for video encoding.
func SetWebhookAsUsed ¶
SetWebhookAsUsed will update the last used time for a webhook.
func SetupPersistence ¶
SetupPersistence will open the datastore and make it available.
func VerifySettings ¶
func VerifySettings() error
VerifySettings will perform a sanity check for specific settings values.
Types ¶
type ConfigEntry ¶
type ConfigEntry struct { Key string Value interface{} }
ConfigEntry is the actual object saved to the database. The Value is encoded using encoding/gob.
type Datastore ¶
Datastore is the global key/value store for configuration values.
func GetDatastore ¶
func GetDatastore() *Datastore
GetDatastore returns the shared instance of the owncast datastore.
func GetStore ¶
func GetStore() *Datastore
GetStore will return the shared instance of the read/write datastore.
func (*Datastore) Get ¶
func (ds *Datastore) Get(key string) (ConfigEntry, error)
Get will query the database for the key and return the entry.
func (*Datastore) GetCachedValue ¶
GetCachedValue will return a value for key from the cache.
func (*Datastore) Reset ¶
func (ds *Datastore) Reset()
Reset will delete all config entries in the datastore and start over.
func (*Datastore) Save ¶
func (ds *Datastore) Save(e ConfigEntry) error
Save will save the ConfigEntry to the database.
func (*Datastore) SetCachedValue ¶
SetCachedValue will set a value for key in the cache.