0

fix: updates for new linter rules. Closes #3277

This commit is contained in:
Gabe Kangas 2023-08-25 19:58:44 -07:00
parent 718b76fcc2
commit 3174eb20e5
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
2 changed files with 50 additions and 48 deletions

View File

@ -33,7 +33,7 @@ const (
// ChatActionSent is a generic chat action that can be used for anything that doesn't need specific handling or formatting. // ChatActionSent is a generic chat action that can be used for anything that doesn't need specific handling or formatting.
ChatActionSent EventType = "CHAT_ACTION" ChatActionSent EventType = "CHAT_ACTION"
// ErrorNeedsRegistration is an error returned when the client needs to perform registration. // ErrorNeedsRegistration is an error returned when the client needs to perform registration.
ErrorNeedsRegistration EventType = "ERROR_NEEDS_REGISTRATION" ErrorNeedsRegistration EventType = "ERROR_NEEDS_REGISTRATION" // nolint:gosec
// ErrorMaxConnectionsExceeded is an error returned when the server determined it should not handle more connections. // ErrorMaxConnectionsExceeded is an error returned when the server determined it should not handle more connections.
ErrorMaxConnectionsExceeded EventType = "ERROR_MAX_CONNECTIONS_EXCEEDED" ErrorMaxConnectionsExceeded EventType = "ERROR_MAX_CONNECTIONS_EXCEEDED"
// ErrorUserDisabled is an error returned when the connecting user has been previously banned/disabled. // ErrorUserDisabled is an error returned when the connecting user has been previously banned/disabled.

View File

@ -16,53 +16,54 @@ import (
) )
const ( const (
extraContentKey = "extra_page_content" extraContentKey = "extra_page_content"
streamTitleKey = "stream_title" streamTitleKey = "stream_title"
adminPasswordKey = "admin_password_key" adminPasswordKey = "admin_password_key"
logoPathKey = "logo_path" logoPathKey = "logo_path"
logoUniquenessKey = "logo_uniqueness" logoUniquenessKey = "logo_uniqueness"
serverSummaryKey = "server_summary" serverSummaryKey = "server_summary"
serverWelcomeMessageKey = "server_welcome_message" serverWelcomeMessageKey = "server_welcome_message"
serverNameKey = "server_name" serverNameKey = "server_name"
serverURLKey = "server_url" serverURLKey = "server_url"
httpPortNumberKey = "http_port_number" httpPortNumberKey = "http_port_number"
httpListenAddressKey = "http_listen_address" httpListenAddressKey = "http_listen_address"
websocketHostOverrideKey = "websocket_host_override" websocketHostOverrideKey = "websocket_host_override"
rtmpPortNumberKey = "rtmp_port_number" rtmpPortNumberKey = "rtmp_port_number"
serverMetadataTagsKey = "server_metadata_tags" serverMetadataTagsKey = "server_metadata_tags"
directoryEnabledKey = "directory_enabled" directoryEnabledKey = "directory_enabled"
directoryRegistrationKeyKey = "directory_registration_key" directoryRegistrationKeyKey = "directory_registration_key"
socialHandlesKey = "social_handles" socialHandlesKey = "social_handles"
peakViewersSessionKey = "peak_viewers_session" peakViewersSessionKey = "peak_viewers_session"
peakViewersOverallKey = "peak_viewers_overall" peakViewersOverallKey = "peak_viewers_overall"
lastDisconnectTimeKey = "last_disconnect_time" lastDisconnectTimeKey = "last_disconnect_time"
ffmpegPathKey = "ffmpeg_path" ffmpegPathKey = "ffmpeg_path"
nsfwKey = "nsfw" nsfwKey = "nsfw"
s3StorageConfigKey = "s3_storage_config" s3StorageConfigKey = "s3_storage_config"
videoLatencyLevel = "video_latency_level" videoLatencyLevel = "video_latency_level"
videoStreamOutputVariantsKey = "video_stream_output_variants" videoStreamOutputVariantsKey = "video_stream_output_variants"
chatDisabledKey = "chat_disabled" chatDisabledKey = "chat_disabled"
externalActionsKey = "external_actions" externalActionsKey = "external_actions"
customStylesKey = "custom_styles" customStylesKey = "custom_styles"
customJavascriptKey = "custom_javascript" customJavascriptKey = "custom_javascript"
videoCodecKey = "video_codec" videoCodecKey = "video_codec"
blockedUsernamesKey = "blocked_usernames" blockedUsernamesKey = "blocked_usernames"
publicKeyKey = "public_key" publicKeyKey = "public_key"
privateKeyKey = "private_key" privateKeyKey = "private_key"
serverInitDateKey = "server_init_date" serverInitDateKey = "server_init_date"
federationEnabledKey = "federation_enabled" federationEnabledKey = "federation_enabled"
federationUsernameKey = "federation_username" federationUsernameKey = "federation_username"
federationPrivateKey = "federation_private" federationPrivateKey = "federation_private"
federationGoLiveMessageKey = "federation_go_live_message" federationGoLiveMessageKey = "federation_go_live_message"
federationShowEngagementKey = "federation_show_engagement" federationShowEngagementKey = "federation_show_engagement"
federationBlockedDomainsKey = "federation_blocked_domains" federationBlockedDomainsKey = "federation_blocked_domains"
suggestedUsernamesKey = "suggested_usernames" suggestedUsernamesKey = "suggested_usernames"
chatJoinMessagesEnabledKey = "chat_join_messages_enabled" chatJoinMessagesEnabledKey = "chat_join_messages_enabled"
chatEstablishedUsersOnlyModeKey = "chat_established_users_only_mode" chatEstablishedUsersOnlyModeKey = "chat_established_users_only_mode"
notificationsEnabledKey = "notifications_enabled" notificationsEnabledKey = "notifications_enabled"
discordConfigurationKey = "discord_configuration" discordConfigurationKey = "discord_configuration"
browserPushConfigurationKey = "browser_push_configuration" browserPushConfigurationKey = "browser_push_configuration"
browserPushPublicKeyKey = "browser_push_public_key" browserPushPublicKeyKey = "browser_push_public_key"
// nolint:gosec
browserPushPrivateKeyKey = "browser_push_private_key" browserPushPrivateKeyKey = "browser_push_private_key"
hasConfiguredInitialNotificationsKey = "has_configured_initial_notifications" hasConfiguredInitialNotificationsKey = "has_configured_initial_notifications"
hideViewerCountKey = "hide_viewer_count" hideViewerCountKey = "hide_viewer_count"
@ -647,6 +648,7 @@ func FindHighestVideoQualityIndex(qualities []models.StreamOutputVariant) int {
return indexedQualities[a].quality.VideoBitrate > indexedQualities[b].quality.VideoBitrate return indexedQualities[a].quality.VideoBitrate > indexedQualities[b].quality.VideoBitrate
}) })
// nolint:gosec
return indexedQualities[0].index return indexedQualities[0].index
} }