model

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 68 Imported by: 579

Documentation

Index

Examples

Constants

View Source
const (
	AccessTokenGrantType  = "authorization_code"
	AccessTokenType       = "bearer"
	RefreshTokenGrantType = "refresh_token"
)
View Source
const (
	AuthCodeExpireTime   = 60 * 10 // 10 minutes
	AuthCodeResponseType = "code"
	ImplicitResponseType = "token"
	DefaultScope         = "user"
)
View Source
const (
	BotDisplayNameMaxRunes   = UserFirstNameMaxRunes
	BotDescriptionMaxRunes   = 1024
	BotCreatorIdMaxRunes     = KeyValuePluginIdMaxRunes // UserId or PluginId
	BotWarnMetricBotUsername = "mattermost-advisor"
	BotSystemBotUsername     = "system-bot"
)
View Source
const (
	ChannelTypeOpen    ChannelType = "O"
	ChannelTypePrivate ChannelType = "P"
	ChannelTypeDirect  ChannelType = "D"
	ChannelTypeGroup   ChannelType = "G"

	ChannelGroupMaxUsers       = 8
	ChannelGroupMinUsers       = 3
	DefaultChannelName         = "town-square"
	ChannelDisplayNameMaxRunes = 64
	ChannelNameMinLength       = 1
	ChannelNameMaxLength       = 64
	ChannelHeaderMaxRunes      = 1024
	ChannelPurposeMaxRunes     = 250
	ChannelCacheSize           = 25000

	ChannelSortByUsername = "username"
	ChannelSortByStatus   = "status"
)
View Source
const (
	ChannelBookmarkLink    ChannelBookmarkType = "link"
	ChannelBookmarkFile    ChannelBookmarkType = "file"
	BookmarkFileOwner                          = "bookmark"
	MaxBookmarksPerChannel                     = 50
	DisplayNameMaxRunes                        = 64
	LinkMaxRunes                               = 1024
)
View Source
const (
	ChannelNotifyDefault             = "default"
	ChannelNotifyAll                 = "all"
	ChannelNotifyMention             = "mention"
	ChannelNotifyNone                = "none"
	ChannelMarkUnreadAll             = "all"
	ChannelMarkUnreadMention         = "mention"
	IgnoreChannelMentionsDefault     = "default"
	IgnoreChannelMentionsOff         = "off"
	IgnoreChannelMentionsOn          = "on"
	IgnoreChannelMentionsNotifyProp  = "ignore_channel_mentions"
	ChannelAutoFollowThreadsOff      = "off"
	ChannelAutoFollowThreadsOn       = "on"
	ChannelAutoFollowThreads         = "channel_auto_follow_threads"
	ChannelMemberNotifyPropsMaxRunes = 800000
)
View Source
const (
	// Each sidebar category has a 'type'. System categories are Channels, Favorites and DMs
	// All user-created categories will have type Custom
	SidebarCategoryChannels       SidebarCategoryType = "channels"
	SidebarCategoryDirectMessages SidebarCategoryType = "direct_messages"
	SidebarCategoryFavorites      SidebarCategoryType = "favorites"
	SidebarCategoryCustom         SidebarCategoryType = "custom"
	// Increment to use when adding/reordering things in the sidebar
	MinimalSidebarSortDistance = 10
	// Default Sort Orders for categories
	DefaultSidebarSortOrderFavorites = 0
	DefaultSidebarSortOrderChannels  = DefaultSidebarSortOrderFavorites + MinimalSidebarSortDistance
	DefaultSidebarSortOrderDMs       = DefaultSidebarSortOrderChannels + MinimalSidebarSortDistance
	// Sorting modes
	// default for all categories except DMs (behaves like manual)
	SidebarCategorySortDefault SidebarCategorySorting = ""
	// sort manually
	SidebarCategorySortManual SidebarCategorySorting = "manual"
	// sort by recency (default for DMs)
	SidebarCategorySortRecent SidebarCategorySorting = "recent"
	// sort by display name alphabetically
	SidebarCategorySortAlphabetical SidebarCategorySorting = "alpha"
)
View Source
const (
	HeaderRequestId                 = "X-Request-ID"
	HeaderVersionId                 = "X-Version-ID"
	HeaderClusterId                 = "X-Cluster-ID"
	HeaderEtagServer                = "ETag"
	HeaderEtagClient                = "If-None-Match"
	HeaderForwarded                 = "X-Forwarded-For"
	HeaderRealIP                    = "X-Real-IP"
	HeaderForwardedProto            = "X-Forwarded-Proto"
	HeaderToken                     = "token"
	HeaderCsrfToken                 = "X-CSRF-Token"
	HeaderBearer                    = "BEARER"
	HeaderAuth                      = "Authorization"
	HeaderCloudToken                = "X-Cloud-Token"
	HeaderRemoteclusterToken        = "X-RemoteCluster-Token"
	HeaderRemoteclusterId           = "X-RemoteCluster-Id"
	HeaderRequestedWith             = "X-Requested-With"
	HeaderRequestedWithXML          = "XMLHttpRequest"
	HeaderFirstInaccessiblePostTime = "First-Inaccessible-Post-Time"
	HeaderFirstInaccessibleFileTime = "First-Inaccessible-File-Time"
	HeaderRange                     = "Range"
	STATUS                          = "status"
	StatusOk                        = "OK"
	StatusFail                      = "FAIL"
	StatusUnhealthy                 = "UNHEALTHY"
	StatusRemove                    = "REMOVE"
	ConnectionId                    = "Connection-Id"

	ClientDir = "client"

	APIURLSuffixV1 = "/api/v1"
	APIURLSuffixV4 = "/api/v4"
	APIURLSuffixV5 = "/api/v5"
	APIURLSuffix   = APIURLSuffixV4
)
View Source
const (
	EventTypeFailedPayment                = "failed-payment"
	EventTypeFailedPaymentNoCard          = "failed-payment-no-card"
	EventTypeSendAdminWelcomeEmail        = "send-admin-welcome-email"
	EventTypeSendUpgradeConfirmationEmail = "send-upgrade-confirmation-email"
	EventTypeSubscriptionChanged          = "subscription-changed"
	EventTypeTriggerDelinquencyEmail      = "trigger-delinquency-email"
)
View Source
const (
	BillingSchemePerSeat    = BillingScheme("per_seat")
	BillingSchemeFlatFee    = BillingScheme("flat_fee")
	BillingSchemeSalesServe = BillingScheme("sales_serve")
)
View Source
const (
	BillingTypeLicensed = BillingType("licensed")
	BillingTypeInternal = BillingType("internal")
)
View Source
const (
	RecurringIntervalYearly  = RecurringInterval("year")
	RecurringIntervalMonthly = RecurringInterval("month")
)
View Source
const (
	SubscriptionFamilyCloud  = SubscriptionFamily("cloud")
	SubscriptionFamilyOnPrem = SubscriptionFamily("on-prem")
)
View Source
const (
	SkuStarterGov        = ProductSku("starter-gov")
	SkuProfessionalGov   = ProductSku("professional-gov")
	SkuEnterpriseGov     = ProductSku("enterprise-gov")
	SkuStarter           = ProductSku("starter")
	SkuProfessional      = ProductSku("professional")
	SkuEnterprise        = ProductSku("enterprise")
	SkuCloudStarter      = ProductSku("cloud-starter")
	SkuCloudProfessional = ProductSku("cloud-professional")
	SkuCloudEnterprise   = ProductSku("cloud-enterprise")
)
View Source
const (
	CDSOfflineAfterMillis = 1000 * 60 * 30 // 30 minutes
	CDSTypeApp            = "mattermost_app"
)
View Source
const (
	ClusterEventNone                                        ClusterEvent = "none"
	ClusterEventPublish                                     ClusterEvent = "publish"
	ClusterEventUpdateStatus                                ClusterEvent = "update_status"
	ClusterEventInvalidateAllCaches                         ClusterEvent = "inv_all_caches"
	ClusterEventInvalidateCacheForReactions                 ClusterEvent = "inv_reactions"
	ClusterEventInvalidateCacheForChannelMembersNotifyProps ClusterEvent = "inv_channel_members_notify_props"
	ClusterEventInvalidateCacheForChannelByName             ClusterEvent = "inv_channel_name"
	ClusterEventInvalidateCacheForChannel                   ClusterEvent = "inv_channel"
	ClusterEventInvalidateCacheForChannelGuestCount         ClusterEvent = "inv_channel_guest_count"
	ClusterEventInvalidateCacheForUser                      ClusterEvent = "inv_user"
	ClusterEventInvalidateWebConnCacheForUser               ClusterEvent = "inv_user_teams"
	ClusterEventClearSessionCacheForUser                    ClusterEvent = "clear_session_user"
	ClusterEventInvalidateCacheForRoles                     ClusterEvent = "inv_roles"
	ClusterEventInvalidateCacheForRolePermissions           ClusterEvent = "inv_role_permissions"
	ClusterEventInvalidateCacheForProfileByIds              ClusterEvent = "inv_profile_ids"
	ClusterEventInvalidateCacheForAllProfiles               ClusterEvent = "inv_all_profiles"
	ClusterEventInvalidateCacheForProfileInChannel          ClusterEvent = "inv_profile_in_channel"
	ClusterEventInvalidateCacheForSchemes                   ClusterEvent = "inv_schemes"
	ClusterEventInvalidateCacheForFileInfos                 ClusterEvent = "inv_file_infos"
	ClusterEventInvalidateCacheForWebhooks                  ClusterEvent = "inv_webhooks"
	ClusterEventInvalidateCacheForEmojisById                ClusterEvent = "inv_emojis_by_id"
	ClusterEventInvalidateCacheForEmojisIdByName            ClusterEvent = "inv_emojis_id_by_name"
	ClusterEventInvalidateCacheForChannelFileCount          ClusterEvent = "inv_channel_file_count"
	ClusterEventInvalidateCacheForChannelPinnedpostsCounts  ClusterEvent = "inv_channel_pinnedposts_counts"
	ClusterEventInvalidateCacheForChannelMemberCounts       ClusterEvent = "inv_channel_member_counts"
	ClusterEventInvalidateCacheForChannelsMemberCount       ClusterEvent = "inv_channels_member_count"
	ClusterEventInvalidateCacheForLastPosts                 ClusterEvent = "inv_last_posts"
	ClusterEventInvalidateCacheForLastPostTime              ClusterEvent = "inv_last_post_time"
	ClusterEventInvalidateCacheForPostsUsage                ClusterEvent = "inv_posts_usage"
	ClusterEventInvalidateCacheForTeams                     ClusterEvent = "inv_teams"
	ClusterEventClearSessionCacheForAllUsers                ClusterEvent = "inv_all_user_sessions"
	ClusterEventInstallPlugin                               ClusterEvent = "install_plugin"
	ClusterEventRemovePlugin                                ClusterEvent = "remove_plugin"
	ClusterEventPluginEvent                                 ClusterEvent = "plugin_event"
	ClusterEventInvalidateCacheForTermsOfService            ClusterEvent = "inv_terms_of_service"
	ClusterEventBusyStateChanged                            ClusterEvent = "busy_state_change"

	// Gossip communication
	ClusterGossipEventRequestGetLogs                = "gossip_request_get_logs"
	ClusterGossipEventResponseGetLogs               = "gossip_response_get_logs"
	ClusterGossipEventRequestGenerateSupportPacket  = "gossip_request_generate_support_packet"
	ClusterGossipEventResponseGenerateSupportPacket = "gossip_response_generate_support_packet"
	ClusterGossipEventRequestGetClusterStats        = "gossip_request_cluster_stats"
	ClusterGossipEventResponseGetClusterStats       = "gossip_response_cluster_stats"
	ClusterGossipEventRequestGetPluginStatuses      = "gossip_request_plugin_statuses"
	ClusterGossipEventResponseGetPluginStatuses     = "gossip_response_plugin_statuses"
	ClusterGossipEventRequestSaveConfig             = "gossip_request_save_config"
	ClusterGossipEventResponseSaveConfig            = "gossip_response_save_config"
	ClusterGossipEventRequestWebConnCount           = "gossip_request_webconn_count"
	ClusterGossipEventResponseWebConnCount          = "gossip_response_webconn_count"

	// SendTypes for ClusterMessage.
	ClusterSendBestEffort = "best_effort"
	ClusterSendReliable   = "reliable"
)
View Source
const (
	CommandMethodPost = "P"
	CommandMethodGet  = "G"
	MinTriggerLength  = 1
	MaxTriggerLength  = 128
)
View Source
const (
	CommandResponseTypeInChannel = "in_channel"
	CommandResponseTypeEphemeral = "ephemeral"
)
View Source
const (
	ComplianceStatusCreated  = "created"
	ComplianceStatusRunning  = "running"
	ComplianceStatusFinished = "finished"
	ComplianceStatusFailed   = "failed"
	ComplianceStatusRemoved  = "removed"

	ComplianceTypeDaily = "daily"
	ComplianceTypeAdhoc = "adhoc"
)
View Source
const (
	ConnSecurityNone     = ""
	ConnSecurityPlain    = "PLAIN"
	ConnSecurityTLS      = "TLS"
	ConnSecurityStarttls = "STARTTLS"

	ImageDriverLocal = "local"
	ImageDriverS3    = "amazons3"

	DatabaseDriverMysql    = "mysql"
	DatabaseDriverPostgres = "postgres"

	SearchengineElasticsearch = "elasticsearch"

	MinioAccessKey = "minioaccesskey"
	MinioSecretKey = "miniosecretkey"
	MinioBucket    = "mattermost-test"

	PasswordMaximumLength = 72
	PasswordMinimumLength = 5

	ServiceGitlab    = "gitlab"
	ServiceGoogle    = "google"
	ServiceOffice365 = "office365"
	ServiceOpenid    = "openid"

	GenericNoChannelNotification = "generic_no_channel"
	GenericNotification          = "generic"
	GenericNotificationServer    = "https://push-test.mattermost.com"
	MmSupportAdvisorAddress      = "support-advisor@mattermost.com"
	FullNotification             = "full"
	IdLoadedNotification         = "id_loaded"

	DirectMessageAny  = "any"
	DirectMessageTeam = "team"

	ShowUsername         = "username"
	ShowNicknameFullName = "nickname_full_name"
	ShowFullName         = "full_name"

	PermissionsAll          = "all"
	PermissionsChannelAdmin = "channel_admin"
	PermissionsTeamAdmin    = "team_admin"
	PermissionsSystemAdmin  = "system_admin"

	FakeSetting = "********************************"

	RestrictEmojiCreationAll         = "all"
	RestrictEmojiCreationAdmin       = "admin"
	RestrictEmojiCreationSystemAdmin = "system_admin"

	PermissionsDeletePostAll         = "all"
	PermissionsDeletePostTeamAdmin   = "team_admin"
	PermissionsDeletePostSystemAdmin = "system_admin"

	GroupUnreadChannelsDisabled   = "disabled"
	GroupUnreadChannelsDefaultOn  = "default_on"
	GroupUnreadChannelsDefaultOff = "default_off"

	CollapsedThreadsDisabled   = "disabled"
	CollapsedThreadsDefaultOn  = "default_on"
	CollapsedThreadsDefaultOff = "default_off"
	CollapsedThreadsAlwaysOn   = "always_on"

	EmailBatchingBufferSize = 256
	EmailBatchingInterval   = 30

	EmailNotificationContentsFull    = "full"
	EmailNotificationContentsGeneric = "generic"

	EmailSMTPDefaultServer = "localhost"
	EmailSMTPDefaultPort   = "10025"

	CacheTypeLRU   = "lru"
	CacheTypeRedis = "redis"

	SitenameMaxLength = 30

	ServiceSettingsDefaultSiteURL                = "http://localhost:8065"
	ServiceSettingsDefaultTLSCertFile            = ""
	ServiceSettingsDefaultTLSKeyFile             = ""
	ServiceSettingsDefaultReadTimeout            = 300
	ServiceSettingsDefaultWriteTimeout           = 300
	ServiceSettingsDefaultIdleTimeout            = 60
	ServiceSettingsDefaultMaxLoginAttempts       = 10
	ServiceSettingsDefaultAllowCorsFrom          = ""
	ServiceSettingsDefaultListenAndAddress       = ":8065"
	ServiceSettingsDefaultGiphySdkKeyTest        = "s0glxvzVg9azvPipKxcPLpXV0q1x1fVP"
	ServiceSettingsDefaultDeveloperFlags         = ""
	ServiceSettingsDefaultUniqueReactionsPerPost = 50
	ServiceSettingsDefaultMaxURLLength           = 2048
	ServiceSettingsMaxUniqueReactionsPerPost     = 500

	TeamSettingsDefaultSiteName              = "Mattermost"
	TeamSettingsDefaultMaxUsersPerTeam       = 50
	TeamSettingsDefaultCustomBrandText       = ""
	TeamSettingsDefaultCustomDescriptionText = ""
	TeamSettingsDefaultUserStatusAwayTimeout = 300

	SqlSettingsDefaultDataSource = "postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes"

	FileSettingsDefaultDirectory                   = "./data/"
	FileSettingsDefaultS3UploadPartSizeBytes       = 5 * 1024 * 1024   // 5MB
	FileSettingsDefaultS3ExportUploadPartSizeBytes = 100 * 1024 * 1024 // 100MB

	ImportSettingsDefaultDirectory     = "./import"
	ImportSettingsDefaultRetentionDays = 30

	ExportSettingsDefaultDirectory     = "./export"
	ExportSettingsDefaultRetentionDays = 30

	EmailSettingsDefaultFeedbackOrganization = ""

	SupportSettingsDefaultTermsOfServiceLink = "https://mattermost.com/pl/terms-of-use/"
	SupportSettingsDefaultPrivacyPolicyLink  = "https://mattermost.com/pl/privacy-policy/"
	SupportSettingsDefaultAboutLink          = "https://mattermost.com/pl/about-mattermost"
	SupportSettingsDefaultHelpLink           = "https://mattermost.com/pl/help/"
	SupportSettingsDefaultReportAProblemLink = "https://mattermost.com/pl/report-a-bug"
	SupportSettingsDefaultSupportEmail       = ""
	SupportSettingsDefaultReAcceptancePeriod = 365

	LdapSettingsDefaultFirstNameAttribute        = ""
	LdapSettingsDefaultLastNameAttribute         = ""
	LdapSettingsDefaultEmailAttribute            = ""
	LdapSettingsDefaultUsernameAttribute         = ""
	LdapSettingsDefaultNicknameAttribute         = ""
	LdapSettingsDefaultIdAttribute               = ""
	LdapSettingsDefaultPositionAttribute         = ""
	LdapSettingsDefaultLoginFieldName            = ""
	LdapSettingsDefaultGroupDisplayNameAttribute = ""
	LdapSettingsDefaultGroupIdAttribute          = ""
	LdapSettingsDefaultPictureAttribute          = ""

	SamlSettingsDefaultIdAttribute        = ""
	SamlSettingsDefaultGuestAttribute     = ""
	SamlSettingsDefaultAdminAttribute     = ""
	SamlSettingsDefaultFirstNameAttribute = ""
	SamlSettingsDefaultLastNameAttribute  = ""
	SamlSettingsDefaultEmailAttribute     = ""
	SamlSettingsDefaultUsernameAttribute  = ""
	SamlSettingsDefaultNicknameAttribute  = ""
	SamlSettingsDefaultLocaleAttribute    = ""
	SamlSettingsDefaultPositionAttribute  = ""

	SamlSettingsSignatureAlgorithmSha1    = "RSAwithSHA1"
	SamlSettingsSignatureAlgorithmSha256  = "RSAwithSHA256"
	SamlSettingsSignatureAlgorithmSha512  = "RSAwithSHA512"
	SamlSettingsDefaultSignatureAlgorithm = SamlSettingsSignatureAlgorithmSha1

	SamlSettingsCanonicalAlgorithmC14n    = "Canonical1.0"
	SamlSettingsCanonicalAlgorithmC14n11  = "Canonical1.1"
	SamlSettingsDefaultCanonicalAlgorithm = SamlSettingsCanonicalAlgorithmC14n

	NativeappSettingsDefaultAppDownloadLink        = "https://mattermost.com/pl/download-apps"
	NativeappSettingsDefaultAndroidAppDownloadLink = "https://mattermost.com/pl/android-app/"
	NativeappSettingsDefaultIosAppDownloadLink     = "https://mattermost.com/pl/ios-app/"

	ExperimentalSettingsDefaultLinkMetadataTimeoutMilliseconds                       = 5000
	ExperimentalSettingsDefaultUsersStatusAndProfileFetchingPollIntervalMilliseconds = 3000

	AnalyticsSettingsDefaultMaxUsersForStatistics = 2500

	AnnouncementSettingsDefaultBannerColor                  = "#f2a93b"
	AnnouncementSettingsDefaultBannerTextColor              = "#333333"
	AnnouncementSettingsDefaultNoticesJsonURL               = "https://notices.mattermost.com/"
	AnnouncementSettingsDefaultNoticesFetchFrequencySeconds = 3600

	TeamSettingsDefaultTeamText = "default"

	ElasticsearchSettingsDefaultConnectionURL               = "http://localhost:9200"
	ElasticsearchSettingsDefaultUsername                    = "elastic"
	ElasticsearchSettingsDefaultPassword                    = "changeme"
	ElasticsearchSettingsDefaultPostIndexReplicas           = 1
	ElasticsearchSettingsDefaultPostIndexShards             = 1
	ElasticsearchSettingsDefaultChannelIndexReplicas        = 1
	ElasticsearchSettingsDefaultChannelIndexShards          = 1
	ElasticsearchSettingsDefaultUserIndexReplicas           = 1
	ElasticsearchSettingsDefaultUserIndexShards             = 1
	ElasticsearchSettingsDefaultAggregatePostsAfterDays     = 365
	ElasticsearchSettingsDefaultPostsAggregatorJobStartTime = "03:00"
	ElasticsearchSettingsDefaultIndexPrefix                 = ""
	ElasticsearchSettingsDefaultLiveIndexingBatchSize       = 10
	ElasticsearchSettingsDefaultRequestTimeoutSeconds       = 30
	ElasticsearchSettingsDefaultBatchSize                   = 10000
	ElasticsearchSettingsESBackend                          = "elasticsearch"
	ElasticsearchSettingsOSBackend                          = "opensearch"

	BleveSettingsDefaultIndexDir  = ""
	BleveSettingsDefaultBatchSize = 10000

	DataRetentionSettingsDefaultMessageRetentionDays           = 365
	DataRetentionSettingsDefaultMessageRetentionHours          = 0
	DataRetentionSettingsDefaultFileRetentionDays              = 365
	DataRetentionSettingsDefaultFileRetentionHours             = 0
	DataRetentionSettingsDefaultBoardsRetentionDays            = 365
	DataRetentionSettingsDefaultDeletionJobStartTime           = "02:00"
	DataRetentionSettingsDefaultBatchSize                      = 3000
	DataRetentionSettingsDefaultTimeBetweenBatchesMilliseconds = 100
	DataRetentionSettingsDefaultRetentionIdsBatchSize          = 100

	OutgoingIntegrationRequestsDefaultTimeout = 30

	PluginSettingsDefaultDirectory         = "./plugins"
	PluginSettingsDefaultClientDirectory   = "./client/plugins"
	PluginSettingsDefaultEnableMarketplace = true
	PluginSettingsDefaultMarketplaceURL    = "https://api.integrations.mattermost.com"
	PluginSettingsOldMarketplaceURL        = "https://marketplace.integrations.mattermost.com"

	ComplianceExportTypeCsv            = "csv"
	ComplianceExportTypeActiance       = "actiance"
	ComplianceExportTypeGlobalrelay    = "globalrelay"
	ComplianceExportTypeGlobalrelayZip = "globalrelay-zip"
	GlobalrelayCustomerTypeA9          = "A9"
	GlobalrelayCustomerTypeA10         = "A10"
	GlobalrelayCustomerTypeCustom      = "CUSTOM"

	ClientSideCertCheckPrimaryAuth   = "primary"
	ClientSideCertCheckSecondaryAuth = "secondary"

	ImageProxyTypeLocal     = "local"
	ImageProxyTypeAtmosCamo = "atmos/camo"

	GoogleSettingsDefaultScope           = "profile email"
	GoogleSettingsDefaultAuthEndpoint    = "https://accounts.google.com/o/oauth2/v2/auth"
	GoogleSettingsDefaultTokenEndpoint   = "https://www.googleapis.com/oauth2/v4/token"
	GoogleSettingsDefaultUserAPIEndpoint = "https://people.googleapis.com/v1/people/me?personFields=names,emailAddresses,nicknames,metadata"

	Office365SettingsDefaultScope           = "User.Read"
	Office365SettingsDefaultAuthEndpoint    = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"
	Office365SettingsDefaultTokenEndpoint   = "https://login.microsoftonline.com/common/oauth2/v2.0/token"
	Office365SettingsDefaultUserAPIEndpoint = "https://graph.microsoft.com/v1.0/me"

	CloudSettingsDefaultCwsURL        = "https://customers.mattermost.com"
	CloudSettingsDefaultCwsAPIURL     = "https://portal.internal.prod.cloud.mattermost.com"
	CloudSettingsDefaultCwsURLTest    = "https://portal.test.cloud.mattermost.com"
	CloudSettingsDefaultCwsAPIURLTest = "https://api.internal.test.cloud.mattermost.com"

	OpenidSettingsDefaultScope = "profile openid email"

	LocalModeSocketPath = "/var/tmp/mattermost_local.socket"

	ConnectedWorkspacesSettingsDefaultMaxPostsPerSync = 50 // a bit more than 4 typical screenfulls of posts

	// These storage classes are the valid values for the x-amz-storage-class header. More documentation here https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass
	StorageClassStandard           = "STANDARD"
	StorageClassReducedRedundancy  = "REDUCED_REDUNDANCY"
	StorageClassStandardIA         = "STANDARD_IA"
	StorageClassOnezoneIA          = "ONEZONE_IA"
	StorageClassIntelligentTiering = "INTELLIGENT_TIERING"
	StorageClassGlacier            = "GLACIER"
	StorageClassDeepArchive        = "DEEP_ARCHIVE"
	StorageClassOutposts           = "OUTPOSTS"
	StorageClassGlacierIR          = "GLACIER_IR"
	StorageClassSnow               = "SNOW"
	StorageClassExpressOnezone     = "EXPRESS_ONEZONE"
)
View Source
const (
	UserPropsKeyCustomStatus = "customStatus"

	CustomStatusTextMaxRunes = 100
	MaxRecentCustomStatuses  = 5
	DefaultCustomStatusEmoji = "speech_balloon"
)
View Source
const (
	EmojiNameMaxLength = 64
	EmojiSortByName    = "name"
)
View Source
const (
	FileinfoSortByCreated = "CreateAt"
	FileinfoSortBySize    = "Size"
)
View Source
const (
	GroupSourceLdap   GroupSource = "ldap"
	GroupSourceCustom GroupSource = "custom"

	GroupNameMaxLength        = 64
	GroupSourceMaxLength      = 64
	GroupDisplayNameMaxLength = 128
	GroupDescriptionMaxLength = 1024
	GroupRemoteIDMaxLength    = 48
)
View Source
const (
	PostActionTypeButton              = "button"
	PostActionTypeSelect              = "select"
	DialogTitleMaxLength              = 24
	DialogElementDisplayNameMaxLength = 24
	DialogElementNameMaxLength        = 300
	DialogElementHelpTextMaxLength    = 150
	DialogElementTextMaxLength        = 150
	DialogElementTextareaMaxLength    = 3000
	DialogElementSelectMaxLength      = 3000
	DialogElementBoolMaxLength        = 150
)
View Source
const (
	JobTypeDataRetention                 = "data_retention"
	JobTypeMessageExport                 = "message_export"
	JobTypeElasticsearchPostIndexing     = "elasticsearch_post_indexing"
	JobTypeElasticsearchPostAggregation  = "elasticsearch_post_aggregation"
	JobTypeBlevePostIndexing             = "bleve_post_indexing"
	JobTypeLdapSync                      = "ldap_sync"
	JobTypeMigrations                    = "migrations"
	JobTypePlugins                       = "plugins"
	JobTypeExpiryNotify                  = "expiry_notify"
	JobTypeProductNotices                = "product_notices"
	JobTypeActiveUsers                   = "active_users"
	JobTypeImportProcess                 = "import_process"
	JobTypeImportDelete                  = "import_delete"
	JobTypeExportProcess                 = "export_process"
	JobTypeExportDelete                  = "export_delete"
	JobTypeCloud                         = "cloud"
	JobTypeResendInvitationEmail         = "resend_invitation_email"
	JobTypeExtractContent                = "extract_content"
	JobTypeLastAccessiblePost            = "last_accessible_post"
	JobTypeLastAccessibleFile            = "last_accessible_file"
	JobTypeUpgradeNotifyAdmin            = "upgrade_notify_admin"
	JobTypeTrialNotifyAdmin              = "trial_notify_admin"
	JobTypePostPersistentNotifications   = "post_persistent_notifications"
	JobTypeInstallPluginNotifyAdmin      = "install_plugin_notify_admin"
	JobTypeHostedPurchaseScreening       = "hosted_purchase_screening"
	JobTypeS3PathMigration               = "s3_path_migration"
	JobTypeCleanupDesktopTokens          = "cleanup_desktop_tokens"
	JobTypeDeleteEmptyDraftsMigration    = "delete_empty_drafts_migration"
	JobTypeRefreshPostStats              = "refresh_post_stats"
	JobTypeDeleteOrphanDraftsMigration   = "delete_orphan_drafts_migration"
	JobTypeExportUsersToCSV              = "export_users_to_csv"
	JobTypeDeleteDmsPreferencesMigration = "delete_dms_preferences_migration"
	JobTypeMobileSessionMetadata         = "mobile_session_metadata"

	JobStatusPending         = "pending"
	JobStatusInProgress      = "in_progress"
	JobStatusSuccess         = "success"
	JobStatusError           = "error"
	JobStatusCancelRequested = "cancel_requested"
	JobStatusCanceled        = "canceled"
	JobStatusWarning         = "warning"
)
View Source
const (
	UserAuthServiceLdap       = "ldap"
	LdapPublicCertificateName = "ldap-public.crt"
	LdapPrivateKeyName        = "ldap-private.key"
)
View Source
const (
	DayInSeconds      = 24 * 60 * 60
	DayInMilliseconds = DayInSeconds * 1000

	ExpiredLicenseError = "api.license.add_license.expired.app_error"
	InvalidLicenseError = "api.license.add_license.invalid.app_error"
	LicenseGracePeriod  = DayInMilliseconds * 10 //10 days
	LicenseRenewalLink  = "https://mattermost.com/renew/"

	LicenseShortSkuE10          = "E10"
	LicenseShortSkuE20          = "E20"
	LicenseShortSkuProfessional = "professional"
	LicenseShortSkuEnterprise   = "enterprise"
)
View Source
const (
	LinkMetadataTypeImage     LinkMetadataType = "image"
	LinkMetadataTypeNone      LinkMetadataType = "none"
	LinkMetadataTypeOpengraph LinkMetadataType = "opengraph"
	LinkMetadataMaxImages     int              = 5
)
View Source
const (
	AdvancedPermissionsMigrationKey       = "AdvancedPermissionsMigrationComplete"
	MigrationKeyAdvancedPermissionsPhase2 = "migration_advanced_permissions_phase_2"

	MigrationKeyEmojiPermissionsSplit                  = "emoji_permissions_split"
	MigrationKeyWebhookPermissionsSplit                = "webhook_permissions_split"
	MigrationKeyListJoinPublicPrivateTeams             = "list_join_public_private_teams"
	MigrationKeyRemovePermanentDeleteUser              = "remove_permanent_delete_user"
	MigrationKeyAddBotPermissions                      = "add_bot_permissions"
	MigrationKeyApplyChannelManageDeleteToChannelUser  = "apply_channel_manage_delete_to_channel_user"
	MigrationKeyRemoveChannelManageDeleteFromTeamUser  = "remove_channel_manage_delete_from_team_user"
	MigrationKeyViewMembersNewPermission               = "view_members_new_permission"
	MigrationKeyAddManageGuestsPermissions             = "add_manage_guests_permissions"
	MigrationKeyChannelModerationsPermissions          = "channel_moderations_permissions"
	MigrationKeyAddUseGroupMentionsPermission          = "add_use_group_mentions_permission"
	MigrationKeyAddSystemConsolePermissions            = "add_system_console_permissions"
	MigrationKeySidebarCategoriesPhase2                = "migration_sidebar_categories_phase_2"
	MigrationKeyAddConvertChannelPermissions           = "add_convert_channel_permissions"
	MigrationKeyAddSystemRolesPermissions              = "add_system_roles_permissions"
	MigrationKeyAddBillingPermissions                  = "add_billing_permissions"
	MigrationKeyAddManageSharedChannelPermissions      = "manage_shared_channel_permissions"
	MigrationKeyAddManageSecureConnectionsPermissions  = "manage_secure_connections_permissions"
	MigrationKeyAddDownloadComplianceExportResults     = "download_compliance_export_results"
	MigrationKeyAddComplianceSubsectionPermissions     = "compliance_subsection_permissions"
	MigrationKeyAddExperimentalSubsectionPermissions   = "experimental_subsection_permissions"
	MigrationKeyAddAuthenticationSubsectionPermissions = "authentication_subsection_permissions"
	MigrationKeyAddSiteSubsectionPermissions           = "site_subsection_permissions"
	MigrationKeyAddEnvironmentSubsectionPermissions    = "environment_subsection_permissions"
	MigrationKeyAddReportingSubsectionPermissions      = "reporting_subsection_permissions"
	MigrationKeyAddTestEmailAncillaryPermission        = "test_email_ancillary_permission"
	MigrationKeyAddAboutSubsectionPermissions          = "about_subsection_permissions"
	MigrationKeyAddIntegrationsSubsectionPermissions   = "integrations_subsection_permissions"
	MigrationKeyAddPlaybooksPermissions                = "playbooks_permissions"
	MigrationKeyAddCustomUserGroupsPermissions         = "custom_groups_permissions"
	MigrationKeyAddPlayboosksManageRolesPermissions    = "playbooks_manage_roles"
	MigrationKeyAddProductsBoardsPermissions           = "products_boards"
	MigrationKeyAddCustomUserGroupsPermissionRestore   = "custom_groups_permission_restore"
	MigrationKeyAddReadChannelContentPermissions       = "read_channel_content_permissions"
	MigrationKeyS3Path                                 = "s3_path_migration"
	MigrationKeyDeleteEmptyDrafts                      = "delete_empty_drafts_migration"
	MigrationKeyDeleteOrphanDrafts                     = "delete_orphan_drafts_migration"
	MigrationKeyAddIPFilteringPermissions              = "add_ip_filtering_permissions"
	MigrationKeyAddOutgoingOAuthConnectionsPermissions = "add_outgoing_oauth_connections_permissions"
	MigrationKeyAddChannelBookmarksPermissions         = "add_channel_bookmarks_permissions"
	MigrationKeyDeleteDmsPreferences                   = "delete_dms_preferences_migration"
	MigrationKeyAddManageJobAncillaryPermissions       = "add_manage_jobs_ancillary_permissions"
	MigrationKeyAddUploadFilePermission                = "add_upload_file_permission"
)
View Source
const (
	NotificationStatusSuccess     NotificationStatus = "success"
	NotificationStatusError       NotificationStatus = "error"
	NotificationStatusNotSent     NotificationStatus = "not_sent"
	NotificationStatusUnsupported NotificationStatus = "unsupported"

	NotificationTypeAll       NotificationType = "all"
	NotificationTypeEmail     NotificationType = "email"
	NotificationTypeWebsocket NotificationType = "websocket"
	NotificationTypePush      NotificationType = "push"

	NotificationNoPlatform = "no_platform"

	NotificationReasonFetchError                         NotificationReason = "fetch_error"
	NotificationReasonParseError                         NotificationReason = "json_parse_error"
	NotificationReasonMarshalError                       NotificationReason = "json_marshal_error"
	NotificationReasonPushProxyError                     NotificationReason = "push_proxy_error"
	NotificationReasonPushProxySendError                 NotificationReason = "push_proxy_send_error"
	NotificationReasonPushProxyRemoveDevice              NotificationReason = "push_proxy_remove_device"
	NotificationReasonRejectedByPlugin                   NotificationReason = "rejected_by_plugin"
	NotificationReasonSessionExpired                     NotificationReason = "session_expired"
	NotificationReasonChannelMuted                       NotificationReason = "channel_muted"
	NotificationReasonSystemMessage                      NotificationReason = "system_message"
	NotificationReasonLevelSetToNone                     NotificationReason = "notify_level_none"
	NotificationReasonNotMentioned                       NotificationReason = "not_mentioned"
	NotificationReasonUserStatus                         NotificationReason = "user_status"
	NotificationReasonUserIsActive                       NotificationReason = "user_is_active"
	NotificationReasonMissingProfile                     NotificationReason = "missing_profile"
	NotificationReasonEmailNotVerified                   NotificationReason = "email_not_verified"
	NotificationReasonEmailSendError                     NotificationReason = "email_send_error"
	NotificationReasonTooManyUsersInChannel              NotificationReason = "too_many_users_in_channel"
	NotificationReasonResolvePersistentNotificationError NotificationReason = "resolve_persistent_notification_error"
	NotificationReasonMissingThreadMembership            NotificationReason = "missing_thread_membership"
)
View Source
const (
	PaidFeatureGuestAccounts                = MattermostFeature("mattermost.feature.guest_accounts")
	PaidFeatureCustomUsergroups             = MattermostFeature("mattermost.feature.custom_user_groups")
	PaidFeatureCreateMultipleTeams          = MattermostFeature("mattermost.feature.create_multiple_teams")
	PaidFeatureStartcall                    = MattermostFeature("mattermost.feature.start_call")
	PaidFeaturePlaybooksRetrospective       = MattermostFeature("mattermost.feature.playbooks_retro")
	PaidFeatureUnlimitedMessages            = MattermostFeature("mattermost.feature.unlimited_messages")
	PaidFeatureUnlimitedFileStorage         = MattermostFeature("mattermost.feature.unlimited_file_storage")
	PaidFeatureAllProfessionalfeatures      = MattermostFeature("mattermost.feature.all_professional")
	PaidFeatureAllEnterprisefeatures        = MattermostFeature("mattermost.feature.all_enterprise")
	UpgradeDowngradedWorkspace              = MattermostFeature("mattermost.feature.upgrade_downgraded_workspace")
	PluginFeature                           = MattermostFeature("mattermost.feature.plugin")
	PaidFeatureHighlightWithoutNotification = MattermostFeature("mattermost.feature.highlight_without_notification")
)
View Source
const (
	OAuthActionSignup     = "signup"
	OAuthActionLogin      = "login"
	OAuthActionEmailToSSO = "email_to_sso"
	OAuthActionSSOToEmail = "sso_to_email"
	OAuthActionMobile     = "mobile"
)
View Source
const (
	CurrentMetadataVersion int        = 1
	SupportPacketType      PacketType = "support-packet"
	PluginPacketType       PacketType = "plugin-packet"

	PacketMetadataFileName = "metadata.yaml"
)
View Source
const (
	PermissionScopeSystem   = "system_scope"
	PermissionScopeTeam     = "team_scope"
	PermissionScopeChannel  = "channel_scope"
	PermissionScopeGroup    = "group_scope"
	PermissionScopePlaybook = "playbook_scope"
	PermissionScopeRun      = "run_scope"
)
View Source
const (
	PluginClusterEventSendTypeReliable   = ClusterSendReliable
	PluginClusterEventSendTypeBestEffort = ClusterSendBestEffort
)
View Source
const (
	PluginIdPlaybooks     = "playbooks"
	PluginIdFocalboard    = "focalboard"
	PluginIdApps          = "com.mattermost.apps"
	PluginIdCalls         = "com.mattermost.calls"
	PluginIdNPS           = "com.mattermost.nps"
	PluginIdChannelExport = "com.mattermost.plugin-channel-export"
	PluginIdAI            = "mattermost-ai"
)
View Source
const (
	KeyValuePluginIdMaxRunes = 190
	KeyValueKeyMaxRunes      = 150
)
View Source
const (
	PluginStateNotRunning          = 0
	PluginStateStarting            = 1 // unused by server
	PluginStateRunning             = 2
	PluginStateFailedToStart       = 3
	PluginStateFailedToStayRunning = 4
	PluginStateStopping            = 5 // unused by server
)
View Source
const (
	MinIdLength  = 3
	MaxIdLength  = 190
	ValidIdRegex = `^[a-zA-Z0-9-_\.]+$`
)
View Source
const (
	PostSystemMessagePrefix      = "system_"
	PostTypeDefault              = ""
	PostTypeSlackAttachment      = "slack_attachment"
	PostTypeSystemGeneric        = "system_generic"
	PostTypeJoinLeave            = "system_join_leave" // Deprecated, use PostJoinChannel or PostLeaveChannel instead
	PostTypeJoinChannel          = "system_join_channel"
	PostTypeGuestJoinChannel     = "system_guest_join_channel"
	PostTypeLeaveChannel         = "system_leave_channel"
	PostTypeJoinTeam             = "system_join_team"
	PostTypeLeaveTeam            = "system_leave_team"
	PostTypeAutoResponder        = "system_auto_responder"
	PostTypeAddRemove            = "system_add_remove" // Deprecated, use PostAddToChannel or PostRemoveFromChannel instead
	PostTypeAddToChannel         = "system_add_to_channel"
	PostTypeAddGuestToChannel    = "system_add_guest_to_chan"
	PostTypeRemoveFromChannel    = "system_remove_from_channel"
	PostTypeMoveChannel          = "system_move_channel"
	PostTypeAddToTeam            = "system_add_to_team"
	PostTypeRemoveFromTeam       = "system_remove_from_team"
	PostTypeHeaderChange         = "system_header_change"
	PostTypeDisplaynameChange    = "system_displayname_change"
	PostTypeConvertChannel       = "system_convert_channel"
	PostTypePurposeChange        = "system_purpose_change"
	PostTypeChannelDeleted       = "system_channel_deleted"
	PostTypeChannelRestored      = "system_channel_restored"
	PostTypeEphemeral            = "system_ephemeral"
	PostTypeChangeChannelPrivacy = "system_change_chan_privacy"
	PostTypeWrangler             = "system_wrangler"
	PostTypeGMConvertedToChannel = "system_gm_to_channel"
	PostTypeAddBotTeamsChannels  = "add_bot_teams_channels"
	PostTypeMe                   = "me"
	PostCustomTypePrefix         = "custom_"
	PostTypeReminder             = "reminder"

	PostFileidsMaxRunes   = 300
	PostFilenamesMaxRunes = 4000
	PostHashtagsMaxRunes  = 1000
	PostMessageMaxRunesV1 = 4000
	PostMessageMaxBytesV2 = 65535                     // Maximum size of a TEXT column in MySQL
	PostMessageMaxRunesV2 = PostMessageMaxBytesV2 / 4 // Assume a worst-case representation
	PostPropsMaxRunes     = 800000
	PostPropsMaxUserRunes = PostPropsMaxRunes - 40000 // Leave some room for system / pre-save modifications

	PropsAddChannelMember = "add_channel_member"

	PostPropsAddedUserId              = "addedUserId"
	PostPropsDeleteBy                 = "deleteBy"
	PostPropsOverrideIconURL          = "override_icon_url"
	PostPropsOverrideIconEmoji        = "override_icon_emoji"
	PostPropsOverrideUsername         = "override_username"
	PostPropsFromWebhook              = "from_webhook"
	PostPropsFromBot                  = "from_bot"
	PostPropsFromOAuthApp             = "from_oauth_app"
	PostPropsWebhookDisplayName       = "webhook_display_name"
	PostPropsMentionHighlightDisabled = "mentionHighlightDisabled"
	PostPropsGroupHighlightDisabled   = "disable_group_highlight"
	PostPropsPreviewedPost            = "previewed_post"
	PostPropsForceNotification        = "force_notification"

	PostPriorityUrgent               = "urgent"
	PostPropsRequestedAck            = "requested_ack"
	PostPropsPersistentNotifications = "persistent_notifications"
)
View Source
const (

	// PreferenceCategoryDirectChannelShow and PreferenceCategoryGroupChannelShow
	// are used to store the user's preferences for which channels to show in the sidebar.
	// The Name field is the channel ID.
	PreferenceCategoryDirectChannelShow = "direct_channel_show"
	PreferenceCategoryGroupChannelShow  = "group_channel_show"
	// PreferenceCategoryTutorialStep is used to store the user's progress in the tutorial.
	// The Name field is the user ID again (for whatever reason).
	PreferenceCategoryTutorialSteps = "tutorial_step"
	// PreferenceCategoryAdvancedSettings has settings for the user's advanced settings.
	// The Name field is the setting name. Possible values are:
	// - "formatting"
	// - "send_on_ctrl_enter"
	// - "join_leave"
	// - "unread_scroll_position"
	// - "sync_drafts"
	// - "feature_enabled_markdown_preview" <- deprecated in favor of "formatting"
	PreferenceCategoryAdvancedSettings = "advanced_settings"
	// PreferenceCategoryFlaggedPost is used to store the user's saved posts.
	// The Name field is the post ID.
	PreferenceCategoryFlaggedPost = "flagged_post"
	// PreferenceCategoryFavoriteChannel is used to store the user's favorite channels to be
	// shown in the sidebar. The Name field is the channel ID.
	PreferenceCategoryFavoriteChannel = "favorite_channel"
	// PreferenceCategorySidebarSettings is used to store the user's sidebar settings.
	// The Name field is the setting name. (ie. PreferenceNameShowUnreadSection or PreferenceLimitVisibleDmsGms)
	PreferenceCategorySidebarSettings = "sidebar_settings"
	// PreferenceCategoryDisplaySettings is used to store the user's various display settings.
	// The possible Name fields are:
	// - PreferenceNameUseMilitaryTime
	// - PreferenceNameCollapseSetting
	// - PreferenceNameMessageDisplay
	// - PreferenceNameCollapseConsecutive
	// - PreferenceNameColorizeUsernames
	// - PreferenceNameChannelDisplayMode
	// - PreferenceNameNameFormat
	PreferenceCategoryDisplaySettings = "display_settings"
	// PreferenceCategorySystemNotice is used store system admin notices.
	// Possible Name values are not defined here. It can be anything with the notice name.
	PreferenceCategorySystemNotice = "system_notice"
	// Deprecated: PreferenceCategoryLast is not used anymore.
	PreferenceCategoryLast = "last"
	// PreferenceCategoryCustomStatus is used to store the user's custom status preferences.
	// Possible Name values are:
	// - PreferenceNameRecentCustomStatuses
	// - PreferenceNameCustomStatusTutorialState
	// - PreferenceCustomStatusModalViewed
	PreferenceCategoryCustomStatus = "custom_status"
	// PreferenceCategoryNotifications is used to store the user's notification settings.
	// Possible Name values are:
	// - PreferenceNameEmailInterval
	PreferenceCategoryNotifications = "notifications"

	// Deprecated: PreferenceRecommendedNextSteps is not used anymore.
	// Use PreferenceCategoryRecommendedNextSteps instead.
	// PreferenceRecommendedNextSteps is actually a Category. The only possible
	// Name vaule is PreferenceRecommendedNextStepsHide for now.
	PreferenceRecommendedNextSteps         = PreferenceCategoryRecommendedNextSteps
	PreferenceCategoryRecommendedNextSteps = "recommended_next_steps"

	// PreferenceCategoryTheme has the name for the team id where theme is set.
	PreferenceCategoryTheme = "theme"

	PreferenceNameCollapsedThreadsEnabled = "collapsed_reply_threads"
	PreferenceNameChannelDisplayMode      = "channel_display_mode"
	PreferenceNameCollapseSetting         = "collapse_previews"
	PreferenceNameMessageDisplay          = "message_display"
	PreferenceNameCollapseConsecutive     = "collapse_consecutive_messages"
	PreferenceNameColorizeUsernames       = "colorize_usernames"
	PreferenceNameNameFormat              = "name_format"
	PreferenceNameUseMilitaryTime         = "use_military_time"

	PreferenceNameShowUnreadSection = "show_unread_section"
	PreferenceLimitVisibleDmsGms    = "limit_visible_dms_gms"

	PreferenceMaxLimitVisibleDmsGmsValue = 40
	MaxPreferenceValueLength             = 20000

	PreferenceCategoryAuthorizedOAuthApp = "oauth_app"

	// Deprecated: PreferenceCategoryLastChannel is not used anymore.
	PreferenceNameLastChannel = "channel"
	// Deprecated: PreferenceCategoryLastTeam is not used anymore.
	PreferenceNameLastTeam = "team"

	PreferenceNameRecentCustomStatuses      = "recent_custom_statuses"
	PreferenceNameCustomStatusTutorialState = "custom_status_tutorial_state"
	PreferenceCustomStatusModalViewed       = "custom_status_modal_viewed"

	PreferenceNameEmailInterval = "email_interval"

	PreferenceEmailIntervalNoBatchingSeconds = "30"  // the "immediate" setting is actually 30s
	PreferenceEmailIntervalBatchingSeconds   = "900" // fifteen minutes is 900 seconds
	PreferenceEmailIntervalImmediately       = "immediately"
	PreferenceEmailIntervalFifteen           = "fifteen"
	PreferenceEmailIntervalFifteenAsSeconds  = "900"
	PreferenceEmailIntervalHour              = "hour"
	PreferenceEmailIntervalHourAsSeconds     = "3600"
	PreferenceCloudUserEphemeralInfo         = "cloud_user_ephemeral_info"

	PreferenceNameRecommendedNextStepsHide = "hide"
)
View Source
const (
	PushNotifyApple              = "apple"
	PushNotifyAndroid            = "android"
	PushNotifyAppleReactNative   = "apple_rn"
	PushNotifyAndroidReactNative = "android_rn"

	PushTypeMessage     = "message"
	PushTypeClear       = "clear"
	PushTypeUpdateBadge = "update_badge"
	PushTypeSession     = "session"
	PushTypeTest        = "test"
	PushMessageV2       = "v2"

	PushSoundNone = "none"

	// The category is set to handle a set of interactive Actions
	// with the push notifications
	CategoryCanReply = "CAN_REPLY"

	MHPNS = "https://push.mattermost.com"

	PushSendPrepare = "Prepared to send"
	PushSendSuccess = "Successful"
	PushNotSent     = "Not Sent due to preferences"
	PushReceived    = "Received by device"
)
View Source
const (
	PushStatus         = "status"
	PushStatusOk       = "OK"
	PushStatusFail     = "FAIL"
	PushStatusRemove   = "REMOVE"
	PushStatusErrorMsg = "error"
)
View Source
const (
	RemoteOfflineAfterMillis = 1000 * 60 * 5 // 5 minutes
	RemoteNameMinLength      = 1
	RemoteNameMaxLength      = 64

	SiteURLPending = "pending_"
	SiteURLPlugin  = "plugin_"

	BitflagOptionAutoShareDMs Bitmask = 1 << iota // Any new DM/GM is automatically shared
	BitflagOptionAutoInvited                      // Remote is automatically invited to all shared channels
)
View Source
const (
	ReportDurationAllTime       = "all_time"
	ReportDurationLast30Days    = "last_30_days"
	ReportDurationPreviousMonth = "previous_month"
	ReportDurationLast6Months   = "last_6_months"

	ReportingMaxPageSize = 100
)
View Source
const (
	SystemGuestRoleId            = "system_guest"
	SystemUserRoleId             = "system_user"
	SystemAdminRoleId            = "system_admin"
	SystemPostAllRoleId          = "system_post_all"
	SystemPostAllPublicRoleId    = "system_post_all_public"
	SystemUserAccessTokenRoleId  = "system_user_access_token"
	SystemUserManagerRoleId      = "system_user_manager"
	SystemReadOnlyAdminRoleId    = "system_read_only_admin"
	SystemManagerRoleId          = "system_manager"
	SystemCustomGroupAdminRoleId = "system_custom_group_admin"

	TeamGuestRoleId         = "team_guest"
	TeamUserRoleId          = "team_user"
	TeamAdminRoleId         = "team_admin"
	TeamPostAllRoleId       = "team_post_all"
	TeamPostAllPublicRoleId = "team_post_all_public"

	ChannelGuestRoleId = "channel_guest"
	ChannelUserRoleId  = "channel_user"
	ChannelAdminRoleId = "channel_admin"

	CustomGroupUserRoleId = "custom_group_user"

	PlaybookAdminRoleId  = "playbook_admin"
	PlaybookMemberRoleId = "playbook_member"
	RunAdminRoleId       = "run_admin"
	RunMemberRoleId      = "run_member"

	RoleNameMaxLength        = 64
	RoleDisplayNameMaxLength = 128
	RoleDescriptionMaxLength = 1024

	RoleScopeSystem  RoleScope = "System"
	RoleScopeTeam    RoleScope = "Team"
	RoleScopeChannel RoleScope = "Channel"
	RoleScopeGroup   RoleScope = "Group"

	RoleTypeGuest RoleType = "Guest"
	RoleTypeUser  RoleType = "User"
	RoleTypeAdmin RoleType = "Admin"
)
View Source
const (
	UserAuthServiceSaml     = "saml"
	UserAuthServiceSamlText = "SAML"
	UserAuthServiceIsSaml   = "isSaml"
	UserAuthServiceIsMobile = "isMobile"
	UserAuthServiceIsOAuth  = "isOAuthUser"
)
View Source
const (
	ScheduledPostErrorUnknownError            = "unknown"
	ScheduledPostErrorCodeChannelArchived     = "channel_archived"
	ScheduledPostErrorCodeChannelNotFound     = "channel_not_found"
	ScheduledPostErrorCodeUserDoesNotExist    = "user_missing"
	ScheduledPostErrorCodeUserDeleted         = "user_deleted"
	ScheduledPostErrorCodeNoChannelPermission = "no_channel_permission"
	ScheduledPostErrorNoChannelMember         = "no_channel_member"
	ScheduledPostErrorThreadDeleted           = "thread_deleted"
	ScheduledPostErrorUnableToSend            = "unable_to_send"
	ScheduledPostErrorInvalidPost             = "invalid_post"
)
View Source
const (
	SchemeDisplayNameMaxLength = 128
	SchemeNameMaxLength        = 64
	SchemeDescriptionMaxLength = 1024
	SchemeScopeTeam            = "team"
	SchemeScopeChannel         = "channel"
	SchemeScopePlaybook        = "playbook"
	SchemeScopeRun             = "run"
)
View Source
const (
	// ServiceEnvironmentProduction represents the production self-managed or cloud
	// environments. This can be configured explicitly with MM_SERVICEENVIRONMENT explicitly
	// set to "production", but is also the default for any production builds.
	ServiceEnvironmentProduction = "production"
	// ServiceEnvironmentTest represents testing environments in which MM_SERVICEENVIRONMENT
	// is set explicitly to "test".
	ServiceEnvironmentTest = "test"
	// ServiceEnvironmentDev represents development environments. This can be configured
	// explicitly with MM_SERVICEENVIRONMENT set to "dev", but is also the default for any
	// non-production builds.
	ServiceEnvironmentDev = "dev"
)
View Source
const (
	SessionCookieToken                    = "MMAUTHTOKEN"
	SessionCookieUser                     = "MMUSERID"
	SessionCookieCsrf                     = "MMCSRF"
	SessionCookieCloudUrl                 = "MMCLOUDURL"
	SessionCacheSize                      = 35000
	SessionPropPlatform                   = "platform"
	SessionPropOs                         = "os"
	SessionPropBrowser                    = "browser"
	SessionPropType                       = "type"
	SessionPropUserAccessTokenId          = "user_access_token_id"
	SessionPropIsBot                      = "is_bot"
	SessionPropIsBotValue                 = "true"
	SessionPropOAuthAppID                 = "oauth_app_id"
	SessionPropMattermostAppID            = "mattermost_app_id"
	SessionPropLastRemovedDeviceId        = "last_removed_device_id"
	SessionPropDeviceNotificationDisabled = "device_notification_disabled"
	SessionPropMobileVersion              = "mobile_version"
	SessionTypeUserAccessToken            = "UserAccessToken"
	SessionTypeCloudKey                   = "CloudKey"
	SessionTypeRemoteclusterToken         = "RemoteClusterToken"
	SessionPropIsGuest                    = "is_guest"
	SessionActivityTimeout                = 1000 * 60 * 5  // 5 minutes
	SessionUserAccessTokenExpiryHours     = 100 * 365 * 24 // 100 years
)
View Source
const (
	UserPropsKeyRemoteUsername = "RemoteUsername"
	UserPropsKeyRemoteEmail    = "RemoteEmail"
)
View Source
const (
	StatusOutOfOffice    = "ooo"
	StatusOffline        = "offline"
	StatusAway           = "away"
	StatusDnd            = "dnd"
	StatusOnline         = "online"
	StatusCacheSize      = SessionCacheSize
	StatusChannelTimeout = 20000  // 20 seconds
	StatusMinUpdateTime  = 120000 // 2 minutes
)
View Source
const (
	SystemTelemetryId                      = "DiagnosticId"
	SystemRanUnitTests                     = "RanUnitTests"
	SystemLastSecurityTime                 = "LastSecurityTime"
	SystemActiveLicenseId                  = "ActiveLicenseId"
	SystemLastComplianceTime               = "LastComplianceTime"
	SystemAsymmetricSigningKeyKey          = "AsymmetricSigningKey"
	SystemPostActionCookieSecretKey        = "PostActionCookieSecret"
	SystemInstallationDateKey              = "InstallationDate"
	SystemOrganizationName                 = "OrganizationName"
	SystemFirstAdminRole                   = "FirstAdminRole"
	SystemFirstServerRunTimestampKey       = "FirstServerRunTimestamp"
	SystemClusterEncryptionKey             = "ClusterEncryptionKey"
	SystemUpgradedFromTeId                 = "UpgradedFromTE"
	SystemWarnMetricNumberOfTeams5         = "warn_metric_number_of_teams_5"
	SystemWarnMetricNumberOfChannels50     = "warn_metric_number_of_channels_50"
	SystemWarnMetricMfa                    = "warn_metric_mfa"
	SystemWarnMetricEmailDomain            = "warn_metric_email_domain"
	SystemWarnMetricNumberOfActiveUsers100 = "warn_metric_number_of_active_users_100"
	SystemWarnMetricNumberOfActiveUsers200 = "warn_metric_number_of_active_users_200"
	SystemWarnMetricNumberOfActiveUsers300 = "warn_metric_number_of_active_users_300"
	SystemWarnMetricNumberOfActiveUsers500 = "warn_metric_number_of_active_users_500"
	SystemWarnMetricNumberOfPosts2m        = "warn_metric_number_of_posts_2M"
	SystemWarnMetricLastRunTimestampKey    = "LastWarnMetricRunTimestamp"
	SystemFirstAdminVisitMarketplace       = "FirstAdminVisitMarketplace"
	SystemFirstAdminSetupComplete          = "FirstAdminSetupComplete"
	SystemLastAccessiblePostTime           = "LastAccessiblePostTime"
	SystemLastAccessibleFileTime           = "LastAccessibleFileTime"
	SystemHostedPurchaseNeedsScreening     = "HostedPurchaseNeedsScreening"
	AwsMeteringReportInterval              = 1
	AwsMeteringDimensionUsageHrs           = "UsageHrs"
	CloudRenewalEmail                      = "CloudRenewalEmail"
)
View Source
const (
	WarnMetricStatusLimitReached    = "true"
	WarnMetricStatusRunonce         = "runonce"
	WarnMetricStatusAck             = "ack"
	WarnMetricStatusStorePrefix     = "warn_metric_"
	WarnMetricJobInterval           = 24 * 7
	WarnMetricNumberOfActiveUsers25 = 25
	WarnMetricJobWaitTime           = 1000 * 3600 * 24 * 7 // 7 days
)
View Source
const (
	TeamOpen                    = "O"
	TeamInvite                  = "I"
	TeamAllowedDomainsMaxLength = 500
	TeamCompanyNameMaxLength    = 64
	TeamDescriptionMaxLength    = 255
	TeamDisplayNameMaxRunes     = 64
	TeamEmailMaxLength          = 128
	TeamNameMaxLength           = 64
	TeamNameMinLength           = 2
)
View Source
const (
	TokenSize          = 64
	MaxTokenExipryTime = 1000 * 60 * 60 * 48 // 48 hour
	TokenTypeOAuth     = "oauth"
	TokenTypeSaml      = "saml"
)
View Source
const (
	Me                             = "me"
	UserNotifyAll                  = "all"
	UserNotifyHere                 = "here"
	UserNotifyMention              = "mention"
	UserNotifyNone                 = "none"
	DesktopNotifyProp              = "desktop"
	DesktopSoundNotifyProp         = "desktop_sound"
	MarkUnreadNotifyProp           = "mark_unread"
	PushNotifyProp                 = "push"
	PushStatusNotifyProp           = "push_status"
	EmailNotifyProp                = "email"
	ChannelMentionsNotifyProp      = "channel"
	CommentsNotifyProp             = "comments"
	MentionKeysNotifyProp          = "mention_keys"
	HighlightsNotifyProp           = "highlight_keys"
	CommentsNotifyNever            = "never"
	CommentsNotifyRoot             = "root"
	CommentsNotifyAny              = "any"
	CommentsNotifyCRT              = "crt"
	FirstNameNotifyProp            = "first_name"
	AutoResponderActiveNotifyProp  = "auto_responder_active"
	AutoResponderMessageNotifyProp = "auto_responder_message"
	DesktopThreadsNotifyProp       = "desktop_threads"
	PushThreadsNotifyProp          = "push_threads"
	EmailThreadsNotifyProp         = "email_threads"

	DefaultLocale        = "en"
	UserAuthServiceEmail = "email"

	UserEmailMaxLength    = 128
	UserNicknameMaxRunes  = 64
	UserPositionMaxRunes  = 128
	UserFirstNameMaxRunes = 64
	UserLastNameMaxRunes  = 64
	UserAuthDataMaxLength = 128
	UserNameMaxLength     = 64
	UserNameMinLength     = 1
	UserPasswordMaxLength = 72
	UserLocaleMaxLength   = 5
	UserTimezoneMaxRunes  = 256
	UserRolesMaxLength    = 256

	DesktopTokenTTL = time.Minute * 3
)
View Source
const (
	LowercaseLetters = "abcdefghijklmnopqrstuvwxyz"
	UppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	NUMBERS          = "0123456789"
	SYMBOLS          = " !\"\\#$%&'()*+,-./:;<=>?@[]^_`|~"
	BinaryParamKey   = "MM_BINARY_PARAMETERS"
	NoTranslation    = "<untranslated>"

	PayloadParseError = "api.payload.parse.error"
)
View Source
const (
	SocketMaxMessageSizeKb   = 8 * 1024 // 8KB
	PingTimeoutBufferSeconds = 5
)
View Source
const (
	WebSocketRemoteAddr    = "remote_addr"
	WebSocketXForwardedFor = "x_forwarded_for"
)
View Source
const ChannelSearchDefaultLimit = 50
View Source
const (
	CommandWebhookLifetime = 1000 * 60 * 30
)
View Source
const ConfigAccessTagAnySysConsoleRead = "*_read"

Allows read access if any PermissionSysconsoleRead* is allowed

View Source
const ConfigAccessTagCloudRestrictable = "cloud_restrictable"
View Source
const ConfigAccessTagType = "access"
View Source
const ConfigAccessTagWriteRestrictable = "write_restrictable"
View Source
const (
	DefaultWebhookUsername = "webhook"
)
View Source
const ExportDataDir = "data"

ExportDataDir is the name of the directory were to store additional data included with the export (e.g. file attachments).

View Source
const (
	LicenseUpForRenewalEmailSent = "LicenseUpForRenewalEmailSent"
)
View Source
const (
	MaxImageSize = int64(6048 * 4032) // 24 megapixels, roughly 36MB as a raw image
)
View Source
const OutgoingHookResponseTypeComment = "comment"
View Source
const (
	SupportPacketErrorFile = "warning.txt"
)
View Source
const (
	USERNAME = "Username"
)
View Source
const UpcomingInvoice = "upcoming"
View Source
const UploadNoUserID = "nouser"

UploadNoUserID is a "fake" user id used by the API layer when in local mode.

View Source
const (
	UserAuthServiceGitlab = "gitlab"
)
View Source
const UserSearchDefaultLimit = 100
View Source
const UserSearchMaxLimit = 1000

Variables

View Source
var (
	AcceptedInteractions = sliceToMapKey("keyboard", "pointer", "other")
	AcceptedLCPRegions   = sliceToMapKey(
		"post",
		"post_textbox",
		"channel_sidebar",
		"team_sidebar",
		"channel_header",
		"global_header",
		"announcement_bar",
		"center_channel",
		"modal_content",
		"other",
	)
	AcceptedTrueFalseLabels = sliceToMapKey("true", "false")
)
View Source
var (
	ReportExportFormats = []string{"csv"}

	UserReportSortColumns = []string{"CreateAt", "Username", "FirstName", "LastName", "Nickname", "Email", "Roles"}
)
View Source
var (
	ErrChannelAlreadyShared = errors.New("channel is already shared")
	ErrChannelHomedOnRemote = errors.New("channel is homed on a remote cluster")
	ErrChannelAlreadyExists = errors.New("channel already exists")
)
View Source
var AllPermissions []*Permission
View Source
var BuildDate string
View Source
var BuildEnterpriseReady string
View Source
var BuildHash string
View Source
var BuildHashEnterprise string
View Source
var BuildNumber string
View Source
var BuiltInSchemeManagedRoleIDs []string
View Source
var ChannelModeratedPermissions []string
View Source
var ChannelModeratedPermissionsMap map[string]string
View Source
var CurrentVersion = versions[0]
View Source
var DeprecatedPermissions []*Permission
View Source
var EmojiPattern = regexp.MustCompile(`:[a-zA-Z0-9_+-]+:`)
View Source
var ErrMaxPropSizeExceeded = fmt.Errorf("max prop size of %d exceeded", maxPropSizeBytes)
View Source
var (
	ErrOfflineRemote = errors.New("remote is offline")
)
View Source
var InstalledIntegrationsIgnoredPlugins = map[string]struct{}{
	PluginIdPlaybooks:     {},
	PluginIdFocalboard:    {},
	PluginIdApps:          {},
	PluginIdCalls:         {},
	PluginIdNPS:           {},
	PluginIdChannelExport: {},
	PluginIdAI:            {},
}
View Source
var MattermostGiphySdkKey string
View Source
var MockCWS string
View Source
var ModeratedBookmarkPermissions []*Permission
View Source
var NewSystemRoleIDs []string
View Source
var PostActionRetainPropKeys = []string{"from_webhook", "override_username", "override_icon_url"}
View Source
var ServerTLSSupportedCiphers = map[string]uint16{
	"TLS_RSA_WITH_RC4_128_SHA":                tls.TLS_RSA_WITH_RC4_128_SHA,
	"TLS_RSA_WITH_3DES_EDE_CBC_SHA":           tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
	"TLS_RSA_WITH_AES_128_CBC_SHA":            tls.TLS_RSA_WITH_AES_128_CBC_SHA,
	"TLS_RSA_WITH_AES_256_CBC_SHA":            tls.TLS_RSA_WITH_AES_256_CBC_SHA,
	"TLS_RSA_WITH_AES_128_CBC_SHA256":         tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
	"TLS_RSA_WITH_AES_128_GCM_SHA256":         tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
	"TLS_RSA_WITH_AES_256_GCM_SHA384":         tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
	"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA":        tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
	"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA":    tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
	"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA":    tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
	"TLS_ECDHE_RSA_WITH_RC4_128_SHA":          tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
	"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA":     tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
	"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA":      tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
	"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA":      tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
	"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
	"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256":   tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
	"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256":   tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
	"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
	"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384":   tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
	"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
	"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305":    tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
	"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305":  tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
}
View Source
var SysconsoleAncillaryPermissions map[string][]*Permission

SysconsoleAncillaryPermissions maps the non-sysconsole permissions required by each sysconsole view.

View Source
var SysconsoleReadPermissions []*Permission
View Source
var SysconsoleWritePermissions []*Permission
View Source
var SystemCustomGroupAdminDefaultPermissions []string
View Source
var SystemEmojis = map[string]string{}/* 4464 elements not displayed */
View Source
var SystemManagerDefaultPermissions []string
View Source
var SystemReadOnlyAdminDefaultPermissions []string
View Source
var SystemUserManagerDefaultPermissions []string

Functions

func AddAncillaryPermissions

func AddAncillaryPermissions(permissions []string) []string

func AppErrorFromJSON

func AppErrorFromJSON(r io.Reader) error

AppErrorFromJSON will try to decode the input into an AppError.

func AppErrorInit

func AppErrorInit(t i18n.TranslateFunc)

func ArrayFromInterface

func ArrayFromInterface(data any) []string

func ArrayFromJSON deprecated

func ArrayFromJSON(data io.Reader) []string

Deprecated: ArrayFromJSON is deprecated, use SortedArrayFromJSON or NonSortedArrayFromJSON instead

func ArrayToJSON

func ArrayToJSON(objmap []string) string

func AuditModelTypeConv

func AuditModelTypeConv(val any) (newVal any, converted bool)

AuditModelTypeConv converts key model types to something better suited for audit output.

func ChannelMentions

func ChannelMentions(message string) []string

func ChannelModeratedPermissionsChangedByPatch

func ChannelModeratedPermissionsChangedByPatch(role *Role, patch *RolePatch) []string

func CleanRoleNames

func CleanRoleNames(roleNames []string) ([]string, bool)

func CleanTeamName

func CleanTeamName(s string) string

func CleanUsername

func CleanUsername(logger mlog.LoggerIFace, username string) string

func ClearMentionTags

func ClearMentionTags(post string) string

func CompliancePostHeader

func CompliancePostHeader() []string

func ContainsIntegrationsReservedProps added in v0.1.8

func ContainsIntegrationsReservedProps(props StringInterface) []string

func CopyStringMap

func CopyStringMap(originalMap map[string]string) map[string]string

func DecryptPostActionCookie

func DecryptPostActionCookie(encoded string, secret []byte) (string, error)

func EmailInviteWithErrorToEmails

func EmailInviteWithErrorToEmails(o []*EmailInviteWithError) []string

func EmailInviteWithErrorToString

func EmailInviteWithErrorToString(o *EmailInviteWithError) string

func Etag

func Etag(parts ...any) string

func FloorToNearestHour

func FloorToNearestHour(ms int64) int64

FloorToNearestHour takes a timestamp (in milliseconds) and returns it rounded to the previous hour in UTC.

func GenerateLinkMetadataHash

func GenerateLinkMetadataHash(url string, timestamp int64) int64

GenerateLinkMetadataHash generates a unique hash for a given URL and timestamp for use as a database key.

func GetDMNameFromIds

func GetDMNameFromIds(userId1, userId2 string) string

func GetDefaultAppCustomURLSchemes

func GetDefaultAppCustomURLSchemes() []string

func GetEmojiNameFromUnicode

func GetEmojiNameFromUnicode(unicode string) (emojiName string, count int)

func GetEndOfDayMillis

func GetEndOfDayMillis(thisTime time.Time, timeZoneOffset int) int64

GetEndOfDayMillis is a convenience method to get milliseconds since epoch for provided date's end of day

func GetEtagForFileInfos

func GetEtagForFileInfos(infos []*FileInfo) string

func GetGroupDisplayNameFromUsers

func GetGroupDisplayNameFromUsers(users []*User, truncate bool) string

func GetGroupNameFromUserIds

func GetGroupNameFromUserIds(userIds []string) string

func GetMillis

func GetMillis() int64

GetMillis is a convenience method to get milliseconds since epoch.

func GetMillisForTime

func GetMillisForTime(thisTime time.Time) int64

GetMillisForTime is a convenience method to get milliseconds since epoch for provided Time.

func GetPreferredTimezone

func GetPreferredTimezone(timezone StringMap) string

func GetPreviousVersion

func GetPreviousVersion(version string) string

func GetReportDateRange added in v0.0.14

func GetReportDateRange(dateRange string, now time.Time) (int64, int64)

func GetServerIPAddress

func GetServerIPAddress(iface string) string