model

package
v5.29.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: AGPL-3.0, Apache-2.0 Imports: 62 Imported by: 480

Documentation

Index

Constants

View Source
const (
	ACCESS_TOKEN_GRANT_TYPE  = "authorization_code"
	ACCESS_TOKEN_TYPE        = "bearer"
	REFRESH_TOKEN_GRANT_TYPE = "refresh_token"
)
View Source
const (
	AUTHCODE_EXPIRE_TIME   = 60 * 10 // 10 minutes
	AUTHCODE_RESPONSE_TYPE = "code"
	IMPLICIT_RESPONSE_TYPE = "token"
	DEFAULT_SCOPE          = "user"
)
View Source
const (
	BOT_DISPLAY_NAME_MAX_RUNES   = USER_FIRST_NAME_MAX_RUNES
	BOT_DESCRIPTION_MAX_RUNES    = 1024
	BOT_CREATOR_ID_MAX_RUNES     = KEY_VALUE_PLUGIN_ID_MAX_RUNES // UserId or PluginId
	BOT_WARN_METRIC_BOT_USERNAME = "mattermost-advisor"
)
View Source
const (
	CHANNEL_OPEN                   = "O"
	CHANNEL_PRIVATE                = "P"
	CHANNEL_DIRECT                 = "D"
	CHANNEL_GROUP                  = "G"
	CHANNEL_GROUP_MAX_USERS        = 8
	CHANNEL_GROUP_MIN_USERS        = 3
	DEFAULT_CHANNEL                = "town-square"
	CHANNEL_DISPLAY_NAME_MAX_RUNES = 64
	CHANNEL_NAME_MIN_LENGTH        = 2
	CHANNEL_NAME_MAX_LENGTH        = 64
	CHANNEL_HEADER_MAX_RUNES       = 1024
	CHANNEL_PURPOSE_MAX_RUNES      = 250
	CHANNEL_CACHE_SIZE             = 25000

	CHANNEL_SORT_BY_USERNAME = "username"
	CHANNEL_SORT_BY_STATUS   = "status"
)
View Source
const (
	CHANNEL_NOTIFY_DEFAULT              = "default"
	CHANNEL_NOTIFY_ALL                  = "all"
	CHANNEL_NOTIFY_MENTION              = "mention"
	CHANNEL_NOTIFY_NONE                 = "none"
	CHANNEL_MARK_UNREAD_ALL             = "all"
	CHANNEL_MARK_UNREAD_MENTION         = "mention"
	IGNORE_CHANNEL_MENTIONS_DEFAULT     = "default"
	IGNORE_CHANNEL_MENTIONS_OFF         = "off"
	IGNORE_CHANNEL_MENTIONS_ON          = "on"
	IGNORE_CHANNEL_MENTIONS_NOTIFY_PROP = "ignore_channel_mentions"
)
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 (
	HEADER_REQUEST_ID         = "X-Request-ID"
	HEADER_VERSION_ID         = "X-Version-ID"
	HEADER_CLUSTER_ID         = "X-Cluster-ID"
	HEADER_ETAG_SERVER        = "ETag"
	HEADER_ETAG_CLIENT        = "If-None-Match"
	HEADER_FORWARDED          = "X-Forwarded-For"
	HEADER_REAL_IP            = "X-Real-IP"
	HEADER_FORWARDED_PROTO    = "X-Forwarded-Proto"
	HEADER_TOKEN              = "token"
	HEADER_CSRF_TOKEN         = "X-CSRF-Token"
	HEADER_BEARER             = "BEARER"
	HEADER_AUTH               = "Authorization"
	HEADER_REQUESTED_WITH     = "X-Requested-With"
	HEADER_REQUESTED_WITH_XML = "XMLHttpRequest"
	STATUS                    = "status"
	STATUS_OK                 = "OK"
	STATUS_FAIL               = "FAIL"
	STATUS_UNHEALTHY          = "UNHEALTHY"
	STATUS_REMOVE             = "REMOVE"

	CLIENT_DIR = "client"

	API_URL_SUFFIX_V1 = "/api/v1"
	API_URL_SUFFIX_V4 = "/api/v4"
	API_URL_SUFFIX    = API_URL_SUFFIX_V4
)
View Source
const (
	CDS_OFFLINE_AFTER_MILLIS = 1000 * 60 * 30 // 30 minutes
	CDS_TYPE_APP             = "mattermost_app"
)
View Source
const (
	CLUSTER_EVENT_PUBLISH                                           = "publish"
	CLUSTER_EVENT_UPDATE_STATUS                                     = "update_status"
	CLUSTER_EVENT_INVALIDATE_ALL_CACHES                             = "inv_all_caches"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_REACTIONS                    = "inv_reactions"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_WEBHOOK                      = "inv_webhook"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_POSTS                = "inv_channel_posts"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBERS_NOTIFY_PROPS = "inv_channel_members_notify_props"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBERS              = "inv_channel_members"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_BY_NAME              = "inv_channel_name"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL                      = "inv_channel"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_GUEST_COUNT          = "inv_channel_guest_count"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_USER                         = "inv_user"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_USER_TEAMS                   = "inv_user_teams"
	CLUSTER_EVENT_CLEAR_SESSION_CACHE_FOR_USER                      = "clear_session_user"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_ROLES                        = "inv_roles"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_ROLE_PERMISSIONS             = "inv_role_permissions"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_PROFILE_BY_IDS               = "inv_profile_ids"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_PROFILE_IN_CHANNEL           = "inv_profile_in_channel"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_SCHEMES                      = "inv_schemes"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_FILE_INFOS                   = "inv_file_infos"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_WEBHOOKS                     = "inv_webhooks"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_EMOJIS_BY_ID                 = "inv_emojis_by_id"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_EMOJIS_ID_BY_NAME            = "inv_emojis_id_by_name"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_PINNEDPOSTS_COUNTS   = "inv_channel_pinnedposts_counts"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBER_COUNTS        = "inv_channel_member_counts"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_LAST_POSTS                   = "inv_last_posts"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_LAST_POST_TIME               = "inv_last_post_time"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_TEAMS                        = "inv_teams"
	CLUSTER_EVENT_CLEAR_SESSION_CACHE_FOR_ALL_USERS                 = "inv_all_user_sessions"
	CLUSTER_EVENT_INSTALL_PLUGIN                                    = "install_plugin"
	CLUSTER_EVENT_REMOVE_PLUGIN                                     = "remove_plugin"
	CLUSTER_EVENT_INVALIDATE_CACHE_FOR_TERMS_OF_SERVICE             = "inv_terms_of_service"
	CLUSTER_EVENT_BUSY_STATE_CHANGED                                = "busy_state_change"

	// Gossip communication
	CLUSTER_GOSSIP_EVENT_REQUEST_GET_LOGS             = "gossip_request_get_logs"
	CLUSTER_GOSSIP_EVENT_RESPONSE_GET_LOGS            = "gossip_response_get_logs"
	CLUSTER_GOSSIP_EVENT_REQUEST_GET_CLUSTER_STATS    = "gossip_request_cluster_stats"
	CLUSTER_GOSSIP_EVENT_RESPONSE_GET_CLUSTER_STATS   = "gossip_response_cluster_stats"
	CLUSTER_GOSSIP_EVENT_REQUEST_GET_PLUGIN_STATUSES  = "gossip_request_plugin_statuses"
	CLUSTER_GOSSIP_EVENT_RESPONSE_GET_PLUGIN_STATUSES = "gossip_response_plugin_statuses"
	CLUSTER_GOSSIP_EVENT_REQUEST_SAVE_CONFIG          = "gossip_request_save_config"
	CLUSTER_GOSSIP_EVENT_RESPONSE_SAVE_CONFIG         = "gossip_response_save_config"

	// SendTypes for ClusterMessage.
	CLUSTER_SEND_BEST_EFFORT = "best_effort"
	CLUSTER_SEND_RELIABLE    = "reliable"
)
View Source
const (
	COMMAND_METHOD_POST = "P"
	COMMAND_METHOD_GET  = "G"
	MIN_TRIGGER_LENGTH  = 1
	MAX_TRIGGER_LENGTH  = 128
)
View Source
const (
	COMMAND_RESPONSE_TYPE_IN_CHANNEL = "in_channel"
	COMMAND_RESPONSE_TYPE_EPHEMERAL  = "ephemeral"
)
View Source
const (
	COMPLIANCE_STATUS_CREATED  = "created"
	COMPLIANCE_STATUS_RUNNING  = "running"
	COMPLIANCE_STATUS_FINISHED = "finished"
	COMPLIANCE_STATUS_FAILED   = "failed"
	COMPLIANCE_STATUS_REMOVED  = "removed"

	COMPLIANCE_TYPE_DAILY = "daily"
	COMPLIANCE_TYPE_ADHOC = "adhoc"
)
View Source
const (
	CONN_SECURITY_NONE     = ""
	CONN_SECURITY_PLAIN    = "PLAIN"
	CONN_SECURITY_TLS      = "TLS"
	CONN_SECURITY_STARTTLS = "STARTTLS"

	IMAGE_DRIVER_LOCAL = "local"
	IMAGE_DRIVER_S3    = "amazons3"

	DATABASE_DRIVER_SQLITE   = "sqlite3"
	DATABASE_DRIVER_MYSQL    = "mysql"
	DATABASE_DRIVER_POSTGRES = "postgres"

	MINIO_ACCESS_KEY = "minioaccesskey"
	MINIO_SECRET_KEY = "miniosecretkey"
	MINIO_BUCKET     = "mattermost-test"

	PASSWORD_MAXIMUM_LENGTH = 64
	PASSWORD_MINIMUM_LENGTH = 5

	SERVICE_GITLAB    = "gitlab"
	SERVICE_GOOGLE    = "google"
	SERVICE_OFFICE365 = "office365"

	GENERIC_NO_CHANNEL_NOTIFICATION = "generic_no_channel"
	GENERIC_NOTIFICATION            = "generic"
	GENERIC_NOTIFICATION_SERVER     = "https://push-test.mattermost.com"
	MM_SUPPORT_ADDRESS              = "support@mattermost.com"
	FULL_NOTIFICATION               = "full"
	ID_LOADED_NOTIFICATION          = "id_loaded"

	DIRECT_MESSAGE_ANY  = "any"
	DIRECT_MESSAGE_TEAM = "team"

	SHOW_USERNAME          = "username"
	SHOW_NICKNAME_FULLNAME = "nickname_full_name"
	SHOW_FULLNAME          = "full_name"

	PERMISSIONS_ALL           = "all"
	PERMISSIONS_CHANNEL_ADMIN = "channel_admin"
	PERMISSIONS_TEAM_ADMIN    = "team_admin"
	PERMISSIONS_SYSTEM_ADMIN  = "system_admin"

	FAKE_SETTING = "********************************"

	RESTRICT_EMOJI_CREATION_ALL          = "all"
	RESTRICT_EMOJI_CREATION_ADMIN        = "admin"
	RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin"

	PERMISSIONS_DELETE_POST_ALL          = "all"
	PERMISSIONS_DELETE_POST_TEAM_ADMIN   = "team_admin"
	PERMISSIONS_DELETE_POST_SYSTEM_ADMIN = "system_admin"

	ALLOW_EDIT_POST_ALWAYS     = "always"
	ALLOW_EDIT_POST_NEVER      = "never"
	ALLOW_EDIT_POST_TIME_LIMIT = "time_limit"

	GROUP_UNREAD_CHANNELS_DISABLED    = "disabled"
	GROUP_UNREAD_CHANNELS_DEFAULT_ON  = "default_on"
	GROUP_UNREAD_CHANNELS_DEFAULT_OFF = "default_off"

	EMAIL_BATCHING_BUFFER_SIZE = 256
	EMAIL_BATCHING_INTERVAL    = 30

	EMAIL_NOTIFICATION_CONTENTS_FULL    = "full"
	EMAIL_NOTIFICATION_CONTENTS_GENERIC = "generic"

	SITENAME_MAX_LENGTH = 30

	SERVICE_SETTINGS_DEFAULT_SITE_URL           = "http://localhost:8065"
	SERVICE_SETTINGS_DEFAULT_TLS_CERT_FILE      = ""
	SERVICE_SETTINGS_DEFAULT_TLS_KEY_FILE       = ""
	SERVICE_SETTINGS_DEFAULT_READ_TIMEOUT       = 300
	SERVICE_SETTINGS_DEFAULT_WRITE_TIMEOUT      = 300
	SERVICE_SETTINGS_DEFAULT_IDLE_TIMEOUT       = 60
	SERVICE_SETTINGS_DEFAULT_MAX_LOGIN_ATTEMPTS = 10
	SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM    = ""
	SERVICE_SETTINGS_DEFAULT_LISTEN_AND_ADDRESS = ":8065"
	SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY     = "2_KtH_W5"
	SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET  = "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof"

	TEAM_SETTINGS_DEFAULT_SITE_NAME                = "Mattermost"
	TEAM_SETTINGS_DEFAULT_MAX_USERS_PER_TEAM       = 50
	TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT        = ""
	TEAM_SETTINGS_DEFAULT_CUSTOM_DESCRIPTION_TEXT  = ""
	TEAM_SETTINGS_DEFAULT_USER_STATUS_AWAY_TIMEOUT = 300

	SQL_SETTINGS_DEFAULT_DATA_SOURCE = "mmuser:mostest@tcp(localhost:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s"

	FILE_SETTINGS_DEFAULT_DIRECTORY = "./data/"

	EMAIL_SETTINGS_DEFAULT_FEEDBACK_ORGANIZATION = ""

	SUPPORT_SETTINGS_DEFAULT_TERMS_OF_SERVICE_LINK = "https://about.mattermost.com/default-terms/"
	SUPPORT_SETTINGS_DEFAULT_PRIVACY_POLICY_LINK   = "https://about.mattermost.com/default-privacy-policy/"
	SUPPORT_SETTINGS_DEFAULT_ABOUT_LINK            = "https://about.mattermost.com/default-about/"
	SUPPORT_SETTINGS_DEFAULT_HELP_LINK             = "https://about.mattermost.com/default-help/"
	SUPPORT_SETTINGS_DEFAULT_REPORT_A_PROBLEM_LINK = "https://about.mattermost.com/default-report-a-problem/"
	SUPPORT_SETTINGS_DEFAULT_SUPPORT_EMAIL         = "feedback@mattermost.com"
	SUPPORT_SETTINGS_DEFAULT_RE_ACCEPTANCE_PERIOD  = 365

	LDAP_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE         = ""
	LDAP_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE          = ""
	LDAP_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE              = ""
	LDAP_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE           = ""
	LDAP_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE           = ""
	LDAP_SETTINGS_DEFAULT_ID_ATTRIBUTE                 = ""
	LDAP_SETTINGS_DEFAULT_POSITION_ATTRIBUTE           = ""
	LDAP_SETTINGS_DEFAULT_LOGIN_FIELD_NAME             = ""
	LDAP_SETTINGS_DEFAULT_GROUP_DISPLAY_NAME_ATTRIBUTE = ""
	LDAP_SETTINGS_DEFAULT_GROUP_ID_ATTRIBUTE           = ""
	LDAP_SETTINGS_DEFAULT_PICTURE_ATTRIBUTE            = ""

	SAML_SETTINGS_DEFAULT_ID_ATTRIBUTE         = ""
	SAML_SETTINGS_DEFAULT_GUEST_ATTRIBUTE      = ""
	SAML_SETTINGS_DEFAULT_ADMIN_ATTRIBUTE      = ""
	SAML_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE = ""
	SAML_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE  = ""
	SAML_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE      = ""
	SAML_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE   = ""
	SAML_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE   = ""
	SAML_SETTINGS_DEFAULT_LOCALE_ATTRIBUTE     = ""
	SAML_SETTINGS_DEFAULT_POSITION_ATTRIBUTE   = ""

	SAML_SETTINGS_SIGNATURE_ALGORITHM_SHA1    = "RSAwithSHA1"
	SAML_SETTINGS_SIGNATURE_ALGORITHM_SHA256  = "RSAwithSHA256"
	SAML_SETTINGS_SIGNATURE_ALGORITHM_SHA512  = "RSAwithSHA512"
	SAML_SETTINGS_DEFAULT_SIGNATURE_ALGORITHM = SAML_SETTINGS_SIGNATURE_ALGORITHM_SHA1

	SAML_SETTINGS_CANONICAL_ALGORITHM_C14N    = "Canonical1.0"
	SAML_SETTINGS_CANONICAL_ALGORITHM_C14N11  = "Canonical1.1"
	SAML_SETTINGS_DEFAULT_CANONICAL_ALGORITHM = SAML_SETTINGS_CANONICAL_ALGORITHM_C14N

	NATIVEAPP_SETTINGS_DEFAULT_APP_DOWNLOAD_LINK         = "https://mattermost.com/download/#mattermostApps"
	NATIVEAPP_SETTINGS_DEFAULT_ANDROID_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-android-app/"
	NATIVEAPP_SETTINGS_DEFAULT_IOS_APP_DOWNLOAD_LINK     = "https://about.mattermost.com/mattermost-ios-app/"

	EXPERIMENTAL_SETTINGS_DEFAULT_LINK_METADATA_TIMEOUT_MILLISECONDS = 5000

	ANALYTICS_SETTINGS_DEFAULT_MAX_USERS_FOR_STATISTICS = 2500

	ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_COLOR                    = "#f2a93b"
	ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_TEXT_COLOR               = "#333333"
	ANNOUNCEMENT_SETTINGS_DEFAULT_NOTICES_JSON_URL                = "https://notices.mattermost.com/"
	ANNOUNCEMENT_SETTINGS_DEFAULT_NOTICES_FETCH_FREQUENCY_SECONDS = 3600

	TEAM_SETTINGS_DEFAULT_TEAM_TEXT = "default"

	ELASTICSEARCH_SETTINGS_DEFAULT_CONNECTION_URL                    = "http://localhost:9200"
	ELASTICSEARCH_SETTINGS_DEFAULT_USERNAME                          = "elastic"
	ELASTICSEARCH_SETTINGS_DEFAULT_PASSWORD                          = "changeme"
	ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_REPLICAS               = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_SHARDS                 = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_CHANNEL_INDEX_REPLICAS            = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_CHANNEL_INDEX_SHARDS              = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_USER_INDEX_REPLICAS               = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_USER_INDEX_SHARDS                 = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_AGGREGATE_POSTS_AFTER_DAYS        = 365
	ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME   = "03:00"
	ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX                      = ""
	ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE          = 1
	ELASTICSEARCH_SETTINGS_DEFAULT_BULK_INDEXING_TIME_WINDOW_SECONDS = 3600
	ELASTICSEARCH_SETTINGS_DEFAULT_REQUEST_TIMEOUT_SECONDS           = 30

	BLEVE_SETTINGS_DEFAULT_INDEX_DIR                         = ""
	BLEVE_SETTINGS_DEFAULT_BULK_INDEXING_TIME_WINDOW_SECONDS = 3600

	DATA_RETENTION_SETTINGS_DEFAULT_MESSAGE_RETENTION_DAYS  = 365
	DATA_RETENTION_SETTINGS_DEFAULT_FILE_RETENTION_DAYS     = 365
	DATA_RETENTION_SETTINGS_DEFAULT_DELETION_JOB_START_TIME = "02:00"

	PLUGIN_SETTINGS_DEFAULT_DIRECTORY          = "./plugins"
	PLUGIN_SETTINGS_DEFAULT_CLIENT_DIRECTORY   = "./client/plugins"
	PLUGIN_SETTINGS_DEFAULT_ENABLE_MARKETPLACE = true
	PLUGIN_SETTINGS_DEFAULT_MARKETPLACE_URL    = "https://api.integrations.mattermost.com"
	PLUGIN_SETTINGS_OLD_MARKETPLACE_URL        = "https://marketplace.integrations.mattermost.com"

	COMPLIANCE_EXPORT_TYPE_CSV             = "csv"
	COMPLIANCE_EXPORT_TYPE_ACTIANCE        = "actiance"
	COMPLIANCE_EXPORT_TYPE_GLOBALRELAY     = "globalrelay"
	COMPLIANCE_EXPORT_TYPE_GLOBALRELAY_ZIP = "globalrelay-zip"
	GLOBALRELAY_CUSTOMER_TYPE_A9           = "A9"
	GLOBALRELAY_CUSTOMER_TYPE_A10          = "A10"

	CLIENT_SIDE_CERT_CHECK_PRIMARY_AUTH   = "primary"
	CLIENT_SIDE_CERT_CHECK_SECONDARY_AUTH = "secondary"

	IMAGE_PROXY_TYPE_LOCAL      = "local"
	IMAGE_PROXY_TYPE_ATMOS_CAMO = "atmos/camo"

	GOOGLE_SETTINGS_DEFAULT_SCOPE             = "profile email"
	GOOGLE_SETTINGS_DEFAULT_AUTH_ENDPOINT     = "https://accounts.google.com/o/oauth2/v2/auth"
	GOOGLE_SETTINGS_DEFAULT_TOKEN_ENDPOINT    = "https://www.googleapis.com/oauth2/v4/token"
	GOOGLE_SETTINGS_DEFAULT_USER_API_ENDPOINT = "https://people.googleapis.com/v1/people/me?personFields=names,emailAddresses,nicknames,metadata"

	OFFICE365_SETTINGS_DEFAULT_SCOPE             = "User.Read"
	OFFICE365_SETTINGS_DEFAULT_AUTH_ENDPOINT     = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"
	OFFICE365_SETTINGS_DEFAULT_TOKEN_ENDPOINT    = "https://login.microsoftonline.com/common/oauth2/v2.0/token"
	OFFICE365_SETTINGS_DEFAULT_USER_API_ENDPOINT = "https://graph.microsoft.com/v1.0/me"

	LOCAL_MODE_SOCKET_PATH = "/var/tmp/mattermost_local.socket"
)
View Source
const (
	EMOJI_NAME_MAX_LENGTH = 64
	EMOJI_SORT_BY_NAME    = "name"
)
View Source
const (
	FILEINFO_SORT_BY_CREATED = "CreateAt"
	FILEINFO_SORT_BY_SIZE    = "Size"
)
View Source
const (
	GroupSourceLdap GroupSource = "ldap"

	GroupNameMaxLength        = 64
	GroupSourceMaxLength      = 64
	GroupDisplayNameMaxLength = 128
	GroupDescriptionMaxLength = 1024
	GroupRemoteIDMaxLength    = 48
)
View Source
const (
	POST_ACTION_TYPE_BUTTON                         = "button"
	POST_ACTION_TYPE_SELECT                         = "select"
	INTERACTIVE_DIALOG_TRIGGER_TIMEOUT_MILLISECONDS = 3000
)
View Source
const (
	JOB_TYPE_DATA_RETENTION                 = "data_retention"
	JOB_TYPE_MESSAGE_EXPORT                 = "message_export"
	JOB_TYPE_ELASTICSEARCH_POST_INDEXING    = "elasticsearch_post_indexing"
	JOB_TYPE_ELASTICSEARCH_POST_AGGREGATION = "elasticsearch_post_aggregation"
	JOB_TYPE_BLEVE_POST_INDEXING            = "bleve_post_indexing"
	JOB_TYPE_LDAP_SYNC                      = "ldap_sync"
	JOB_TYPE_MIGRATIONS                     = "migrations"
	JOB_TYPE_PLUGINS                        = "plugins"
	JOB_TYPE_EXPIRY_NOTIFY                  = "expiry_notify"
	JOB_TYPE_PRODUCT_NOTICES                = "product_notices"
	JOB_TYPE_ACTIVE_USERS                   = "active_users"

	JOB_STATUS_PENDING          = "pending"
	JOB_STATUS_IN_PROGRESS      = "in_progress"
	JOB_STATUS_SUCCESS          = "success"
	JOB_STATUS_ERROR            = "error"
	JOB_STATUS_CANCEL_REQUESTED = "cancel_requested"
	JOB_STATUS_CANCELED         = "canceled"
	JOB_STATUS_WARNING          = "warning"
)
View Source
const (
	USER_AUTH_SERVICE_LDAP      = "ldap"
	LDAP_PUBIC_CERTIFICATE_NAME = "ldap-public.crt"
	LDAP_PRIVATE_KEY_NAME       = "ldap-private.key"
)
View Source
const (
	EXPIRED_LICENSE_ERROR = "api.license.add_license.expired.app_error"
	INVALID_LICENSE_ERROR = "api.license.add_license.invalid.app_error"
	LICENSE_GRACE_PERIOD  = 1000 * 60 * 60 * 24 * 10 //10 days
	LICENSE_RENEWAL_LINK  = "https://mattermost.com/renew/"
)
View Source
const (
	LINK_METADATA_TYPE_IMAGE     LinkMetadataType = "image"
	LINK_METADATA_TYPE_NONE      LinkMetadataType = "none"
	LINK_METADATA_TYPE_OPENGRAPH LinkMetadataType = "opengraph"
	MAX_IMAGES                   int              = 5
)
View Source
const (
	ADVANCED_PERMISSIONS_MIGRATION_KEY         = "AdvancedPermissionsMigrationComplete"
	MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2 = "migration_advanced_permissions_phase_2"

	MIGRATION_KEY_EMOJI_PERMISSIONS_SPLIT                     = "emoji_permissions_split"
	MIGRATION_KEY_WEBHOOK_PERMISSIONS_SPLIT                   = "webhook_permissions_split"
	MIGRATION_KEY_LIST_JOIN_PUBLIC_PRIVATE_TEAMS              = "list_join_public_private_teams"
	MIGRATION_KEY_REMOVE_PERMANENT_DELETE_USER                = "remove_permanent_delete_user"
	MIGRATION_KEY_ADD_BOT_PERMISSIONS                         = "add_bot_permissions"
	MIGRATION_KEY_APPLY_CHANNEL_MANAGE_DELETE_TO_CHANNEL_USER = "apply_channel_manage_delete_to_channel_user"
	MIGRATION_KEY_REMOVE_CHANNEL_MANAGE_DELETE_FROM_TEAM_USER = "remove_channel_manage_delete_from_team_user"
	MIGRATION_KEY_VIEW_MEMBERS_NEW_PERMISSION                 = "view_members_new_permission"
	MIGRATION_KEY_ADD_MANAGE_GUESTS_PERMISSIONS               = "add_manage_guests_permissions"
	MIGRATION_KEY_CHANNEL_MODERATIONS_PERMISSIONS             = "channel_moderations_permissions"
	MIGRATION_KEY_ADD_USE_GROUP_MENTIONS_PERMISSION           = "add_use_group_mentions_permission"
	MIGRATION_KEY_ADD_SYSTEM_CONSOLE_PERMISSIONS              = "add_system_console_permissions"
	MIGRATION_KEY_SIDEBAR_CATEGORIES_PHASE_2                  = "migration_sidebar_categories_phase_2"
	MIGRATION_KEY_ADD_CONVERT_CHANNEL_PERMISSIONS             = "add_convert_channel_permissions"
)
View Source
const (
	OAUTH_ACTION_SIGNUP       = "signup"
	OAUTH_ACTION_LOGIN        = "login"
	OAUTH_ACTION_EMAIL_TO_SSO = "email_to_sso"
	OAUTH_ACTION_SSO_TO_EMAIL = "sso_to_email"
	OAUTH_ACTION_MOBILE       = "mobile"
)
View Source
const (
	PermissionScopeSystem  = "system_scope"
	PermissionScopeTeam    = "team_scope"
	PermissionScopeChannel = "channel_scope"
)
View Source
const (
	KEY_VALUE_PLUGIN_ID_MAX_RUNES = 190
	KEY_VALUE_KEY_MAX_RUNES       = 50
)
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 (
	POST_SYSTEM_MESSAGE_PREFIX  = "system_"
	POST_DEFAULT                = ""
	POST_SLACK_ATTACHMENT       = "slack_attachment"
	POST_SYSTEM_GENERIC         = "system_generic"
	POST_JOIN_LEAVE             = "system_join_leave" // Deprecated, use POST_JOIN_CHANNEL or POST_LEAVE_CHANNEL instead
	POST_JOIN_CHANNEL           = "system_join_channel"
	POST_GUEST_JOIN_CHANNEL     = "system_guest_join_channel"
	POST_LEAVE_CHANNEL          = "system_leave_channel"
	POST_JOIN_TEAM              = "system_join_team"
	POST_LEAVE_TEAM             = "system_leave_team"
	POST_AUTO_RESPONDER         = "system_auto_responder"
	POST_ADD_REMOVE             = "system_add_remove" // Deprecated, use POST_ADD_TO_CHANNEL or POST_REMOVE_FROM_CHANNEL instead
	POST_ADD_TO_CHANNEL         = "system_add_to_channel"
	POST_ADD_GUEST_TO_CHANNEL   = "system_add_guest_to_chan"
	POST_REMOVE_FROM_CHANNEL    = "system_remove_from_channel"
	POST_MOVE_CHANNEL           = "system_move_channel"
	POST_ADD_TO_TEAM            = "system_add_to_team"
	POST_REMOVE_FROM_TEAM       = "system_remove_from_team"
	POST_HEADER_CHANGE          = "system_header_change"
	POST_DISPLAYNAME_CHANGE     = "system_displayname_change"
	POST_CONVERT_CHANNEL        = "system_convert_channel"
	POST_PURPOSE_CHANGE         = "system_purpose_change"
	POST_CHANNEL_DELETED        = "system_channel_deleted"
	POST_CHANNEL_RESTORED       = "system_channel_restored"
	POST_EPHEMERAL              = "system_ephemeral"
	POST_CHANGE_CHANNEL_PRIVACY = "system_change_chan_privacy"
	POST_ADD_BOT_TEAMS_CHANNELS = "add_bot_teams_channels"
	POST_FILEIDS_MAX_RUNES      = 150
	POST_FILENAMES_MAX_RUNES    = 4000
	POST_HASHTAGS_MAX_RUNES     = 1000
	POST_MESSAGE_MAX_RUNES_V1   = 4000
	POST_MESSAGE_MAX_BYTES_V2   = 65535                         // Maximum size of a TEXT column in MySQL
	POST_MESSAGE_MAX_RUNES_V2   = POST_MESSAGE_MAX_BYTES_V2 / 4 // Assume a worst-case representation
	POST_PROPS_MAX_RUNES        = 8000
	POST_PROPS_MAX_USER_RUNES   = POST_PROPS_MAX_RUNES - 400 // Leave some room for system / pre-save modifications
	POST_CUSTOM_TYPE_PREFIX     = "custom_"
	POST_ME                     = "me"
	PROPS_ADD_CHANNEL_MEMBER    = "add_channel_member"

	POST_PROPS_ADDED_USER_ID       = "addedUserId"
	POST_PROPS_DELETE_BY           = "deleteBy"
	POST_PROPS_OVERRIDE_ICON_URL   = "override_icon_url"
	POST_PROPS_OVERRIDE_ICON_EMOJI = "override_icon_emoji"

	POST_PROPS_MENTION_HIGHLIGHT_DISABLED = "mentionHighlightDisabled"
	POST_PROPS_GROUP_HIGHLIGHT_DISABLED   = "disable_group_highlight"
	POST_SYSTEM_WARN_METRIC_STATUS        = "warn_metric_status"
)
View Source
const (
	PREFERENCE_CATEGORY_DIRECT_CHANNEL_SHOW = "direct_channel_show"
	PREFERENCE_CATEGORY_GROUP_CHANNEL_SHOW  = "group_channel_show"
	PREFERENCE_CATEGORY_TUTORIAL_STEPS      = "tutorial_step"
	PREFERENCE_CATEGORY_ADVANCED_SETTINGS   = "advanced_settings"
	PREFERENCE_CATEGORY_FLAGGED_POST        = "flagged_post"
	PREFERENCE_CATEGORY_FAVORITE_CHANNEL    = "favorite_channel"
	PREFERENCE_CATEGORY_SIDEBAR_SETTINGS    = "sidebar_settings"

	PREFERENCE_CATEGORY_DISPLAY_SETTINGS = "display_settings"
	PREFERENCE_NAME_CHANNEL_DISPLAY_MODE = "channel_display_mode"
	PREFERENCE_NAME_COLLAPSE_SETTING     = "collapse_previews"
	PREFERENCE_NAME_MESSAGE_DISPLAY      = "message_display"
	PREFERENCE_NAME_NAME_FORMAT          = "name_format"
	PREFERENCE_NAME_USE_MILITARY_TIME    = "use_military_time"

	PREFERENCE_CATEGORY_THEME = "theme"

	PREFERENCE_CATEGORY_AUTHORIZED_OAUTH_APP = "oauth_app"

	PREFERENCE_CATEGORY_LAST     = "last"
	PREFERENCE_NAME_LAST_CHANNEL = "channel"
	PREFERENCE_NAME_LAST_TEAM    = "team"

	PREFERENCE_CATEGORY_NOTIFICATIONS = "notifications"
	PREFERENCE_NAME_EMAIL_INTERVAL    = "email_interval"

	PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS = "30"  // the "immediate" setting is actually 30s
	PREFERENCE_EMAIL_INTERVAL_BATCHING_SECONDS    = "900" // fifteen minutes is 900 seconds
	PREFERENCE_EMAIL_INTERVAL_IMMEDIATELY         = "immediately"
	PREFERENCE_EMAIL_INTERVAL_FIFTEEN             = "fifteen"
	PREFERENCE_EMAIL_INTERVAL_FIFTEEN_AS_SECONDS  = "900"
	PREFERENCE_EMAIL_INTERVAL_HOUR                = "hour"
	PREFERENCE_EMAIL_INTERVAL_HOUR_AS_SECONDS     = "3600"
)
View Source
const (
	PUSH_NOTIFY_APPLE                = "apple"
	PUSH_NOTIFY_ANDROID              = "android"
	PUSH_NOTIFY_APPLE_REACT_NATIVE   = "apple_rn"
	PUSH_NOTIFY_ANDROID_REACT_NATIVE = "android_rn"

	PUSH_TYPE_MESSAGE      = "message"
	PUSH_TYPE_CLEAR        = "clear"
	PUSH_TYPE_UPDATE_BADGE = "update_badge"
	PUSH_TYPE_SESSION      = "session"
	PUSH_MESSAGE_V2        = "v2"

	PUSH_SOUND_NONE = "none"

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

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

	PUSH_SEND_PREPARE = "Prepared to send"
	PUSH_SEND_SUCCESS = "Successful"
	PUSH_NOT_SENT     = "Not Sent due to preferences"
	PUSH_RECEIVED     = "Received by device"
)
View Source
const (
	PUSH_STATUS           = "status"
	PUSH_STATUS_OK        = "OK"
	PUSH_STATUS_FAIL      = "FAIL"
	PUSH_STATUS_REMOVE    = "REMOVE"
	PUSH_STATUS_ERROR_MSG = "error"
)
View Source
const (
	SYSTEM_GUEST_ROLE_ID             = "system_guest"
	SYSTEM_USER_ROLE_ID              = "system_user"
	SYSTEM_ADMIN_ROLE_ID             = "system_admin"
	SYSTEM_POST_ALL_ROLE_ID          = "system_post_all"
	SYSTEM_POST_ALL_PUBLIC_ROLE_ID   = "system_post_all_public"
	SYSTEM_USER_ACCESS_TOKEN_ROLE_ID = "system_user_access_token"
	SYSTEM_USER_MANAGER_ROLE_ID      = "system_user_manager"
	SYSTEM_READ_ONLY_ADMIN_ROLE_ID   = "system_read_only_admin"
	SYSTEM_MANAGER_ROLE_ID           = "system_manager"

	TEAM_GUEST_ROLE_ID           = "team_guest"
	TEAM_USER_ROLE_ID            = "team_user"
	TEAM_ADMIN_ROLE_ID           = "team_admin"
	TEAM_POST_ALL_ROLE_ID        = "team_post_all"
	TEAM_POST_ALL_PUBLIC_ROLE_ID = "team_post_all_public"

	CHANNEL_GUEST_ROLE_ID = "channel_guest"
	CHANNEL_USER_ROLE_ID  = "channel_user"
	CHANNEL_ADMIN_ROLE_ID = "channel_admin"

	ROLE_NAME_MAX_LENGTH         = 64
	ROLE_DISPLAY_NAME_MAX_LENGTH = 128
	ROLE_DESCRIPTION_MAX_LENGTH  = 1024

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

	RoleTypeGuest RoleType = "Guest"
	RoleTypeUser  RoleType = "User"
	RoleTypeAdmin RoleType = "Admin"
)
View Source
const (
	USER_AUTH_SERVICE_SAML      = "saml"
	USER_AUTH_SERVICE_SAML_TEXT = "SAML"
	USER_AUTH_SERVICE_IS_SAML   = "isSaml"
	USER_AUTH_SERVICE_IS_MOBILE = "isMobile"
	USER_AUTH_SERVICE_IS_OAUTH  = "isOAuthUser"
)
View Source
const (
	SCHEME_DISPLAY_NAME_MAX_LENGTH = 128
	SCHEME_NAME_MAX_LENGTH         = 64
	SCHEME_DESCRIPTION_MAX_LENGTH  = 1024
	SCHEME_SCOPE_TEAM              = "team"
	SCHEME_SCOPE_CHANNEL           = "channel"
)
View Source
const (
	SESSION_COOKIE_TOKEN              = "MMAUTHTOKEN"
	SESSION_COOKIE_USER               = "MMUSERID"
	SESSION_COOKIE_CSRF               = "MMCSRF"
	SESSION_CACHE_SIZE                = 35000
	SESSION_PROP_PLATFORM             = "platform"
	SESSION_PROP_OS                   = "os"
	SESSION_PROP_BROWSER              = "browser"
	SESSION_PROP_TYPE                 = "type"
	SESSION_PROP_USER_ACCESS_TOKEN_ID = "user_access_token_id"
	SESSION_PROP_IS_BOT               = "is_bot"
	SESSION_PROP_IS_BOT_VALUE         = "true"
	SESSION_TYPE_USER_ACCESS_TOKEN    = "UserAccessToken"
	SESSION_PROP_IS_GUEST             = "is_guest"
	SESSION_ACTIVITY_TIMEOUT          = 1000 * 60 * 5 // 5 minutes
	SESSION_USER_ACCESS_TOKEN_EXPIRY  = 100 * 365     // 100 years
)
View Source
const (
	STATUS_OUT_OF_OFFICE   = "ooo"
	STATUS_OFFLINE         = "offline"
	STATUS_AWAY            = "away"
	STATUS_DND             = "dnd"
	STATUS_ONLINE          = "online"
	STATUS_CACHE_SIZE      = SESSION_CACHE_SIZE
	STATUS_CHANNEL_TIMEOUT = 20000  // 20 seconds
	STATUS_MIN_UPDATE_TIME = 120000 // 2 minutes
)
View Source
const (
	SYSTEM_TELEMETRY_ID                           = "DiagnosticId"
	SYSTEM_RAN_UNIT_TESTS                         = "RanUnitTests"
	SYSTEM_LAST_SECURITY_TIME                     = "LastSecurityTime"
	SYSTEM_ACTIVE_LICENSE_ID                      = "ActiveLicenseId"
	SYSTEM_LAST_COMPLIANCE_TIME                   = "LastComplianceTime"
	SYSTEM_ASYMMETRIC_SIGNING_KEY                 = "AsymmetricSigningKey"
	SYSTEM_POST_ACTION_COOKIE_SECRET              = "PostActionCookieSecret"
	SYSTEM_INSTALLATION_DATE_KEY                  = "InstallationDate"
	SYSTEM_FIRST_SERVER_RUN_TIMESTAMP_KEY         = "FirstServerRunTimestamp"
	SYSTEM_CLUSTER_ENCRYPTION_KEY                 = "ClusterEncryptionKey"
	SYSTEM_UPGRADED_FROM_TE_ID                    = "UpgradedFromTE"
	SYSTEM_WARN_METRIC_NUMBER_OF_TEAMS_5          = "warn_metric_number_of_teams_5"
	SYSTEM_WARN_METRIC_NUMBER_OF_CHANNELS_50      = "warn_metric_number_of_channels_50"
	SYSTEM_WARN_METRIC_MFA                        = "warn_metric_mfa"
	SYSTEM_WARN_METRIC_EMAIL_DOMAIN               = "warn_metric_email_domain"
	SYSTEM_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_100 = "warn_metric_number_of_active_users_100"
	SYSTEM_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_200 = "warn_metric_number_of_active_users_200"
	SYSTEM_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_300 = "warn_metric_number_of_active_users_300"
	SYSTEM_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_500 = "warn_metric_number_of_active_users_500"
	SYSTEM_WARN_METRIC_NUMBER_OF_POSTS_2M         = "warn_metric_number_of_posts_2M"
	SYSTEM_WARN_METRIC_LAST_RUN_TIMESTAMP_KEY     = "LastWarnMetricRunTimestamp"
)
View Source
const (
	WARN_METRIC_STATUS_LIMIT_REACHED      = "true"
	WARN_METRIC_STATUS_RUNONCE            = "runonce"
	WARN_METRIC_STATUS_ACK                = "ack"
	WARN_METRIC_STATUS_STORE_PREFIX       = "warn_metric_"
	WARN_METRIC_JOB_INTERVAL              = 24 * 7
	WARN_METRIC_NUMBER_OF_ACTIVE_USERS_25 = 25
	WARN_METRIC_JOB_WAIT_TIME             = 1000 * 3600 * 24 * 7 // 7 days
)
View Source
const (
	TEAM_OPEN                       = "O"
	TEAM_INVITE                     = "I"
	TEAM_ALLOWED_DOMAINS_MAX_LENGTH = 500
	TEAM_COMPANY_NAME_MAX_LENGTH    = 64
	TEAM_DESCRIPTION_MAX_LENGTH     = 255
	TEAM_DISPLAY_NAME_MAX_RUNES     = 64
	TEAM_EMAIL_MAX_LENGTH           = 128
	TEAM_NAME_MAX_LENGTH            = 64
	TEAM_NAME_MIN_LENGTH            = 2
)
View Source
const (
	TOKEN_SIZE            = 64
	MAX_TOKEN_EXIPRY_TIME = 1000 * 60 * 60 * 48 // 48 hour
	TOKEN_TYPE_OAUTH      = "oauth"
)
View Source
const (
	ME                                 = "me"
	USER_NOTIFY_ALL                    = "all"
	USER_NOTIFY_HERE                   = "here"
	USER_NOTIFY_MENTION                = "mention"
	USER_NOTIFY_NONE                   = "none"
	DESKTOP_NOTIFY_PROP                = "desktop"
	DESKTOP_SOUND_NOTIFY_PROP          = "desktop_sound"
	MARK_UNREAD_NOTIFY_PROP            = "mark_unread"
	PUSH_NOTIFY_PROP                   = "push"
	PUSH_STATUS_NOTIFY_PROP            = "push_status"
	EMAIL_NOTIFY_PROP                  = "email"
	CHANNEL_MENTIONS_NOTIFY_PROP       = "channel"
	COMMENTS_NOTIFY_PROP               = "comments"
	MENTION_KEYS_NOTIFY_PROP           = "mention_keys"
	COMMENTS_NOTIFY_NEVER              = "never"
	COMMENTS_NOTIFY_ROOT               = "root"
	COMMENTS_NOTIFY_ANY                = "any"
	FIRST_NAME_NOTIFY_PROP             = "first_name"
	AUTO_RESPONDER_ACTIVE_NOTIFY_PROP  = "auto_responder_active"
	AUTO_RESPONDER_MESSAGE_NOTIFY_PROP = "auto_responder_message"

	DEFAULT_LOCALE          = "en"
	USER_AUTH_SERVICE_EMAIL = "email"

	USER_EMAIL_MAX_LENGTH     = 128
	USER_NICKNAME_MAX_RUNES   = 64
	USER_POSITION_MAX_RUNES   = 128
	USER_FIRST_NAME_MAX_RUNES = 64
	USER_LAST_NAME_MAX_RUNES  = 64
	USER_AUTH_DATA_MAX_LENGTH = 128
	USER_NAME_MAX_LENGTH      = 64
	USER_NAME_MIN_LENGTH      = 1
	USER_PASSWORD_MAX_LENGTH  = 72
	USER_LOCALE_MAX_LENGTH    = 5
)
View Source
const (
	LOWERCASE_LETTERS = "abcdefghijklmnopqrstuvwxyz"
	UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	NUMBERS           = "0123456789"
	SYMBOLS           = " !\"\\#$%&'()*+,-./:;<=>?@[]^_`|~"
)
View Source
const (
	SOCKET_MAX_MESSAGE_SIZE_KB  = 8 * 1024 // 8KB
	PING_TIMEOUT_BUFFER_SECONDS = 5
)
View Source
const (
	WEBSOCKET_EVENT_TYPING                                   = "typing"
	WEBSOCKET_EVENT_POSTED                                   = "posted"
	WEBSOCKET_EVENT_POST_EDITED                              = "post_edited"
	WEBSOCKET_EVENT_POST_DELETED                             = "post_deleted"
	WEBSOCKET_EVENT_POST_UNREAD                              = "post_unread"
	WEBSOCKET_EVENT_CHANNEL_CONVERTED                        = "channel_converted"
	WEBSOCKET_EVENT_CHANNEL_CREATED                          = "channel_created"
	WEBSOCKET_EVENT_CHANNEL_DELETED                          = "channel_deleted"
	WEBSOCKET_EVENT_CHANNEL_RESTORED                         = "channel_restored"
	WEBSOCKET_EVENT_CHANNEL_UPDATED                          = "channel_updated"
	WEBSOCKET_EVENT_CHANNEL_MEMBER_UPDATED                   = "channel_member_updated"
	WEBSOCKET_EVENT_CHANNEL_SCHEME_UPDATED                   = "channel_scheme_updated"
	WEBSOCKET_EVENT_DIRECT_ADDED                             = "direct_added"
	WEBSOCKET_EVENT_GROUP_ADDED                              = "group_added"
	WEBSOCKET_EVENT_NEW_USER                                 = "new_user"
	WEBSOCKET_EVENT_ADDED_TO_TEAM                            = "added_to_team"
	WEBSOCKET_EVENT_LEAVE_TEAM                               = "leave_team"
	WEBSOCKET_EVENT_UPDATE_TEAM                              = "update_team"
	WEBSOCKET_EVENT_DELETE_TEAM                              = "delete_team"
	WEBSOCKET_EVENT_RESTORE_TEAM                             = "restore_team"
	WEBSOCKET_EVENT_UPDATE_TEAM_SCHEME                       = "update_team_scheme"
	WEBSOCKET_EVENT_USER_ADDED                               = "user_added"
	WEBSOCKET_EVENT_USER_UPDATED                             = "user_updated"
	WEBSOCKET_EVENT_USER_ROLE_UPDATED                        = "user_role_updated"
	WEBSOCKET_EVENT_MEMBERROLE_UPDATED                       = "memberrole_updated"
	WEBSOCKET_EVENT_USER_REMOVED                             = "user_removed"
	WEBSOCKET_EVENT_PREFERENCE_CHANGED                       = "preference_changed"
	WEBSOCKET_EVENT_PREFERENCES_CHANGED                      = "preferences_changed"
	WEBSOCKET_EVENT_PREFERENCES_DELETED                      = "preferences_deleted"
	WEBSOCKET_EVENT_EPHEMERAL_MESSAGE                        = "ephemeral_message"
	WEBSOCKET_EVENT_STATUS_CHANGE                            = "status_change"
	WEBSOCKET_EVENT_HELLO                                    = "hello"
	WEBSOCKET_AUTHENTICATION_CHALLENGE                       = "authentication_challenge"
	WEBSOCKET_EVENT_REACTION_ADDED                           = "reaction_added"
	WEBSOCKET_EVENT_REACTION_REMOVED                         = "reaction_removed"
	WEBSOCKET_EVENT_RESPONSE                                 = "response"
	WEBSOCKET_EVENT_EMOJI_ADDED                              = "emoji_added"
	WEBSOCKET_EVENT_CHANNEL_VIEWED                           = "channel_viewed"
	WEBSOCKET_EVENT_PLUGIN_STATUSES_CHANGED                  = "plugin_statuses_changed"
	WEBSOCKET_EVENT_PLUGIN_ENABLED                           = "plugin_enabled"
	WEBSOCKET_EVENT_PLUGIN_DISABLED                          = "plugin_disabled"
	WEBSOCKET_EVENT_ROLE_UPDATED                             = "role_updated"
	WEBSOCKET_EVENT_LICENSE_CHANGED                          = "license_changed"
	WEBSOCKET_EVENT_CONFIG_CHANGED                           = "config_changed"
	WEBSOCKET_EVENT_OPEN_DIALOG                              = "open_dialog"
	WEBSOCKET_EVENT_GUESTS_DEACTIVATED                       = "guests_deactivated"
	WEBSOCKET_EVENT_RECEIVED_GROUP                           = "received_group"
	WEBSOCKET_EVENT_RECEIVED_GROUP_ASSOCIATED_TO_TEAM        = "received_group_associated_to_team"
	WEBSOCKET_EVENT_RECEIVED_GROUP_NOT_ASSOCIATED_TO_TEAM    = "received_group_not_associated_to_team"
	WEBSOCKET_EVENT_RECEIVED_GROUP_ASSOCIATED_TO_CHANNEL     = "received_group_associated_to_channel"
	WEBSOCKET_EVENT_RECEIVED_GROUP_NOT_ASSOCIATED_TO_CHANNEL = "received_group_not_associated_to_channel"
	WEBSOCKET_EVENT_SIDEBAR_CATEGORY_CREATED                 = "sidebar_category_created"
	WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED                 = "sidebar_category_updated"
	WEBSOCKET_EVENT_SIDEBAR_CATEGORY_DELETED                 = "sidebar_category_deleted"
	WEBSOCKET_EVENT_SIDEBAR_CATEGORY_ORDER_UPDATED           = "sidebar_category_order_updated"
	WEBSOCKET_WARN_METRIC_STATUS_RECEIVED                    = "warn_metric_status_received"
	WEBSOCKET_WARN_METRIC_STATUS_REMOVED                     = "warn_metric_status_removed"
)
View Source
const CHANNEL_SEARCH_DEFAULT_LIMIT = 50
View Source
const (
	COMMAND_WEBHOOK_LIFETIME = 1000 * 60 * 30
)
View Source
const ConfigAccessTagWriteRestrictable = "write_restrictable"
View Source
const (
	DEFAULT_WEBHOOK_USERNAME = "webhook"
)
View Source
const (
	MaxImageSize = int64(6048 * 4032) // 24 megapixels, roughly 36MB as a raw image
)
View Source
const OUTGOING_HOOK_RESPONSE_TYPE_COMMENT = "comment"
View Source
const TERMS_OF_SERVICE_CACHE_SIZE = 1
View Source
const (
	USERNAME = "Username"
)
View Source
const (
	USER_AUTH_SERVICE_GITLAB = "gitlab"
)
View Source
const USER_SEARCH_DEFAULT_LIMIT = 100
View Source
const USER_SEARCH_MAX_LIMIT = 1000

Variables

View Source
var (
	IMAGE_EXTENSIONS = [7]string{".jpg", ".jpeg", ".gif", ".bmp", ".png", ".tiff", "tif"}
	IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff", ".tif": "image/tif"}
)
View Source
var AT_MENTION_PATTEN = regexp.MustCompile(`\B@`)
View Source
var AllPermissions []*Permission
View Source
var BotDefaultImage = []byte{}/* 3372 elements not displayed */
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 string = versions[0]
View Source
var DeprecatedPermissions []*Permission
View Source
var EMOJI_PATTERN = regexp.MustCompile(`:[a-zA-Z0-9_-]+:`)
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 SystemEmojis = map[string]string{} /* 2383 elements not displayed */
View Source
var SystemManagerDefaultPermissions []string
View Source
var SystemReadOnlyAdminDefaultPermissions []string
View Source
var SystemUserManagerDefaultPermissions []string

Functions

func AppErrorInit

func AppErrorInit(t goi18n.TranslateFunc)

func ArrayFromInterface

func ArrayFromInterface(data interface{}) []string

func ArrayFromJson

func ArrayFromJson(data io.Reader) []string

func ArrayToJson

func ArrayToJson(objmap []string) string

func AsStringBoolMap added in v5.22.0

func AsStringBoolMap(list []string) map[string]bool

func AuditModelTypeConv added in v5.24.0

func AuditModelTypeConv(val interface{}) (newVal interface{}, converted bool)

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

func AutocompleteStaticListItemsToJSON added in v5.24.0

func AutocompleteStaticListItemsToJSON(items []AutocompleteListItem) []byte

AutocompleteStaticListItemsToJSON returns json for a list of AutocompleteStaticListItem objects

func AutocompleteSuggestionsToJSON added in v5.24.0

func AutocompleteSuggestionsToJSON(suggestions []AutocompleteSuggestion) []byte

AutocompleteSuggestionsToJSON returns json for a list of AutocompleteSuggestion objects

func ChannelMentions

func ChannelMentions(message string) []string

func ChannelModeratedPermissionsChangedByPatch added in v5.22.0

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

func CheckStatusOK

func CheckStatusOK(r *http.Response) bool

CheckStatusOK is a convenience function for checking the standard OK response from the web service.

func CleanRoleNames added in v5.26.0

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

func CleanTeamName

func CleanTeamName(s string) string

func CleanUsername

func CleanUsername(s string) string

func ClearMentionTags

func ClearMentionTags(post string) string

func ClusterInfosToJson

func ClusterInfosToJson(objmap []*ClusterInfo) string

func CommandListToJson

func CommandListToJson(l []*Command) string

func ComparePassword

func ComparePassword(hash string, password string) bool

ComparePassword compares the hash

func CompliancePostHeader

func CompliancePostHeader() []string

func CopyStringMap

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

func DecryptPostActionCookie

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

func EmailInviteWithErrorToEmails added in v5.20.0

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

func EmailInviteWithErrorToJson added in v5.20.0

func EmailInviteWithErrorToJson(o []*EmailInviteWithError) string

func EmailInviteWithErrorToString added in v5.22.0

func EmailInviteWithErrorToString(o *EmailInviteWithError) string

func EmojiListToJson

func EmojiListToJson(emojiList []*Emoji) string

func Etag

func Etag(parts ...interface{}) string

func FileInfosToJson

func FileInfosToJson(infos []*FileInfo) 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 GeneratePassword

func GeneratePassword(minimumLength int) string

func GetDMNameFromIds

func GetDMNameFromIds(userId1, userId2 string) string

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 GetImageMimeType

func GetImageMimeType(ext string) string

func GetInfoForBytes

func GetInfoForBytes(name string, data io.ReadSeeker, size int) (*FileInfo, *AppError)

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 GetServerIpAddress

func GetServerIpAddress(iface string) string

func GetStartOfDayMillis

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

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

func GetSystemEmojiId

func GetSystemEmojiId(emojiName string) (string, bool)

func HashPassword

func HashPassword(password string) string

HashPassword generates a hash using the bcrypt.GenerateFromPassword

func IncomingWebhookListToJson

func IncomingWebhookListToJson(l []*IncomingWebhook) string

func IncomingWebhookRequestFromJson

func IncomingWebhookRequestFromJson(data io.Reader) (*IncomingWebhookRequest, *AppError)

func IsBotDMChannel

func IsBotDMChannel(channel *Channel, botUserID string) bool

func IsChannelMarkUnreadLevelValid

func IsChannelMarkUnreadLevelValid(markUnreadLevel string) bool

func IsChannelNotifyLevelValid

func IsChannelNotifyLevelValid(notifyLevel string) bool

func IsCurrentVersion

func IsCurrentVersion(versionToCheck string) bool

func IsFileExtImage

func IsFileExtImage(ext string) bool

func IsIgnoreChannelMentionsValid

func IsIgnoreChannelMentionsValid(ignoreChannelMentions string) bool

func IsInRole

func IsInRole(userRoles string, inRole string) bool

Make sure you acually want to use this function. In context.go there are functions to check permissions This function should not be used to check permissions.

func IsLower

func IsLower(s string) bool

func IsPreviousVersionsSupported

func IsPreviousVersionsSupported(versionToCheck string) bool

func IsReservedTeamName

func IsReservedTeamName(s string) bool
func IsSafeLink(link *string) bool

func IsSamlFile

func IsSamlFile(saml *SamlSettings, filename string) bool

IsSamlFile checks if filename is a SAML file.

func IsSendEmailValid

func IsSendEmailValid(sendEmail string) bool

func IsValidAlphaNum

func IsValidAlphaNum(s string) bool

func IsValidAlphaNumHyphenUnderscore

func IsValidAlphaNumHyphenUnderscore(s string, withFormat bool) bool

func IsValidCategoryId added in v5.29.0

func IsValidCategoryId(s string) bool

func IsValidChannelIdentifier

func IsValidChannelIdentifier(s string) bool

func IsValidCommentsNotifyLevel

func IsValidCommentsNotifyLevel(notifyLevel string) bool

func IsValidEmail

func IsValidEmail(email string) bool

func IsValidEmailBatchingInterval

func IsValidEmailBatchingInterval(emailInterval string) bool

func IsValidHttpUrl

func IsValidHttpUrl(rawUrl string) bool

func IsValidId

func IsValidId(value string) bool

func IsValidLocale

func IsValidLocale(locale string) bool

func IsValidNumberString

func IsValidNumberString(value string) bool

func IsValidPluginId added in v5.22.0

func IsValidPluginId(id string) bool

IsValidPluginId verifies that the plugin id has a minimum length of 3, maximum length of 190, and contains only alphanumeric characters, dashes, underscores and periods.

These constraints are necessary since the plugin id is used as part of a filesystem path.

func IsValidPushStatusNotifyLevel

func IsValidPushStatusNotifyLevel(notifyLevel string) bool

func IsValidRoleName

func IsValidRoleName(roleName string) bool

func IsValidSchemeName

func IsValidSchemeName(name string) bool

func IsValidTeamName

func IsValidTeamName(s string) bool

func IsValidTrueOrFalseString

func IsValidTrueOrFalseString(value string) bool

func IsValidTurnOrStunServer

func IsValidTurnOrStunServer(rawUri string) bool

func IsValidUserNotifyLevel

func IsValidUserNotifyLevel(notifyLevel string) bool

func IsValidUserRoles

func IsValidUserRoles(userRoles string) bool

func IsValidUsername

func IsValidUsername(s string) bool

func IsValidWebsocketUrl

func IsValidWebsocketUrl(rawUrl string) bool

func JobsToJson

func JobsToJson(jobs []*Job) string

func MakeDefaultRoles

func MakeDefaultRoles() map[string]*Role

func ManifestListToJson

func ManifestListToJson(m []*Manifest) string

func MapBoolFromJson

func MapBoolFromJson(data io.Reader) map[string]bool

MapFromJson will decode the key/value pair map

func MapBoolToJson

func MapBoolToJson(objmap map[string]bool) string

MapBoolToJson converts a map to a json string

func MapFromJson

func MapFromJson(data io.Reader) map[string]string

MapFromJson will decode the key/value pair map

func MapPostIdToReactionsFromJson

func MapPostIdToReactionsFromJson(data io.Reader) map[string][]*Reaction

func MapPostIdToReactionsToJson

func MapPostIdToReactionsToJson(o map[string][]*Reaction) string

func MapToJson

func MapToJson(objmap map[string]string) string

MapToJson converts a map to a json string

func MapWarnMetricStatusToJson added in v5.26.0

func MapWarnMetricStatusToJson(o map[string]*WarnMetricStatus) string

func NewBool

func NewBool(b bool) *bool

func NewId

func NewId() string

NewId is a globally unique identifier. It is a [A-Z0-9] string 26 characters long. It is a UUID version 4 Guid that is zbased32 encoded with the padding stripped off.

func NewInt

func NewInt(n int) *int

func NewInt64

func NewInt64(n int64) *int64

func NewPluginKeyValueFromOptions

func NewPluginKeyValueFromOptions(pluginId, key string, value []byte, opt PluginKVSetOptions) (*PluginKeyValue, *AppError)

NewPluginKeyValueFromOptions return a PluginKeyValue given a pluginID, a KV pair and options.

func NewRandomBase32String added in v5.23.0

func NewRandomBase32String(size int) string

NewRandomBase32String returns a base32 encoded string of a random slice of bytes of the given size. The resulting entropy will be (8 * size) bits.

func NewRandomString

func NewRandomString(length int) string

NewRandomString returns a random string of the given length. The resulting entropy will be (5 * length) bits.

func NewRandomTeamName

func NewRandomTeamName() string

NewRandomTeamName is a NewId that will be a valid team name.

func NewString

func NewString(s string) *string

func NewWebSocketClient

func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError)

NewWebSocketClient constructs a new WebSocket client with convenience methods for talking to the server.

func NewWebSocketClient4

func NewWebSocketClient4(url, authToken string) (*WebSocketClient, *AppError)

NewWebSocketClient4 constructs a new WebSocket client with convenience methods for talking to the server. Uses the v4 endpoint.

func NewWebSocketClient4WithDialer

func NewWebSocketClient4WithDialer(dialer *websocket.Dialer, url, authToken string) (*WebSocketClient, *AppError)

NewWebSocketClient4WithDialer constructs a new WebSocket client with convenience methods for talking to the server using a custom dialer. Uses the v4 endpoint.

func NewWebSocketClientWithDialer

func NewWebSocketClientWithDialer(dialer *websocket.Dialer, url, authToken string) (*WebSocketClient, *AppError)

NewWebSocketClientWithDialer constructs a new WebSocket client with convenience methods for talking to the server using a custom dialer.

func NormalizeEmail

func NormalizeEmail(email string) string

func NormalizeUsername

func NormalizeUsername(username string) string

func OAuthAppListToJson

func OAuthAppListToJson(l []*OAuthApp) string

func OutgoingWebhookListToJson

func OutgoingWebhookListToJson(l []*OutgoingWebhook) string

func PadDateStringZeros

func PadDateStringZeros(dateString string) string

PadDateStringZeros is a convenience method to pad 2 digit date parts with zeros to meet ISO 8601 format

func ParseHashtags

func ParseHashtags(text string) (string, string)

func ParseSlackAttachment

func ParseSlackAttachment(post *Post, attachments []*SlackAttachment)

This method only parses and processes the attachments, all else should be set in the post which is passed

func ParseSlackLinksToMarkdown

func ParseSlackLinksToMarkdown(text string) string

func PermissionsChangedByPatch

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

Returns an array of permissions that are in either role.Permissions or patch.Permissions, but not both.

func PossibleAtMentions added in v5.22.0

func PossibleAtMentions(message string) []string

PossibleAtMentions returns all substrings in message that look like valid @ mentions.

func ReactionsToJson

func ReactionsToJson(o []*Reaction) string

func RemoveDuplicateStrings

func RemoveDuplicateStrings(in []string) []string

func RewriteImageURLs

func RewriteImageURLs(message string, f func(string) string) string

RewriteImageURLs takes a message and returns a copy that has all of the image URLs replaced according to the function f. For each image URL, f will be invoked, and the resulting markdown will contain the URL returned by that invocation instead.

Image URLs are destination URLs used in inline images or reference definitions that are used anywhere in the input markdown as an image.

func RoleListToJson

func RoleListToJson(r []*Role) string

func SanitizeUnicode added in v5.24.0

func SanitizeUnicode(s string) string

SanitizeUnicode will remove undesirable Unicode characters from a string.

func SchemeIDFromJson

func SchemeIDFromJson(data io.Reader) *string

func SchemesToJson

func SchemesToJson(schemes []*Scheme) string

func SessionsToJson

func SessionsToJson(o []*Session) string

func SidebarCategoriesWithChannelsToJson added in v5.26.0

func SidebarCategoriesWithChannelsToJson(o []*SidebarCategoryWithChannels) []byte

func SplitVersion

func SplitVersion(version string) (int64, int64, int64)

func StatusListToJson

func StatusListToJson(u []*Status) string

func StatusMapToInterfaceMap

func StatusMapToInterfaceMap(statusMap map[string]*Status) map[string]interface{}

func StringFromJson

func StringFromJson(data io.Reader) string

func StringInterfaceFromJson

func StringInterfaceFromJson(data io.Reader) map[string]interface{}

func StringInterfaceToJson

func StringInterfaceToJson(objmap map[string]interface{}) string

func StringToJson

func StringToJson(s string) string

func TeamListToJson

func TeamListToJson(t []*Team) string

func TeamMapFromJson

func TeamMapFromJson(data io.Reader) map[string]*Team

func TeamMapToJson

func TeamMapToJson(u map[string]*Team) string

func TeamMemberWithErrorToString added in v5.22.0

func TeamMemberWithErrorToString(o *TeamMemberWithError) string

func TeamMembersToJson

func TeamMembersToJson(o []*TeamMember) string

func TeamMembersWithErrorToJson added in v5.20.0

func TeamMembersWithErrorToJson(o []*TeamMemberWithError) string

func TeamsUnreadToJson

func TeamsUnreadToJson(o []*TeamUnread) string

func TeamsWithCountToJson

func TeamsWithCountToJson(tlc *TeamsWithCount) []byte

func TrimUsernameSpecialChar added in v5.22.0

func TrimUsernameSpecialChar(word string) (string, bool)

TrimUsernameSpecialChar tries to remove the last character from word if it is a special character for usernames (dot, dash or underscore). If not, it returns the same string.

func TruncateOpenGraph

func TruncateOpenGraph(ogdata *opengraph.OpenGraph) *opengraph.OpenGraph

TruncateOpenGraph ensure OpenGraph metadata doesn't grow too big by shortening strings, trimming fields and reducing the number of images.

func UploadSessionsToJson added in v5.28.0

func UploadSessionsToJson(uss []*UploadSession) string

UploadSessionsToJson serializes a list of UploadSession into JSON and returns it as string.

func UserAccessTokenListToJson

func UserAccessTokenListToJson(t []*UserAccessToken) string

func UserListToJson

func UserListToJson(u []*User) string

func UserMapFromJson

func UserMapFromJson(data io.Reader) map[string]*User

func UserMapToJson

func UserMapToJson(u map[string]*User) string

Types

type AccessData

type AccessData struct {
	ClientId     string `json:"client_id"`
	UserId       string `json:"user_id"`
	Token        string `json:"token"`
	RefreshToken string `json:"refresh_token"`
	RedirectUri  string `json:"redirect_uri"`
	ExpiresAt    int64  `json:"expires_at"`
	Scope        string `json:"scope"`
}

func AccessDataFromJson

func AccessDataFromJson(data io.Reader) *AccessData

func (*AccessData) IsExpired

func (ad *AccessData) IsExpired() bool

func (*AccessData) IsValid

func (ad *AccessData) IsValid() *AppError

IsValid validates the AccessData and returns an error if it isn't configured correctly.

func (*AccessData) ToJson

func (ad *AccessData) ToJson() string

type AccessResponse

type AccessResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int32  `json:"expires_in"`
	Scope        string `json:"scope"`
	RefreshToken string `json:"refresh_token"`
}

func AccessResponseFromJson

func AccessResponseFromJson(data io.Reader) *AccessResponse

func (*AccessResponse) ToJson

func (ar *AccessResponse) ToJson() string

type AnalyticsPostCountsOptions

type AnalyticsPostCountsOptions struct {
	TeamId        string
	BotsOnly      bool
	YesterdayOnly bool
}

type AnalyticsRow

type AnalyticsRow struct {
	Name  string  `json:"name"`
	Value float64 `json:"value"`
}

func AnalyticsRowFromJson

func AnalyticsRowFromJson(data io.Reader) *AnalyticsRow

func (*AnalyticsRow) ToJson

func (me *AnalyticsRow) ToJson() string

type AnalyticsRows

type AnalyticsRows []*AnalyticsRow

func AnalyticsRowsFromJson

func AnalyticsRowsFromJson(data io.Reader) AnalyticsRows

func (AnalyticsRows) ToJson

func (me AnalyticsRows) ToJson() string

type AnalyticsSettings

type AnalyticsSettings struct {
	MaxUsersForStatistics *int `access:"write_restrictable"`
}

func (*AnalyticsSettings) SetDefaults

func (s *AnalyticsSettings) SetDefaults()

type AnnouncementSettings

type AnnouncementSettings struct {
	EnableBanner          *bool   `access:"site"`
	BannerText            *string `access:"site"`
	BannerColor           *string `access:"site"`
	BannerTextColor       *string `access:"site"`
	AllowBannerDismissal  *bool   `access:"site"`
	AdminNoticesEnabled   *bool   `access:"site"`
	UserNoticesEnabled    *bool   `access:"site"`
	NoticesURL            *string `access:"site,write_restrictable"`
	NoticesFetchFrequency *int    `access:"site,write_restrictable"`
	NoticesSkipCache      *bool   `access:"site,write_restrictable"`
}

func (*AnnouncementSettings) SetDefaults

func (s *AnnouncementSettings) SetDefaults()

type AppError

type AppError struct {
	Id            string `json:"id"`
	Message       string `json:"message"`               // Message to be display to the end user without debugging information
	DetailedError string `json:"detailed_error"`        // Internal error string to help the developer
	RequestId     string `json:"request_id,omitempty"`  // The RequestId that's also set in the header
	StatusCode    int    `json:"status_code,omitempty"` // The http status code
	Where         string `json:"-"`                     // The function where it happened in the form of Struct.Func
	IsOAuth       bool   `json:"is_oauth,omitempty"`    // Whether the error is OAuth specific
	// contains filtered or unexported fields
}

func AppErrorFromJson

func AppErrorFromJson(data io.Reader) *AppError

AppErrorFromJson will decode the input and return an AppError

func DecodeAndVerifyTriggerId

func DecodeAndVerifyTriggerId(triggerId string, s *ecdsa.PrivateKey) (string, string, *AppError)

func GenerateTriggerId

func GenerateTriggerId(userId string, s crypto.Signer) (string, string, *AppError)

func InvalidTermsOfServiceError

func InvalidTermsOfServiceError(fieldName string, termsOfServiceId string) *AppError

func InvalidUserError

func InvalidUserError(fieldName string, userId string) *AppError

func InvalidUserTermsOfServiceError

func InvalidUserTermsOfServiceError(fieldName string, userTermsOfServiceId string) *AppError

func IsSearchParamsListValid added in v5.28.0

func IsSearchParamsListValid(paramsList []*SearchParams) *AppError

func IsValidEmojiName

func IsValidEmojiName(name string) *AppError

func MakeBotNotFoundError

func MakeBotNotFoundError(userId string) *AppError

MakeBotNotFoundError creates the error returned when a bot does not exist, or when the user isn't allowed to query the bot. The errors must the same in both cases to avoid leaking that a user is a bot.

func NewAppError

func NewAppError(where string, id string, params map[string]interface{}, details string, status int) *AppError

func (*AppError) Error

func (er *AppError) Error() string

func (*AppError) SystemMessage

func (er *AppError) SystemMessage(T goi18n.TranslateFunc) string

func (*AppError) ToJson

func (er *AppError) ToJson() string

func (*AppError) Translate

func (er *AppError) Translate(T goi18n.TranslateFunc)

type Attribute added in v5.20.0

type Attribute struct {
	XMLName      xml.Name
	FriendlyName string           `xml:",attr"`
	Name         string           `xml:",attr"`
	NameFormat   string           `xml:",attr"`
	Values       []AttributeValue `xml:"AttributeValue"`
}

type AttributeValue added in v5.20.0

type AttributeValue struct {
	Type   string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Value  string `xml:",chardata"`
	NameID *NameID
}

type Audit

type Audit struct {
	Id        string `json:"id"`
	CreateAt  int64  `json:"create_at"`
	UserId    string `json:"user_id"`
	Action    string `json:"action"`
	ExtraInfo string `json:"extra_info"`
	IpAddress string `json:"ip_address"`
	SessionId string `json:"session_id"`
}

func AuditFromJson

func AuditFromJson(data io.Reader) *Audit

func (*Audit) ToJson

func (o *Audit) ToJson() string

type Audits

type Audits []Audit

func AuditsFromJson

func AuditsFromJson(data io.Reader) Audits

func (Audits) Etag

func (o Audits) Etag() string

func (Audits) ToJson

func (o Audits) ToJson() string

type AuthData

type AuthData struct {
	ClientId    string `json:"client_id"`
	UserId      string `json:"user_id"`
	Code        string `json:"code"`
	ExpiresIn   int32  `json:"expires_in"`
	CreateAt    int64  `json:"create_at"`
	RedirectUri string `json:"redirect_uri"`
	State       string `json:"state"`
	Scope       string `json:"scope"`
}

func AuthDataFromJson

func AuthDataFromJson(data io.Reader) *AuthData

func (*AuthData) IsExpired

func (ad *AuthData) IsExpired() bool

func (*AuthData) IsValid

func (ad *AuthData) IsValid() *AppError

IsValid validates the AuthData and returns an error if it isn't configured correctly.

func (*AuthData) PreSave

func (ad *AuthData) PreSave()

func (*AuthData) ToJson

func (ad *AuthData) ToJson() string

type AuthorizeRequest

type AuthorizeRequest struct {
	ResponseType string `json:"response_type"`
	ClientId     string `json:"client_id"`
	RedirectUri  string `json:"redirect_uri"`
	Scope        string `json:"scope"`
	State        string `json:"state"`
}

func AuthorizeRequestFromJson

func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest

func (*AuthorizeRequest) IsValid

func (ar *AuthorizeRequest) IsValid() *AppError

IsValid validates the AuthorizeRequest and returns an error if it isn't configured correctly.

func (*AuthorizeRequest) ToJson

func (ar *AuthorizeRequest) ToJson() string

type AutocompleteArg added in v5.24.0

type AutocompleteArg struct {
	// Name of the argument
	Name string
	// Text displayed to the user to help with the autocomplete
	HelpText string
	// Type of the argument
	Type AutocompleteArgType
	// Required determins if argument is optional or not.
	Required bool
	// Actual data of the argument (depends on the Type)
	Data interface{}
}

AutocompleteArg describes an argument of the command. Arguments can be named or positional. If Name is empty string Argument is positional otherwise it is named argument. Named arguments are passed as --Name Argument_Value.

func (*AutocompleteArg) Equals added in v5.24.0

func (a *AutocompleteArg) Equals(arg *AutocompleteArg) bool

Equals method checks if argument is the same.

func (*AutocompleteArg) UnmarshalJSON added in v5.24.0

func (a *AutocompleteArg) UnmarshalJSON(b []byte) error

UnmarshalJSON will unmarshal argument

type AutocompleteArgType added in v5.24.0

type AutocompleteArgType string

AutocompleteArgType describes autocomplete argument type

const (
	AutocompleteArgTypeText        AutocompleteArgType = "TextInput"
	AutocompleteArgTypeStaticList  AutocompleteArgType = "StaticList"
	AutocompleteArgTypeDynamicList AutocompleteArgType = "DynamicList"
)

Argument types

type AutocompleteData added in v5.24.0

type AutocompleteData struct {
	// Trigger of the command
	Trigger string
	// Hint of a command
	Hint string
	// Text displayed to the user to help with the autocomplete description
	HelpText string
	// Role of the user who should be able to see the autocomplete info of this command
	RoleID string
	// Arguments of the command. Arguments can be named or positional.
	// If they are positional order in the list matters, if they are named order does not matter.
	// All arguments should be either named or positional, no mixing allowed.
	Arguments []*AutocompleteArg
	// Subcommands of the command
	SubCommands []*AutocompleteData
}

AutocompleteData describes slash command autocomplete information.

func AutocompleteDataFromJSON added in v5.24.0

func AutocompleteDataFromJSON(data []byte) (*AutocompleteData, error)

AutocompleteDataFromJSON decodes AutocompleteData struct from the json

func NewAutocompleteData added in v5.24.0

func NewAutocompleteData(trigger, hint, helpText string) *AutocompleteData

NewAutocompleteData returns new Autocomplete data.

func (*AutocompleteData) AddCommand added in v5.24.0

func (ad *AutocompleteData) AddCommand(command *AutocompleteData)

AddCommand adds a subcommand to the autocomplete data.

func (*AutocompleteData) AddDynamicListArgument added in v5.24.0

func (ad *AutocompleteData) AddDynamicListArgument(helpText, url string, required bool)

AddDynamicListArgument adds positional AutocompleteArgTypeDynamicList argument to the command.

func (*AutocompleteData) AddNamedDynamicListArgument added in v5.24.0

func (ad *AutocompleteData) AddNamedDynamicListArgument(name, helpText, url string, required bool)

AddNamedDynamicListArgument adds named AutocompleteArgTypeDynamicList argument to the command.

func (*AutocompleteData) AddNamedStaticListArgument added in v5.24.0

func (ad *AutocompleteData) AddNamedStaticListArgument(name, helpText string, required bool, items []AutocompleteListItem)

AddNamedStaticListArgument adds named AutocompleteArgTypeStaticList argument to the command.

func (*AutocompleteData) AddNamedTextArgument added in v5.24.0

func (ad *AutocompleteData) AddNamedTextArgument(name, helpText, hint, pattern string, required bool)

AddNamedTextArgument adds named AutocompleteArgTypeText argument to the command.

func (*AutocompleteData) AddStaticListArgument added in v5.24.0

func (ad *AutocompleteData) AddStaticListArgument(helpText string, required bool, items []AutocompleteListItem)

AddStaticListArgument adds positional AutocompleteArgTypeStaticList argument to the command.

func (*AutocompleteData) AddTextArgument added in v5.24.0

func (ad *AutocompleteData) AddTextArgument(helpText, hint, pattern string)

AddTextArgument adds positional AutocompleteArgTypeText argument to the command.

func (*AutocompleteData) Equals added in v5.24.0

func (ad *AutocompleteData) Equals(command *AutocompleteData) bool

Equals method checks if command is the same.

func (*AutocompleteData) IsValid added in v5.24.0

func (ad *AutocompleteData) IsValid() error

IsValid method checks if autocomplete data is valid.

func (*AutocompleteData) ToJSON added in v5.24.0

func (ad *AutocompleteData) ToJSON() ([]byte, error)

ToJSON encodes AutocompleteData struct to the json

func (*AutocompleteData) UpdateRelativeURLsForPluginCommands added in v5.24.0

func (ad *AutocompleteData) UpdateRelativeURLsForPluginCommands(baseURL *url.URL) error

UpdateRelativeURLsForPluginCommands method updates relative urls for plugin commands

type AutocompleteDynamicListArg added in v5.24.0

type AutocompleteDynamicListArg struct {
	FetchURL string
}

AutocompleteDynamicListArg is used when user wants to download possible argument list from the URL.

type AutocompleteListItem added in v5.24.0

type AutocompleteListItem struct {
	Item     string
	Hint     string
	HelpText string
}

AutocompleteListItem describes an item in the AutocompleteStaticListArg.

func AutocompleteStaticListItemsFromJSON added in v5.24.0

func AutocompleteStaticListItemsFromJSON(data io.Reader) []AutocompleteListItem

AutocompleteStaticListItemsFromJSON returns list of AutocompleteStaticListItem from json.

type AutocompleteStaticListArg added in v5.24.0

type AutocompleteStaticListArg struct {
	PossibleArguments []AutocompleteListItem
}

AutocompleteStaticListArg is used to input one of the arguments from the list, for example [yes, no], [on, off], and so on.

type AutocompleteSuggestion added in v5.24.0

type AutocompleteSuggestion struct {
	// Complete describes completed suggestion
	Complete string
	// Suggestion describes what user might want to input next
	Suggestion string
	// Hint describes a hint about the suggested input
	Hint string
	// Description of the command or a suggestion
	Description string
	// IconData is base64 encoded svg image
	IconData string
}

AutocompleteSuggestion describes a single suggestion item sent to the front-end Example: for user input `/jira cre` - Complete might be `/jira create` Suggestion might be `create`, Hint might be `[issue text]`, Description might be `Create a new Issue`

func AutocompleteSuggestionsFromJSON added in v5.24.0

func AutocompleteSuggestionsFromJSON(data io.Reader) []AutocompleteSuggestion

AutocompleteSuggestionsFromJSON returns list of AutocompleteSuggestions from json.

type AutocompleteTextArg added in v5.24.0

type AutocompleteTextArg struct {
	// Hint of the input text
	Hint string
	// Regex pattern to match
	Pattern string
}

AutocompleteTextArg describes text user can input as an argument.

type BaseMarketplacePlugin

type BaseMarketplacePlugin struct {
	HomepageURL     string             `json:"homepage_url"`
	IconData        string             `json:"icon_data"`
	DownloadURL     string             `json:"download_url"`
	ReleaseNotesURL string             `json:"release_notes_url"`
	Labels          []MarketplaceLabel `json:"labels"`
	Signature       string             `json:"signature"` // Signature represents a signature of a plugin saved in base64 encoding.
	Manifest        *Manifest          `json:"manifest"`
}

BaseMarketplacePlugin is a Mattermost plugin received from the Marketplace server.

func BaseMarketplacePluginsFromReader

func BaseMarketplacePluginsFromReader(reader io.Reader) ([]*BaseMarketplacePlugin, error)

BaseMarketplacePluginsFromReader decodes a json-encoded list of plugins from the given io.Reader.

func (*BaseMarketplacePlugin) DecodeSignature

func (plugin *BaseMarketplacePlugin) DecodeSignature() (io.ReadSeeker, error)

DecodeSignature Decodes signature and returns ReadSeeker.

type BleveSettings added in v5.24.0

type BleveSettings struct {
	IndexDir                      *string `access:"experimental"`
	EnableIndexing                *bool   `access:"experimental"`
	EnableSearching               *bool   `access:"experimental"`
	EnableAutocomplete            *bool   `access:"experimental"`
	BulkIndexingTimeWindowSeconds *int    `access:"experimental"`
}

func (*BleveSettings) SetDefaults added in v5.24.0

func (bs *BleveSettings) SetDefaults()

type Bot

type Bot struct {
	UserId         string `json:"user_id"`
	Username       string `json:"username"`
	DisplayName    string `json:"display_name,omitempty"`
	Description    string `json:"description,omitempty"`
	OwnerId        string `json:"owner_id"`
	LastIconUpdate int64  `json:"last_icon_update,omitempty"`
	CreateAt       int64  `json:"create_at"`
	UpdateAt       int64  `json:"update_at"`
	DeleteAt       int64  `json:"delete_at"`
}

Bot is a special type of User meant for programmatic interactions. Note that the primary key of a bot is the UserId, and matches the primary key of the corresponding user.

func BotFromJson

func BotFromJson(data io.Reader) *Bot

BotFromJson deserializes a bot from json.

func BotFromUser

func BotFromUser(u *User) *Bot

BotFromUser returns a bot model given a user model

func (*Bot) Clone

func (b *Bot) Clone() *Bot

Clone returns a shallow copy of the bot.

func (*Bot) Etag

func (b *Bot) Etag() string

Etag generates an etag for caching.

func (*Bot) IsValid

func (b *Bot) IsValid() *AppError

IsValid validates the bot and returns an error if it isn't configured correctly.

func (*Bot) Patch

func (b *Bot) Patch(patch *BotPatch)

Patch modifies an existing bot with optional fields from the given patch.

func (*Bot) PreSave

func (b *Bot) PreSave()

PreSave should be run before saving a new bot to the database.

func (*Bot) PreUpdate

func (b *Bot) PreUpdate()

PreUpdate should be run before saving an updated bot to the database.

func (*Bot) ToJson

func (b *Bot) ToJson() []byte

ToJson serializes the bot to json.

func (*Bot) Trace

func (b *Bot) Trace() map[string]interface{}

Trace describes the minimum information required to identify a bot for the purpose of logging.

type BotGetOptions

type BotGetOptions struct {
	OwnerId        string
	IncludeDeleted bool
	OnlyOrphaned   bool
	Page           int
	PerPage        int
}

BotGetOptions acts as a filter on bulk bot fetching queries.

type BotList

type BotList []*Bot

BotList is a list of bots.

func BotListFromJson

func BotListFromJson(data io.Reader) BotList

BotListFromJson deserializes a list of bots from json.

func (*BotList) Etag

func (l *BotList) Etag() string

Etag computes the etag for a list of bots.

func (*BotList) ToJson

func (l *BotList) ToJson() []byte

ToJson serializes a list of bots to json.

type BotPatch

type BotPatch struct {
	Username    *string `json:"username"`
	DisplayName *string `json:"display_name"`
	Description *string `json:"description"`
}

BotPatch is a description of what fields to update on an existing bot.

func BotPatchFromJson

func BotPatchFromJson(data io.Reader) *BotPatch

BotPatchFromJson deserializes a bot patch from json.

func (*BotPatch) ToJson

func (b *BotPatch) ToJson() []byte

ToJson serializes the bot patch to json.

type BundleInfo

type BundleInfo struct {
	Path string

	Manifest      *Manifest
	ManifestPath  string
	ManifestError error
}

func BundleInfoForPath

func BundleInfoForPath(path string) *BundleInfo

Returns bundle info for the given path. The return value is never nil.

func (*BundleInfo) WrapLogger

func (b *BundleInfo) WrapLogger(logger *mlog.Logger) *mlog.Logger

type Channel

type Channel struct {
	Id               string                 `json:"id"`
	CreateAt         int64                  `json:"create_at"`
	UpdateAt         int64                  `json:"update_at"`
	DeleteAt         int64                  `json:"delete_at"`
	TeamId           string                 `json:"team_id"`
	Type             string                 `json:"type"`
	DisplayName      string                 `json:"display_name"`
	Name             string                 `json:"name"`
	Header           string                 `json:"header"`
	Purpose          string                 `json:"purpose"`
	LastPostAt       int64                  `json:"last_post_at"`
	TotalMsgCount    int64                  `json:"total_msg_count"`
	ExtraUpdateAt    int64                  `json:"extra_update_at"`
	CreatorId        string                 `json:"creator_id"`
	SchemeId         *string                `json:"scheme_id"`
	Props            map[string]interface{} `json:"props" db:"-"`
	GroupConstrained *bool                  `json:"group_constrained"`
}

func ChannelFromJson

func ChannelFromJson(data io.Reader) *Channel

func ChannelSliceFromJson

func ChannelSliceFromJson(data io.Reader) []*Channel

func (*Channel) AddProp

func (o *Channel) AddProp(key string, value interface{})

func (*Channel) DeepCopy

func (o *Channel) DeepCopy() *Channel

func (*Channel) Etag

func (o *Channel) Etag() string

func (*Channel) GetOtherUserIdForDM

func (o *Channel) GetOtherUserIdForDM(userId string) string

func (*Channel) IsGroupConstrained

func (o *Channel) IsGroupConstrained() bool

func (*Channel) IsGroupOrDirect

func (o *Channel) IsGroupOrDirect() bool

func (*Channel) IsOpen added in v5.22.0

func (o *Channel) IsOpen() bool

func (*Channel) IsValid

func (o *Channel) IsValid() *AppError

func (*Channel) MakeNonNil

func (o *Channel) MakeNonNil()

func (*Channel) Patch

func (o *Channel) Patch(patch *ChannelPatch)

func (*Channel) PreSave

func (o *Channel) PreSave()

func (*Channel) PreUpdate

func (o *Channel) PreUpdate()

func (*Channel) ToJson

func (o *Channel) ToJson() string

type ChannelCounts

type ChannelCounts struct {
	Counts      map[string]int64 `json:"counts"`
	UpdateTimes map[string]int64 `json:"update_times"`
}

func ChannelCountsFromJson

func ChannelCountsFromJson(data io.Reader) *ChannelCounts

func (*ChannelCounts) Etag

func (o *ChannelCounts) Etag() string

func (*ChannelCounts) ToJson

func (o *ChannelCounts) ToJson() string

type ChannelData

type ChannelData struct {
	Channel *Channel       `json:"channel"`
	Member  *ChannelMember `json:"member"`
}

func ChannelDataFromJson

func ChannelDataFromJson(data io.Reader) *ChannelData

func (*ChannelData) Etag

func (o *ChannelData) Etag() string

func (*ChannelData) ToJson

func (o *ChannelData) ToJson() string

type ChannelForExport

type ChannelForExport struct {
	Channel
	TeamName   string
	SchemeName *string
}

type ChannelList

type ChannelList []*Channel

func ChannelListFromJson

func ChannelListFromJson(data io.Reader) *ChannelList

func (*ChannelList) Etag

func (o *ChannelList) Etag() string

func (*ChannelList) ToJson

func (o *ChannelList) ToJson() string

type ChannelListWithTeamData

type ChannelListWithTeamData []*ChannelWithTeamData

func ChannelListWithTeamDataFromJson

func ChannelListWithTeamDataFromJson(data io.Reader) *ChannelListWithTeamData

func (*ChannelListWithTeamData) Etag

func (o *ChannelListWithTeamData) Etag() string

func (*ChannelListWithTeamData) ToJson

func (o *ChannelListWithTeamData) ToJson() string

type ChannelMember

type ChannelMember struct {
	ChannelId     string    `json:"channel_id"`
	UserId        string    `json:"user_id"`
	Roles         string    `json:"roles"`
	LastViewedAt  int64     `json:"last_viewed_at"`
	MsgCount      int64     `json:"msg_count"`
	MentionCount  int64     `json:"mention_count"`
	NotifyProps   StringMap `json:"notify_props"`
	LastUpdateAt  int64     `json:"last_update_at"`
	SchemeGuest   bool      `json:"scheme_guest"`
	SchemeUser    bool      `json:"scheme_user"`
	SchemeAdmin   bool      `json:"scheme_admin"`
	ExplicitRoles string    `json:"explicit_roles"`
}

func ChannelMemberFromJson

func ChannelMemberFromJson(data io.Reader) *ChannelMember

func (*ChannelMember) GetRoles

func (o *ChannelMember) GetRoles() []string

func (*ChannelMember) IsValid

func (o *ChannelMember) IsValid() *AppError

func (*ChannelMember) PreSave

func (o *ChannelMember) PreSave()

func (*ChannelMember) PreUpdate

func (o *ChannelMember) PreUpdate()

func (*ChannelMember) ToJson

func (o *ChannelMember) ToJson() string

type ChannelMemberCountByGroup added in v5.24.0

type ChannelMemberCountByGroup struct {
	GroupId                     string `db:"-" json:"group_id"`
	ChannelMemberCount          int64  `db:"-" json:"channel_member_count"`
	ChannelMemberTimezonesCount int64  `db:"-" json:"channel_member_timezones_count"`
}

func ChannelMemberCountsByGroupFromJson added in v5.24.0

func ChannelMemberCountsByGroupFromJson(data io.Reader) []*ChannelMemberCountByGroup

type ChannelMemberForExport

type ChannelMemberForExport struct {
	ChannelMember
	ChannelName string
	Username    string
}

type ChannelMemberHistory

type ChannelMemberHistory struct {
	ChannelId string
	UserId    string
	JoinTime  int64
	LeaveTime *int64
}

type ChannelMemberHistoryResult

type ChannelMemberHistoryResult struct {
	ChannelId string
	UserId    string
	JoinTime  int64
	LeaveTime *int64

	// these two fields are never set in the database - when we SELECT, we join on Users to get them
	UserEmail    string `db:"Email"`
	Username     string
	IsBot        bool
	UserDeleteAt int64
}

type ChannelMembers

type ChannelMembers []ChannelMember

func ChannelMembersFromJson

func ChannelMembersFromJson(data io.Reader) *ChannelMembers

func (*ChannelMembers) ToJson

func (o *ChannelMembers) ToJson() string

type ChannelMentionMap added in v5.22.0

type ChannelMentionMap map[string]string

func ChannelMentionMapFromURLValues added in v5.22.0

func ChannelMentionMapFromURLValues(values url.Values) (ChannelMentionMap, error)

func (ChannelMentionMap) ToURLValues added in v5.22.0

func (m ChannelMentionMap) ToURLValues() url.Values

type ChannelModeratedRole added in v5.22.0

type ChannelModeratedRole struct {
	Value   bool `json:"value"`
	Enabled bool `json:"enabled"`
}

type ChannelModeratedRoles added in v5.22.0

type ChannelModeratedRoles struct {
	Guests  *ChannelModeratedRole `json:"guests"`
	Members *ChannelModeratedRole `json:"members"`
}

type ChannelModeratedRolesPatch added in v5.22.0

type ChannelModeratedRolesPatch struct {
	Guests  *bool `json:"guests"`
	Members *bool `json:"members"`
}

type ChannelModeration added in v5.22.0

type ChannelModeration struct {
	Name  string                 `json:"name"`
	Roles *ChannelModeratedRoles `json:"roles"`
}

func ChannelModerationsFromJson added in v5.22.0

func ChannelModerationsFromJson(data io.Reader) []*ChannelModeration

type ChannelModerationPatch added in v5.22.0

type ChannelModerationPatch struct {
	Name  *string                     `json:"name"`
	Roles *ChannelModeratedRolesPatch `json:"roles"`
}

func ChannelModerationsPatchFromJson added in v5.22.0

func ChannelModerationsPatchFromJson(data io.Reader) []*ChannelModerationPatch

type ChannelPatch

type ChannelPatch struct {
	DisplayName      *string `json:"display_name"`
	Name             *string `json:"name"`
	Header           *string `json:"header"`
	Purpose          *string `json:"purpose"`
	GroupConstrained *bool   `json:"group_constrained"`
}

func ChannelPatchFromJson

func ChannelPatchFromJson(data io.Reader) *ChannelPatch

func (*ChannelPatch) ToJson

func (o *ChannelPatch) ToJson() string

type ChannelSearch

type ChannelSearch struct {
	Term                    string   `json:"term"`
	ExcludeDefaultChannels  bool     `json:"exclude_default_channels"`
	NotAssociatedToGroup    string   `json:"not_associated_to_group"`
	TeamIds                 []string `json:"team_ids"`
	GroupConstrained        bool     `json:"group_constrained"`
	ExcludeGroupConstrained bool     `json:"exclude_group_constrained"`
	Public                  bool     `json:"public"`
	Private                 bool     `json:"private"`
	IncludeDeleted          bool     `json:"include_deleted"`
	Deleted                 bool     `json:"deleted"`
	Page                    *int     `json:"page,omitempty"`
	PerPage                 *int     `json:"per_page,omitempty"`
}

func ChannelSearchFromJson

func ChannelSearchFromJson(data io.Reader) *ChannelSearch

ChannelSearchFromJson will decode the input and return a Channel

func (*ChannelSearch) ToJson

func (c *ChannelSearch) ToJson() string

ToJson convert a Channel to a json string

type ChannelSearchOpts

type ChannelSearchOpts struct {
	NotAssociatedToGroup    string
	ExcludeDefaultChannels  bool
	IncludeDeleted          bool
	Deleted                 bool
	ExcludeChannelNames     []string
	TeamIds                 []string
	GroupConstrained        bool
	ExcludeGroupConstrained bool
	Public                  bool
	Private                 bool
	Page                    *int
	PerPage                 *int
}

ChannelSearchOpts contains options for searching channels.

NotAssociatedToGroup will exclude channels that have associated, active GroupChannels records. ExcludeDefaultChannels will exclude the configured default channels (ex 'town-square' and 'off-topic'). IncludeDeleted will include channel records where DeleteAt != 0. ExcludeChannelNames will exclude channels from the results by name. Paginate whether to paginate the results. Page page requested, if results are paginated. PerPage number of results per page, if paginated.

type ChannelStats

type ChannelStats struct {
	ChannelId       string `json:"channel_id"`
	MemberCount     int64  `json:"member_count"`
	GuestCount      int64  `json:"guest_count"`
	PinnedPostCount int64  `json:"pinnedpost_count"`
}

func ChannelStatsFromJson

func ChannelStatsFromJson(data io.Reader) *ChannelStats

func (*ChannelStats) ToJson

func (o *ChannelStats) ToJson() string

type ChannelUnread

type ChannelUnread struct {
	TeamId       string    `json:"team_id"`
	ChannelId    string    `json:"channel_id"`
	MsgCount     int64     `json:"msg_count"`
	MentionCount int64     `json:"mention_count"`
	NotifyProps  StringMap `json:"-"`
}

func ChannelUnreadFromJson

func ChannelUnreadFromJson(data io.Reader) *ChannelUnread

func (*ChannelUnread) ToJson

func (o *ChannelUnread) ToJson() string

type ChannelUnreadAt

type ChannelUnreadAt struct {
	TeamId       string    `json:"team_id"`
	UserId       string    `json:"user_id"`
	ChannelId    string    `json:"channel_id"`
	MsgCount     int64     `json:"msg_count"`
	MentionCount int64     `json:"mention_count"`
	LastViewedAt int64     `json:"last_viewed_at"`
	NotifyProps  StringMap `json:"-"`
}

func ChannelUnreadAtFromJson

func ChannelUnreadAtFromJson(data io.Reader) *ChannelUnreadAt

func (*ChannelUnreadAt) ToJson

func (o *ChannelUnreadAt) ToJson() string

type ChannelView

type ChannelView struct {
	ChannelId     string `json:"channel_id"`
	PrevChannelId string `json:"prev_channel_id"`
}

func ChannelViewFromJson

func ChannelViewFromJson(data io.Reader) *ChannelView

func (*ChannelView) ToJson

func (o *ChannelView) ToJson() string

type ChannelViewResponse

type ChannelViewResponse struct {
	Status            string           `json:"status"`
	LastViewedAtTimes map[string]int64 `json:"last_viewed_at_times"`
}

func ChannelViewResponseFromJson

func ChannelViewResponseFromJson(data io.Reader) *ChannelViewResponse

func (*ChannelViewResponse) ToJson

func (o *ChannelViewResponse) ToJson() string

type ChannelWithTeamData

type ChannelWithTeamData struct {
	Channel
	TeamDisplayName string `json:"team_display_name"`
	TeamName        string `json:"team_name"`
	TeamUpdateAt    int64  `json:"team_update_at"`
}

type ChannelsWithCount

type ChannelsWithCount struct {
	Channels   *ChannelListWithTeamData `json:"channels"`
	TotalCount int64                    `json:"total_count"`
}

func ChannelsWithCountFromJson

func ChannelsWithCountFromJson(data io.Reader) *ChannelsWithCount

func (*ChannelsWithCount) ToJson

func (o *ChannelsWithCount) ToJson() []byte

type Client4

type Client4 struct {
	Url        string       // The location of the server, for example  "http://localhost:8065"
	ApiUrl     string       // The api location of the server, for example "http://localhost:8065/api/v4"
	HttpClient *http.Client // The http client
	AuthToken  string
	AuthType   string
	HttpHeader map[string]string // Headers to be copied over for each request
	// contains filtered or unexported fields
}

func NewAPIv4Client

func NewAPIv4Client(url string) *Client4

func NewAPIv4SocketClient added in v5.28.0

func NewAPIv4SocketClient(socketPath string) *Client4

func (*Client4) AddChannelMember

func (c *Client4) AddChannelMember(channelId, userId string) (*ChannelMember, *Response)

AddChannelMember adds user to channel and return a channel member.

func (*Client4) AddChannelMemberWithRootId

func (c *Client4) AddChannelMemberWithRootId(channelId, userId, postRootId string) (*ChannelMember, *Response)

AddChannelMemberWithRootId adds user to channel and return a channel member. Post add to channel message has the postRootId.

func (*Client4) AddTeamMember

func (c *Client4) AddTeamMember(teamId, userId string) (*TeamMember, *Response)

AddTeamMember adds user to a team and return a team member.

func (*Client4) AddTeamMemberFromInvite

func (c *Client4) AddTeamMemberFromInvite(token, inviteId string) (*TeamMember, *Response)

AddTeamMemberFromInvite adds a user to a team and return a team member using an invite id or an invite token/data pair.

func (*Client4) AddTeamMembers

func (c *Client4) AddTeamMembers(teamId string, userIds []string) ([]*TeamMember, *Response)

AddTeamMembers adds a number of users to a team and returns the team members.

func (*Client4) AddTeamMembersGracefully added in v5.20.0

func (c *Client4) AddTeamMembersGracefully(teamId string, userIds []string) ([]*TeamMemberWithError, *Response)

AddTeamMembers adds a number of users to a team and returns the team members.

func (*Client4) AssignBot

func (c *Client4) AssignBot(botUserId, newOwnerId string) (*Bot, *Response)

AssignBot assigns the given bot to the given user

func (*Client4) AttachDeviceId

func (c *Client4) AttachDeviceId(deviceId string) (bool, *Response)

AttachDeviceId attaches a mobile device ID to the current session.

func (*Client4) AuthorizeOAuthApp

func (c *Client4) AuthorizeOAuthApp(authRequest *AuthorizeRequest) (string, *Response)

AuthorizeOAuthApp will authorize an OAuth 2.0 client application to access a user's account and provide a redirect link to follow.

func (*Client4) AutocompleteChannelsForTeam

func (c *Client4) AutocompleteChannelsForTeam(teamId, name string) (*ChannelList, *Response)

AutocompleteChannelsForTeam will return an ordered list of channels autocomplete suggestions.

func (*Client4) AutocompleteChannelsForTeamForSearch

func (c *Client4) AutocompleteChannelsForTeamForSearch(teamId, name string) (*ChannelList, *Response)

AutocompleteChannelsForTeamForSearch will return an ordered list of your channels autocomplete suggestions.

func (*Client4) AutocompleteEmoji

func (c *Client4) AutocompleteEmoji(name string, etag string) ([]*Emoji, *Response)

AutocompleteEmoji returns a list of emoji starting with or matching name.

func (*Client4) AutocompleteUsers

func (c *Client4) AutocompleteUsers(username string, limit int, etag string) (*UserAutocomplete, *Response)

AutocompleteUsers returns the users in the system based on search term.

func (*Client4) AutocompleteUsersInChannel

func (c *Client4) AutocompleteUsersInChannel(teamId string, channelId string, username string, limit int, etag string) (*UserAutocomplete, *Response)

AutocompleteUsersInChannel returns the users in a channel based on search term.

func (*Client4) AutocompleteUsersInTeam

func (c *Client4) AutocompleteUsersInTeam(teamId string, username string, limit int, etag string) (*UserAutocomplete, *Response)

AutocompleteUsersInTeam returns the users on a team based on search term.

func (*Client4) CancelJob

func (c *Client4) CancelJob(jobId string) (bool, *Response)

CancelJob requests the cancellation of the job with the provided Id.

func (*Client4) ChannelMembersMinusGroupMembers

func (c *Client4) ChannelMembersMinusGroupMembers(channelID string, groupIDs []string, page, perPage int, etag string) ([]*UserWithGroups, int64, *Response)

func (*Client4) CheckIntegrity added in v5.28.0

func (c *Client4) CheckIntegrity() ([]IntegrityCheckResult, *Response)

CheckIntegrity performs a database integrity check.

func (*Client4) CheckUserMfa

func (c *Client4) CheckUserMfa(loginId string) (bool, *Response)

CheckUserMfa checks whether a user has MFA active on their account or not based on the provided login id. Deprecated: Clients should use Login method and check for MFA Error

func (*Client4) ClearOAuthToken

func (c *Client4) ClearOAuthToken()

func (*Client4) ClearServerBusy added in v5.20.0

func (c *Client4) ClearServerBusy() (bool, *Response)

ClearServerBusy will mark the server as not busy.

func (*Client4) ConvertBotToUser added in v5.26.0

func (c *Client4) ConvertBotToUser(userId string, userPatch *UserPatch, setSystemAdmin bool) (*User, *Response)

ConvertBotToUser converts a bot user to a user.

func (*Client4) ConvertChannelToPrivate

func (c *Client4) ConvertChannelToPrivate(channelId string) (*Channel, *Response)

ConvertChannelToPrivate converts public to private channel.

func (*Client4) ConvertUserToBot added in v5.26.0

func (c *Client4) ConvertUserToBot(userId string) (*Bot, *Response)

ConvertUserToBot converts a user to a bot user.

func (*Client4) CreateBot

func (c *Client4) CreateBot(bot *Bot) (*Bot, *Response)

CreateBot creates a bot in the system based on the provided bot struct.

func (*Client4) CreateChannel

func (c *Client4) CreateChannel(channel *Channel) (*Channel, *Response)

CreateChannel creates a channel based on the provided channel struct.

func (*Client4) CreateCommand

func (c *Client4) CreateCommand(cmd *Command) (*Command, *Response)

CreateCommand will create a new command if the user have the right permissions.

func (*Client4) CreateComplianceReport

func (c *Client4) CreateComplianceReport(report *Compliance) (*Compliance, *Response)

CreateComplianceReport creates an incoming webhook for a channel.

func (*Client4) CreateDirectChannel

func (c *Client4) CreateDirectChannel(userId1, userId2 string) (*Channel, *Response)

CreateDirectChannel creates a direct message channel based on the two user ids provided.

func (*Client4) CreateEmoji

func (c *Client4) CreateEmoji(emoji *Emoji, image []byte, filename string) (*Emoji, *Response)

CreateEmoji will save an emoji to the server if the current user has permission to do so. If successful, the provided emoji will be returned with its Id field filled in. Otherwise, an error will be returned.

func (*Client4) CreateGroupChannel

func (c *Client4) CreateGroupChannel(userIds []string) (*Channel, *Response)

CreateGroupChannel creates a group message channel based on userIds provided.

func (*Client4) CreateIncomingWebhook

func (c *Client4) CreateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response)

CreateIncomingWebhook creates an incoming webhook for a channel.

func (*Client4) CreateJob

func (c *Client4) CreateJob(job *Job) (*Job, *Response)

CreateJob creates a job based on the provided job struct.

func (*Client4) CreateOAuthApp

func (c *Client4) CreateOAuthApp(app *OAuthApp) (*OAuthApp, *Response)

CreateOAuthApp will register a new OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.

func (*Client4) CreateOutgoingWebhook

func (c *Client4) CreateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response)

CreateOutgoingWebhook creates an outgoing webhook for a team or channel.

func (*Client4) CreatePost

func (c *Client4) CreatePost(post *Post) (*Post, *Response)

CreatePost creates a post based on the provided post struct.

func (*Client4) CreatePostEphemeral

func (c *Client4) CreatePostEphemeral(post *PostEphemeral) (*Post, *Response)

CreatePostEphemeral creates a ephemeral post based on the provided post struct which is send to the given user id.

func (*Client4) CreateScheme

func (c *Client4) CreateScheme(scheme *Scheme) (*Scheme, *Response)

CreateScheme creates a new Scheme.

func (*Client4) CreateSidebarCategoryForTeamForUser added in v5.26.0

func (c *Client4) CreateSidebarCategoryForTeamForUser(userID, teamID string, category *SidebarCategoryWithChannels) (*SidebarCategoryWithChannels, *Response)

func (*Client4) CreateTeam

func (c *Client4) CreateTeam(team *Team) (*Team, *Response)

CreateTeam creates a team in the system based on the provided team struct.

func (*Client4) CreateTermsOfService

func (c *Client4) CreateTermsOfService(text, userId string) (*TermsOfService, *Response)

CreateTermsOfService creates new terms of service.

func (*Client4) CreateUpload added in v5.28.0

func (c *Client4) CreateUpload(us *UploadSession) (*UploadSession, *Response)

CreateUpload creates a new upload session.

func (*Client4) CreateUser

func (c *Client4) CreateUser(user *User) (*User, *Response)

CreateUser creates a user in the system based on the provided user struct.

func (*Client4) CreateUserAccessToken

func (c *Client4) CreateUserAccessToken(userId, description string) (*UserAccessToken, *Response)

CreateUserAccessToken will generate a user access token that can be used in place of a session token to access the REST API. Must have the 'create_user_access_token' permission and if generating for another user, must have the 'edit_other_users' permission. A non-blank description is required.

func (*Client4) CreateUserWithInviteId

func (c *Client4) CreateUserWithInviteId(user *User, inviteId string) (*User, *Response)

CreateUserWithInviteId creates a user in the system based on the provided invited id.

func (*Client4) CreateUserWithToken

func (c *Client4) CreateUserWithToken(user *User, tokenId string) (*User, *Response)

CreateUserWithToken creates a user in the system based on the provided tokenId.

func (*Client4) DatabaseRecycle

func (c *Client4) DatabaseRecycle() (bool, *Response)

DatabaseRecycle will recycle the connections. Discard current connection and get new one.

func (*Client4) DeauthorizeOAuthApp

func (c *Client4) DeauthorizeOAuthApp(appId string) (bool, *Response)

DeauthorizeOAuthApp will deauthorize an OAuth 2.0 client application from accessing a user's account.

func (*Client4) DeleteBotIconImage

func (c *Client4) DeleteBotIconImage(botUserId string) (bool, *Response)

DeleteBotIconImage deletes LHS bot icon image. Must be logged in.

func (*Client4) DeleteBrandImage

func (c *Client4) DeleteBrandImage() *Response

DeleteBrandImage deletes the brand image for the system.

func (*Client4) DeleteChannel

func (c *Client4) DeleteChannel(channelId string) (bool, *Response)

DeleteChannel deletes channel based on the provided channel id string.

func (*Client4) DeleteCommand

func (c *Client4) DeleteCommand(commandId string) (bool, *Response)

DeleteCommand deletes a command based on the provided command id string.

func (*Client4) DeleteEmoji

func (c *Client4) DeleteEmoji(emojiId string) (bool, *Response)

DeleteEmoji delete an custom emoji on the provided emoji id string.

func (*Client4) DeleteIncomingWebhook

func (c *Client4) DeleteIncomingWebhook(hookID string) (bool, *Response)

DeleteIncomingWebhook deletes and Incoming Webhook given the hook ID.

func (*Client4) DeleteLdapPrivateCertificate added in v5.28.0

func (c *Client4) DeleteLdapPrivateCertificate() (bool, *Response)

DeleteLDAPPrivateCertificate deletes the LDAP IDP certificate from the server and updates the config to not use it and disable LDAP.

func (*Client4) DeleteLdapPublicCertificate added in v5.28.0

func (c *Client4) DeleteLdapPublicCertificate() (bool, *Response)

DeleteLdapPublicCertificate deletes the LDAP IDP certificate from the server and updates the config to not use it and disable LDAP.

func (*Client4) DeleteOAuthApp

func (c *Client4) DeleteOAuthApp(appId string) (bool, *Response)

DeleteOAuthApp deletes a registered OAuth 2.0 client application.

func (*Client4) DeleteOutgoingWebhook

func (c *Client4) DeleteOutgoingWebhook(hookId string) (bool, *Response)

DeleteOutgoingWebhook delete the outgoing webhook on the system requested by Hook Id.

func (*Client4) DeletePost

func (c *Client4) DeletePost(postId string) (bool, *Response)

DeletePost deletes a post from the provided post id string.

func (*Client4) DeletePreferences

func (c *Client4) DeletePreferences(userId string, preferences *Preferences) (bool, *Response)

DeletePreferences deletes the user's preferences.

func (*Client4) DeleteReaction

func (c *Client4) DeleteReaction(reaction *Reaction) (bool, *Response)

DeleteReaction deletes reaction of a user in a post.

func (*Client4) DeleteSamlIdpCertificate

func (c *Client4) DeleteSamlIdpCertificate() (bool, *Response)

DeleteSamlIdpCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.

func (*Client4) DeleteSamlPrivateCertificate

func (c *Client4) DeleteSamlPrivateCertificate() (bool, *Response)

DeleteSamlPrivateCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.

func (*Client4) DeleteSamlPublicCertificate

func (c *Client4) DeleteSamlPublicCertificate() (bool, *Response)

DeleteSamlPublicCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.

func (*Client4) DeleteScheme

func (c *Client4) DeleteScheme(id string) (bool, *Response)

DeleteScheme deletes a single scheme by ID.

func (*Client4) DeleteUser

func (c *Client4) DeleteUser(userId string) (bool, *Response)

DeleteUser deactivates a user in the system based on the provided user id string.

func (*Client4) DemoteUserToGuest

func (c *Client4) DemoteUserToGuest(guestId string) (bool, *Response)

DemoteUserToGuest convert a regular user into a guest

func (*Client4) DisableBot

func (c *Client4) DisableBot(botUserId string) (*Bot, *Response)

DisableBot disables the given bot in the system.

func (*Client4) DisablePlugin

func (c *Client4) DisablePlugin(id string) (bool, *Response)

DisablePlugin will disable an enabled plugin. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) DisableUserAccessToken

func (c *Client4) DisableUserAccessToken(tokenId string) (bool, *Response)

DisableUserAccessToken will disable a user access token by id. Must have the 'revoke_user_access_token' permission and if disabling for another user, must have the 'edit_other_users' permission.

func (*Client4) DoApiDelete

func (c *Client4) DoApiDelete(url string) (*http.Response, *AppError)

func (*Client4) DoApiGet

func (c *Client4) DoApiGet(url string, etag string) (*http.Response, *AppError)

func (*Client4) DoApiPost

func (c *Client4) DoApiPost(url string, data string) (*http.Response, *AppError)

func (*Client4) DoApiPut

func (c *Client4) DoApiPut(url string, data string) (*http.Response, *AppError)

func (*Client4) DoApiRequest

func (c *Client4) DoApiRequest(method, url, data, etag string) (*http.Response, *AppError)

func (*Client4) DoEmojiUploadFile

func (c *Client4) DoEmojiUploadFile(url string, data []byte, contentType string) (*Emoji, *Response)

func (*Client4) DoPostAction

func (c *Client4) DoPostAction(postId, actionId string) (bool, *Response)

DoPostAction performs a post action.

func (*Client4) DoPostActionWithCookie

func (c *Client4) DoPostActionWithCookie(postId, actionId, selected, cookieStr string) (bool, *Response)

DoPostActionWithCookie performs a post action with extra arguments

func (*Client4) DoUploadFile

func (c *Client4) DoUploadFile(url string, data []byte, contentType string) (*FileUploadResponse, *Response)

func (*Client4) DoUploadImportTeam

func (c *Client4) DoUploadImportTeam(url string, data []byte, contentType string) (map[string]string, *Response)

func (*Client4) DownloadComplianceReport

func (c *Client4) DownloadComplianceReport(reportId string) ([]byte, *Response)

DownloadComplianceReport returns a full compliance report as a file.

func (*Client4) DownloadFile

func (c *Client4) DownloadFile(fileId string, download bool) ([]byte, *Response)

DownloadFile gets the bytes for a file by id, optionally adding headers to force the browser to download it.

func (*Client4) DownloadFilePreview

func (c *Client4) DownloadFilePreview(fileId string, download bool) ([]byte, *Response)

DownloadFilePreview gets the bytes for a file by id.

func (*Client4) DownloadFileThumbnail

func (c *Client4) DownloadFileThumbnail(fileId string, download bool) ([]byte, *Response)

DownloadFileThumbnail gets the bytes for a file by id, optionally adding headers to force the browser to download it.

func (*Client4) DownloadJob added in v5.28.0

func (c *Client4) DownloadJob(jobId string) ([]byte, *Response)

DownloadJob downloads the results of the job

func (*Client4) EnableBot

func (c *Client4) EnableBot(botUserId string) (*Bot, *Response)

EnableBot disables the given bot in the system.

func (*Client4) EnablePlugin

func (c *Client4) EnablePlugin(id string) (bool, *Response)

EnablePlugin will enable an plugin installed. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) EnableUserAccessToken

func (c *Client4) EnableUserAccessToken(tokenId string) (bool, *Response)

EnableUserAccessToken will enable a user access token by id. Must have the 'create_user_access_token' permission and if enabling for another user, must have the 'edit_other_users' permission.

func (*Client4) ExecuteCommand

func (c *Client4) ExecuteCommand(channelId, command string) (*CommandResponse, *Response)

ExecuteCommand executes a given slash command.

func (*Client4) ExecuteCommandWithTeam

func (c *Client4) ExecuteCommandWithTeam(channelId, teamId, command string) (*CommandResponse, *Response)

ExecuteCommandWithTeam executes a given slash command against the specified team. Use this when executing slash commands in a DM/GM, since the team id cannot be inferred in that case.

func (*Client4) GenerateMfaSecret

func (c *Client4) GenerateMfaSecret(userId string) (*MfaSecret, *Response)

GenerateMfaSecret will generate a new MFA secret for a user and return it as a string and as a base64 encoded image QR code.

func (*Client4) GetActiveUsersInTeam added in v5.25.0

func (c *Client4) GetActiveUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)

GetActiveUsersInTeam returns a page of users on a team. Page counting starts at 0.

func (*Client4) GetAllChannels

func (c *Client4) GetAllChannels(page int, perPage int, etag string) (*ChannelListWithTeamData, *Response)

GetAllChannels get all the channels. Must be a system administrator.

func (*Client4) GetAllChannelsIncludeDeleted added in v5.26.0

func (c *Client4) GetAllChannelsIncludeDeleted(page int, perPage int, etag string) (*ChannelListWithTeamData, *Response)

GetAllChannelsIncludeDeleted get all the channels. Must be a system administrator.

func (*Client4) GetAllChannelsWithCount

func (c *Client4) GetAllChannelsWithCount(page int, perPage int, etag string) (*ChannelListWithTeamData, int64, *Response)

GetAllChannelsWithCount get all the channels including the total count. Must be a system administrator.

func (*Client4) GetAllTeams

func (c *Client4) GetAllTeams(etag string, page int, perPage int) ([]*Team, *Response)

GetAllTeams returns all teams based on permissions.

func (*Client4) GetAllTeamsWithTotalCount

func (c *Client4) GetAllTeamsWithTotalCount(etag string, page int, perPage int) ([]*Team, int64, *Response)

GetAllTeamsWithTotalCount returns all teams based on permissions.

func (*Client4) GetAnalyticsOld

func (c *Client4) GetAnalyticsOld(name, teamId string) (AnalyticsRows, *Response)

GetAnalyticsOld will retrieve analytics using the old format. New format is not available but the "/analytics" endpoint is reserved for it. The "name" argument is optional and defaults to "standard". The "teamId" argument is optional and will limit results to a specific team.

func (*Client4) GetAnalyticsRoute

func (c *Client4) GetAnalyticsRoute() string

func (*Client4) GetAudits

func (c *Client4) GetAudits(page int, perPage int, etag string) (Audits, *Response)

GetAudits returns a list of audits for the whole system.

func (*Client4) GetAuthorizedOAuthAppsForUser

func (c *Client4) GetAuthorizedOAuthAppsForUser(userId string, page, perPage int) ([]*OAuthApp, *Response)

GetAuthorizedOAuthAppsForUser gets a page of OAuth 2.0 client applications the user has authorized to use access their account.

func (*Client4) GetBleveRoute added in v5.24.0

func (c *Client4) GetBleveRoute() string

func (*Client4) GetBot

func (c *Client4) GetBot(userId string, etag string) (*Bot, *Response)

GetBot fetches the given, undeleted bot.

func (*Client4) GetBotIconImage

func (c *Client4) GetBotIconImage(botUserId string) ([]byte, *Response)

GetBotIconImage gets LHS bot icon image. Must be logged in.

func (*Client4) GetBotIncludeDeleted

func (c *Client4) GetBotIncludeDeleted(userId string, etag string) (*Bot, *Response)

GetBot fetches the given bot, even if it is deleted.

func (*Client4) GetBotRoute

func (c *Client4) GetBotRoute(botUserId string) string

func (*Client4) GetBots

func (c *Client4) GetBots(page, perPage int, etag string) ([]*Bot, *Response)

GetBots fetches the given page of bots, excluding deleted.

func (*Client4) GetBotsIncludeDeleted

func (c *Client4) GetBotsIncludeDeleted(page, perPage int, etag string) ([]*Bot, *Response)

GetBotsIncludeDeleted fetches the given page of bots, including deleted.

func (*Client4) GetBotsOrphaned

func (c *Client4) GetBotsOrphaned(page, perPage int, etag string) ([]*Bot, *Response)

GetBotsOrphaned fetches the given page of bots, only including orphanded bots.

func (*Client4) GetBotsRoute

func (c *Client4) GetBotsRoute() string

func (*Client4) GetBrandImage

func (c *Client4) GetBrandImage() ([]byte, *Response)

GetBrandImage retrieves the previously uploaded brand image.

func (*Client4) GetBrandRoute

func (c *Client4) GetBrandRoute() string

func (*Client4) GetBulkReactions

func (c *Client4) GetBulkReactions(postIds []string) (map[string][]*Reaction, *Response)

FetchBulkReactions returns a map of postIds and corresponding reactions

func (*Client4) GetCacheRoute

func (c *Client4) GetCacheRoute() string

func (*Client4) GetChannel

func (c *Client4) GetChannel(channelId, etag string) (*Channel, *Response)

GetChannel returns a channel based on the provided channel id string.

func (*Client4) GetChannelByName

func (c *Client4) GetChannelByName(channelName, teamId string, etag string) (*Channel, *Response)

GetChannelByName returns a channel based on the provided channel name and team id strings.

func (*Client4) GetChannelByNameForTeamName

func (c *Client4) GetChannelByNameForTeamName(channelName, teamName string, etag string) (*Channel, *Response)

GetChannelByNameForTeamName returns a channel based on the provided channel name and team name strings.

func (*Client4) GetChannelByNameForTeamNameIncludeDeleted

func (c *Client4) GetChannelByNameForTeamNameIncludeDeleted(channelName, teamName string, etag string) (*Channel, *Response)

GetChannelByNameForTeamNameIncludeDeleted returns a channel based on the provided channel name and team name strings. Other then GetChannelByNameForTeamName it will also return deleted channels.

func (*Client4) GetChannelByNameForTeamNameRoute

func (c *Client4) GetChannelByNameForTeamNameRoute(channelName, teamName string) string

func (*Client4) GetChannelByNameIncludeDeleted

func (c *Client4) GetChannelByNameIncludeDeleted(channelName, teamId string, etag string) (*Channel, *Response)

GetChannelByNameIncludeDeleted returns a channel based on the provided channel name and team id strings. Other then GetChannelByName it will also return deleted channels.

func (*Client4) GetChannelByNameRoute

func (c *Client4) GetChannelByNameRoute(channelName, teamId string) string

func (*Client4) GetChannelMember

func (c *Client4) GetChannelMember(channelId, userId, etag string) (*ChannelMember, *Response)

GetChannelMember gets a channel member.

func (*Client4) GetChannelMemberCountsByGroup added in v5.24.0

func (c *Client4) GetChannelMemberCountsByGroup(channelID string, includeTimezones bool, etag string) ([]*ChannelMemberCountByGroup, *Response)

func (*Client4) GetChannelMemberRoute

func (c *Client4) GetChannelMemberRoute(channelId, userId string) string

func (*Client4) GetChannelMembers

func (c *Client4) GetChannelMembers(channelId string, page, perPage int, etag string) (*ChannelMembers, *Response)

GetChannelMembers gets a page of channel members.

func (*Client4) GetChannelMembersByIds

func (c *Client4) GetChannelMembersByIds(channelId string, userIds []string) (*ChannelMembers, *Response)

GetChannelMembersByIds gets the channel members in a channel for a list of user ids.

func (*Client4) GetChannelMembersForUser

func (c *Client4) GetChannelMembersForUser(userId, teamId, etag string) (*ChannelMembers, *Response)

GetChannelMembersForUser gets all the channel members for a user on a team.

func (*Client4) GetChannelMembersRoute

func (c *Client4) GetChannelMembersRoute(channelId string) string

func (*Client4) GetChannelMembersTimezones

func (c *Client4) GetChannelMembersTimezones(channelId string) ([]string, *Response)

GetChannelMembersTimezones gets a list of timezones for a channel.

func (*Client4) GetChannelModerations added in v5.22.0

func (c *Client4) GetChannelModerations(channelID string, etag string) ([]*ChannelModeration, *Response)

func (*Client4) GetChannelRoute

func (c *Client4) GetChannelRoute(channelId string) string

func (*Client4) GetChannelSchemeRoute

func (c *Client4) GetChannelSchemeRoute(channelId string) string

func (*Client4) GetChannelStats

func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats, *Response)

GetChannelStats returns statistics for a channel.

func (*Client4) GetChannelUnread

func (c *Client4) GetChannelUnread(channelId, userId string) (*ChannelUnread, *Response)

GetChannelUnread will return a ChannelUnread object that contains the number of unread messages and mentions for a user.

func (*Client4) GetChannelsForScheme

func (c *Client4) GetChannelsForScheme(schemeId string, page int, perPage int) (ChannelList, *Response)

GetChannelsForScheme gets the channels using this scheme, sorted alphabetically by display name.

func (*Client4) GetChannelsForTeamAndUserWithLastDeleteAt added in v5.28.0

func (c *Client4) GetChannelsForTeamAndUserWithLastDeleteAt(teamId, userId string, includeDeleted bool, lastDeleteAt int, etag string) ([]*Channel, *Response)

GetChannelsForTeamAndUserWithLastDeleteAt returns a list channels of a team for a user, additionally filtered with lastDeleteAt. This does not have any effect if includeDeleted is set to false.

func (*Client4) GetChannelsForTeamForUser

func (c *Client4) GetChannelsForTeamForUser(teamId, userId string, includeDeleted bool, etag string) ([]*Channel, *Response)

GetChannelsForTeamForUser returns a list channels of on a team for a user.

func (*Client4) GetChannelsForTeamForUserRoute added in v5.21.0

func (c *Client4) GetChannelsForTeamForUserRoute(teamId, userId string, includeDeleted bool) string

func (*Client4) GetChannelsForTeamRoute

func (c *Client4) GetChannelsForTeamRoute(teamId string) string

func (*Client4) GetChannelsRoute

func (c *Client4) GetChannelsRoute() string

func (*Client4) GetClusterRoute

func (c *Client4) GetClusterRoute() string

func (*Client4) GetClusterStatus

func (c *Client4) GetClusterStatus() ([]*ClusterInfo, *Response)

GetClusterStatus returns the status of all the configured cluster nodes.

func (*Client4) GetCommandById added in v5.22.0

func (c *Client4) GetCommandById(cmdId string) (*Command, *Response)

GetCommandById will retrieve a command by id.

func (*Client4) GetCommandMoveRoute added in v5.22.0

func (c *Client4) GetCommandMoveRoute(commandId string) string

func (*Client4) GetCommandRoute

func (c *Client4) GetCommandRoute(commandId string) string

func (*Client4) GetCommandsRoute

func (c *Client4) GetCommandsRoute() string

func (*Client4) GetComplianceReport

func (c *Client4) GetComplianceReport(reportId string) (*Compliance, *Response)

GetComplianceReport returns a compliance report.

func (*Client4) GetComplianceReportRoute

func (c *Client4) GetComplianceReportRoute(reportId string) string

func (*Client4) GetComplianceReports

func (c *Client4) GetComplianceReports(page, perPage int) (Compliances, *Response)

GetComplianceReports returns list of compliance reports.

func (*Client4) GetComplianceReportsRoute

func (c *Client4) GetComplianceReportsRoute() string

func (*Client4) GetConfig

func (c *Client4) GetConfig() (*Config, *Response)

GetConfig will retrieve the server config with some sanitized items.

func (*Client4) GetConfigRoute

func (c *Client4) GetConfigRoute() string

func (*Client4) GetDataRetentionPolicy

func (c *Client4) GetDataRetentionPolicy() (*DataRetentionPolicy, *Response)

GetDataRetentionPolicy will get the current server data retention policy details.

func (*Client4) GetDataRetentionRoute

func (c *Client4) GetDataRetentionRoute() string

func (*Client4) GetDatabaseRoute

func (c *Client4) GetDatabaseRoute() string

func (*Client4) GetDefaultProfileImage

func (c *Client4) GetDefaultProfileImage(userId string) ([]byte, *Response)

GetDefaultProfileImage gets the default user's profile image. Must be logged in.

func (*Client4) GetDeletedChannelsForTeam

func (c *Client4) GetDeletedChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response)

GetDeletedChannelsForTeam returns a list of public channels based on the provided team id string.

func (*Client4) GetElasticsearchRoute

func (c *Client4) GetElasticsearchRoute() string

func (*Client4) GetEmoji

func (c *Client4) GetEmoji(emojiId string) (*Emoji, *Response)

GetEmoji returns a custom emoji based on the emojiId string.

func (*Client4) GetEmojiByName

func (c *Client4) GetEmojiByName(name string) (*Emoji, *Response)

GetEmojiByName returns a custom emoji based on the name string.

func (*Client4) GetEmojiByNameRoute

func (c *Client4) GetEmojiByNameRoute(name string) string

func (*Client4) GetEmojiImage

func (c *Client4) GetEmojiImage(emojiId string) ([]byte, *Response)

GetEmojiImage returns the emoji image.

func (*Client4) GetEmojiList

func (c *Client4) GetEmojiList(page, perPage int) ([]*Emoji, *Response)

GetEmojiList returns a page of custom emoji on the system.

func (*Client4) GetEmojiRoute

func (c *Client4) GetEmojiRoute(emojiId string) string

func (*Client4) GetEmojisRoute

func (c *Client4) GetEmojisRoute() string

func (*Client4) GetEnvironmentConfig

func (c *Client4) GetEnvironmentConfig() (map[string]interface{}, *Response)

GetEnvironmentConfig will retrieve a map mirroring the server configuration where fields are set to true if the corresponding config setting is set through an environment variable. Settings that haven't been set through environment variables will be missing from the map.

func (*Client4) GetFile

func (c *Client4) GetFile(fileId string) ([]byte, *Response)

GetFile gets the bytes for a file by id.

func (*Client4) GetFileInfo

func (c *Client4) GetFileInfo(fileId string) (*FileInfo, *Response)

GetFileInfo gets all the file info objects.

func (*Client4) GetFileInfosForPost

func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response)

GetFileInfosForPost gets all the file info objects attached to a post.

func (c *Client4) GetFileLink(fileId string) (string, *Response)

GetFileLink gets the public link of a file by id.

func (*Client4) GetFilePreview

func (c *Client4) GetFilePreview(fileId string) ([]byte, *Response)

GetFilePreview gets the bytes for a file by id.

func (*Client4) GetFileRoute

func (c *Client4) GetFileRoute(fileId string) string

func (*Client4) GetFileThumbnail

func (c *Client4) GetFileThumbnail(fileId string) ([]byte, *Response)

GetFileThumbnail gets the bytes for a file by id.

func (*Client4) GetFilesRoute

func (c *Client4) GetFilesRoute() string

func (*Client4) GetFlaggedPostsForUser

func (c *Client4) GetFlaggedPostsForUser(userId string, page int, perPage int) (*PostList, *Response)

GetFlaggedPostsForUser returns flagged posts of a user based on user id string.

func (*Client4) GetFlaggedPostsForUserInChannel

func (c *Client4) GetFlaggedPostsForUserInChannel(userId string, channelId string, page int, perPage int) (*PostList, *Response)

GetFlaggedPostsForUserInChannel returns flagged posts in channel of a user based on user id string.

func (*Client4) GetFlaggedPostsForUserInTeam

func (c *Client4) GetFlaggedPostsForUserInTeam(userId string, teamId string, page int, perPage int) (*PostList, *Response)

GetFlaggedPostsForUserInTeam returns flagged posts in team of a user based on user id string.

func (*Client4) GetGroup

func (c *Client4) GetGroup(groupID, etag string) (*Group, *Response)

func (*Client4) GetGroupRoute

func (c *Client4) GetGroupRoute(groupID string) string

func (*Client4) GetGroupStats added in v5.26.0

func (c *Client4) GetGroupStats(groupID string) (*GroupStats, *Response)

GetGroupStats retrieves stats for a Mattermost Group

func (*Client4) GetGroupSyncable

func (c *Client4) GetGroupSyncable(groupID, syncableID string, syncableType GroupSyncableType, etag string) (*GroupSyncable, *Response)

func (*Client4) GetGroupSyncableRoute

func (c *Client4) GetGroupSyncableRoute(groupID, syncableID string, syncableType GroupSyncableType) string

func (*Client4) GetGroupSyncables

func (c *Client4) GetGroupSyncables(groupID string, syncableType GroupSyncableType, etag string) ([]*GroupSyncable, *Response)

func (*Client4) GetGroupSyncablesRoute

func (c *Client4) GetGroupSyncablesRoute(groupID string, syncableType GroupSyncableType) string

func (*Client4) GetGroups

func (c *Client4) GetGroups(opts GroupSearchOpts) ([]*Group, *Response)

GetGroups retrieves Mattermost Groups

func (*Client4) GetGroupsAssociatedToChannelsByTeam added in v5.24.0

func (c *Client4) GetGroupsAssociatedToChannelsByTeam(teamId string, opts GroupSearchOpts) (map[string][]*GroupWithSchemeAdmin, *Response)

GetGroupsAssociatedToChannelsByTeam retrieves the Mattermost Groups associated with channels in a given team

func (*Client4) GetGroupsByChannel

func (c *Client4) GetGroupsByChannel(channelId string, opts GroupSearchOpts) ([]*GroupWithSchemeAdmin, int, *Response)

GetGroupsByChannel retrieves the Mattermost Groups associated with a given channel

func (*Client4) GetGroupsByTeam

func (c *Client4) GetGroupsByTeam(teamId string, opts GroupSearchOpts) ([]*GroupWithSchemeAdmin, int, *Response)

GetGroupsByTeam retrieves the Mattermost Groups associated with a given team

func (*Client4) GetGroupsByUserId added in v5.24.0

func (c *Client4) GetGroupsByUserId(userId string) ([]*Group, *Response)

GetGroupsByUserId retrieves Mattermost Groups for a user

func (*Client4) GetGroupsRoute

func (c *Client4) GetGroupsRoute() string

func (*Client4) GetIncomingWebhook

func (c *Client4) GetIncomingWebhook(hookID string, etag string) (*IncomingWebhook, *Response)

GetIncomingWebhook returns an Incoming webhook given the hook ID.

func (*Client4) GetIncomingWebhookRoute

func (c *Client4) GetIncomingWebhookRoute(hookID string) string

func (*Client4) GetIncomingWebhooks

func (c *Client4) GetIncomingWebhooks(page int, perPage int, etag string) ([]*IncomingWebhook, *Response)

GetIncomingWebhooks returns a page of incoming webhooks on the system. Page counting starts at 0.

func (*Client4) GetIncomingWebhooksForTeam

func (c *Client4) GetIncomingWebhooksForTeam(teamId string, page int, perPage int, etag string) ([]*IncomingWebhook, *Response)

GetIncomingWebhooksForTeam returns a page of incoming webhooks for a team. Page counting starts at 0.

func (*Client4) GetIncomingWebhooksRoute

func (c *Client4) GetIncomingWebhooksRoute() string

func (*Client4) GetJob

func (c *Client4) GetJob(id string) (*Job, *Response)

GetJob gets a single job.

func (*Client4) GetJobs

func (c *Client4) GetJobs(page int, perPage int) ([]*Job, *Response)

GetJobs gets all jobs, sorted with the job that was created most recently first.

func (*Client4) GetJobsByType

func (c *Client4) GetJobsByType(jobType string, page int, perPage int) ([]*Job, *Response)

GetJobsByType gets all jobs of a given type, sorted with the job that was created most recently first.

func (*Client4) GetJobsRoute

func (c *Client4) GetJobsRoute() string

func (*Client4) GetKnownUsers added in v5.23.0

func (c *Client4) GetKnownUsers() ([]string, *Response)

func (*Client4) GetLdapGroups

func (c *Client4) GetLdapGroups() ([]*Group, *Response)

GetLdapGroups retrieves the immediate child groups of the given parent group.

func (*Client4) GetLdapRoute

func (c *Client4) GetLdapRoute() string

func (*Client4) GetLicenseRoute

func (c *Client4) GetLicenseRoute() string

func (*Client4) GetLogs

func (c *Client4) GetLogs(page, perPage int) ([]string, *Response)

GetLogs page of logs as a string array.

func (*Client4) GetMarketplacePlugins

func (c *Client4) GetMarketplacePlugins(filter *MarketplacePluginFilter) ([]*MarketplacePlugin, *Response)

GetMarketplacePlugins will return a list of plugins that an admin can install. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) GetMe

func (c *Client4) GetMe(etag string) (*User, *Response)

GetMe returns the logged in user.

func (*Client4) GetNewUsersInTeam

func (c *Client4) GetNewUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)

GetNewUsersInTeam returns a page of users on a team. Page counting starts at 0.

func (*Client4) GetNotices added in v5.28.0

func (c *Client4) GetNotices(lastViewed int64, teamId string, client NoticeClientType, clientVersion, locale, etag string) (NoticeMessages, *Response)

func (*Client4) GetOAuthAccessToken

func (c *Client4) GetOAuthAccessToken(data url.Values) (*AccessResponse, *Response)

GetOAuthAccessToken is a test helper function for the OAuth access token endpoint.

func (*Client4) GetOAuthApp

func (c *Client4) GetOAuthApp(appId string) (*OAuthApp, *Response)

GetOAuthApp gets a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.

func (*Client4) GetOAuthAppInfo

func (c *Client4) GetOAuthAppInfo(appId string) (*OAuthApp, *Response)

GetOAuthAppInfo gets a sanitized version of a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.

func (*Client4) GetOAuthAppRoute

func (c *Client4) GetOAuthAppRoute(appId string) string

func (*Client4) GetOAuthApps

func (c *Client4) GetOAuthApps(page, perPage int) ([]*OAuthApp, *Response)

GetOAuthApps gets a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider.

func (*Client4) GetOAuthAppsRoute

func (c *Client4) GetOAuthAppsRoute() string

func (*Client4) GetOldClientConfig

func (c *Client4) GetOldClientConfig(etag string) (map[string]string, *Response)

GetOldClientConfig will retrieve the parts of the server configuration needed by the client, formatted in the old format.

func (*Client4) GetOldClientLicense

func (c *Client4) GetOldClientLicense(etag string) (map[string]string, *Response)

GetOldClientLicense will retrieve the parts of the server license needed by the client, formatted in the old format.

func (*Client4) GetOpenGraphRoute

func (c *Client4) GetOpenGraphRoute() string

func (*Client4) GetOutgoingWebhook

func (c *Client4) GetOutgoingWebhook(hookId string) (*OutgoingWebhook, *Response)

GetOutgoingWebhook outgoing webhooks on the system requested by Hook Id.

func (*Client4) GetOutgoingWebhookRoute

func (c *Client4) GetOutgoingWebhookRoute(hookID string) string

func (*Client4) GetOutgoingWebhooks

func (c *Client4) GetOutgoingWebhooks(page int, perPage int, etag string) ([]*OutgoingWebhook, *Response)

GetOutgoingWebhooks returns a page of outgoing webhooks on the system. Page counting starts at 0.

func (*Client4) GetOutgoingWebhooksForChannel

func (c *Client4) GetOutgoingWebhooksForChannel(channelId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response)

GetOutgoingWebhooksForChannel returns a page of outgoing webhooks for a channel. Page counting starts at 0.

func (*Client4) GetOutgoingWebhooksForTeam

func (c *Client4) GetOutgoingWebhooksForTeam(teamId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response)

GetOutgoingWebhooksForTeam returns a page of outgoing webhooks for a team. Page counting starts at 0.

func (*Client4) GetOutgoingWebhooksRoute

func (c *Client4) GetOutgoingWebhooksRoute() string

func (*Client4) GetPing

func (c *Client4) GetPing() (string, *Response)

GetPing will return ok if the running goRoutines are below the threshold and unhealthy for above.

func (*Client4) GetPingWithServerStatus

func (c *Client4) GetPingWithServerStatus() (string, *Response)

GetPingWithServerStatus will return ok if several basic server health checks all pass successfully.

func (*Client4) GetPinnedPosts

func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Response)

GetPinnedPosts gets a list of pinned posts.

func (*Client4) GetPluginRoute

func (c *Client4) GetPluginRoute(pluginId string) string

func (*Client4) GetPluginStatuses

func (c *Client4) GetPluginStatuses() (PluginStatuses, *Response)

GetPluginStatuses will return the plugins installed on any server in the cluster, for reporting to the administrator via the system console. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) GetPlugins

func (c *Client4) GetPlugins() (*PluginsResponse, *Response)

GetPlugins will return a list of plugin manifests for currently active plugins. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) GetPluginsRoute

func (c *Client4) GetPluginsRoute() string

func (*Client4) GetPost

func (c *Client4) GetPost(postId string, etag string) (*Post, *Response)

GetPost gets a single post.

func (*Client4) GetPostRoute

func (c *Client4) GetPostRoute(postId string) string

func (*Client4) GetPostThread

func (c *Client4) GetPostThread(postId string, etag string) (*PostList, *Response)

GetPostThread gets a post with all the other posts in the same thread.

func (*Client4) GetPostsAfter

func (c *Client4) GetPostsAfter(channelId, postId string, page, perPage int, etag string) (*PostList, *Response)

GetPostsAfter gets a page of posts that were posted after the post provided.

func (*Client4) GetPostsAroundLastUnread

func (c *Client4) GetPostsAroundLastUnread(userId, channelId string, limitBefore, limitAfter int) (*PostList, *Response)

GetPostsAroundLastUnread gets a list of posts around last unread post by a user in a channel.

func (*Client4) GetPostsBefore

func (c *Client4) GetPostsBefore(channelId, postId string, page, perPage int, etag string) (*PostList, *Response)

GetPostsBefore gets a page of posts that were posted before the post provided.

func (*Client4) GetPostsEphemeralRoute

func (c *Client4) GetPostsEphemeralRoute() string

func (*Client4) GetPostsForChannel

func (c *Client4) GetPostsForChannel(channelId string, page, perPage int, etag string) (*PostList, *Response)

GetPostsForChannel gets a page of posts with an array for ordering for a channel.

func (*Client4) GetPostsRoute

func (c *Client4) GetPostsRoute() string

func (*Client4) GetPostsSince

func (c *Client4) GetPostsSince(channelId string, time int64) (*PostList, *Response)

GetPostsSince gets posts created after a specified time as Unix time in milliseconds.

func (*Client4) GetPreferenceByCategoryAndName

func (c *Client4) GetPreferenceByCategoryAndName(userId string, category string, preferenceName string) (*Preference, *Response)

GetPreferenceByCategoryAndName returns the user's preferences from the provided category and preference name string.

func (*Client4) GetPreferences

func (c *Client4) GetPreferences(userId string) (Preferences, *Response)

GetPreferences returns the user's preferences.

func (*Client4) GetPreferencesByCategory

func (c *Client4) GetPreferencesByCategory(userId string, category string) (Preferences, *Response)

GetPreferencesByCategory returns the user's preferences from the provided category string.

func (*Client4) GetPreferencesRoute

func (c *Client4) GetPreferencesRoute(userId string) string

func (*Client4) GetPrivateChannelsForTeam added in v5.26.0

func (c *Client4) GetPrivateChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response)

GetPrivateChannelsForTeam returns a list of private channels based on the provided team id string.

func (*Client4) GetProfileImage

func (c *Client4) GetProfileImage(userId, etag string) ([]byte, *Response)

GetProfileImage gets user's profile image. Must be logged in.

func (*Client4) GetPublicChannelsByIdsForTeam

func (c *Client4) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) ([]*Channel, *Response)

GetPublicChannelsByIdsForTeam returns a list of public channels based on provided team id string.

func (*Client4) GetPublicChannelsForTeam

func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response)

GetPublicChannelsForTeam returns a list of public channels based on the provided team id string.

func (*Client4) GetPublishUserTypingRoute added in v5.26.0

func (c *Client4) GetPublishUserTypingRoute(userId string) string

func (*Client4) GetReactions

func (c *Client4) GetReactions(postId string) ([]*Reaction, *Response)

GetReactions returns a list of reactions to a post.

func (*Client4) GetReactionsRoute

func (c *Client4) GetReactionsRoute() string

func (*Client4) GetRecentlyActiveUsersInTeam

func (c *Client4) GetRecentlyActiveUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)

GetRecentlyActiveUsersInTeam returns a page of users on a team. Page counting starts at 0.

func (*Client4) GetRedirectLocation

func (c *Client4) GetRedirectLocation(urlParam, etag string) (string, *Response)

GetRedirectLocation retrieves the value of the 'Location' header of an HTTP response for a given URL.

func (*Client4) GetRedirectLocationRoute

func (c *Client4) GetRedirectLocationRoute() string

func (*Client4) GetRole

func (c *Client4) GetRole(id string) (*Role, *Response)

GetRole gets a single role by ID.

func (*Client4) GetRoleByName

func (c *Client4) GetRoleByName(name string) (*Role, *Response)

GetRoleByName gets a single role by Name.

func (*Client4) GetRolesByNames

func (c *Client4) GetRolesByNames(roleNames []string) ([]*Role, *Response)

GetRolesByNames returns a list of roles based on the provided role names.

func (*Client4) GetRolesRoute

func (c *Client4) GetRolesRoute() string

func (*Client4) GetSamlCertificateStatus

func (c *Client4) GetSamlCertificateStatus() (*SamlCertificateStatus, *Response)

GetSamlCertificateStatus returns metadata for the SAML configuration.

func (*Client4) GetSamlMetadata

func (c *Client4) GetSamlMetadata() (string, *Response)

GetSamlMetadata returns metadata for the SAML configuration.

func (*Client4) GetSamlMetadataFromIdp added in v5.20.0

func (c *Client4) GetSamlMetadataFromIdp(samlMetadataURL string) (*SamlMetadataResponse, *Response)

func (*Client4) GetSamlRoute

func (c *Client4) GetSamlRoute() string

func (*Client4) GetScheme

func (c *Client4) GetScheme(id string) (*Scheme, *Response)

GetScheme gets a single scheme by ID.

func (*Client4) GetSchemeRoute

func (c *Client4) GetSchemeRoute(id string) string

func (*Client4) GetSchemes

func (c *Client4) GetSchemes(scope string, page int, perPage int) ([]*Scheme, *Response)

GetSchemes gets all schemes, sorted with the most recently created first, optionally filtered by scope.

func (*Client4) GetSchemesRoute

func (c *Client4) GetSchemesRoute() string

func (*Client4) GetServerBusy added in v5.22.0

func (c *Client4) GetServerBusy() (*ServerBusyState, *Response)

GetServerBusy returns the current ServerBusyState including the time when a server marked busy will automatically have the flag cleared.

func (*Client4) GetServerBusyExpires deprecated added in v5.20.0

func (c *Client4) GetServerBusyExpires() (*time.Time, *Response)

GetServerBusyExpires returns the time when a server marked busy will automatically have the flag cleared.

Deprecated: Use GetServerBusy instead.

func (*Client4) GetServerBusyRoute added in v5.20.0

func (c *Client4) GetServerBusyRoute() string

func (*Client4) GetSessions

func (c *Client4) GetSessions(userId, etag string) ([]*Session, *Response)

GetSessions returns a list of sessions based on the provided user id string.

func (*Client4) GetSidebarCategoriesForTeamForUser added in v5.26.0

func (c *Client4) GetSidebarCategoriesForTeamForUser(userID, teamID, etag string) (*OrderedSidebarCategories, *Response)

func (*Client4) GetSidebarCategoryForTeamForUser added in v5.26.0

func (c *Client4) GetSidebarCategoryForTeamForUser(userID, teamID, categoryID, etag string) (*SidebarCategoryWithChannels, *Response)

func (*Client4) GetSidebarCategoryOrderForTeamForUser added in v5.26.0

func (c *Client4) GetSidebarCategoryOrderForTeamForUser(userID, teamID, etag string) ([]string, *Response)

func (*Client4) GetSortedEmojiList

func (c *Client4) GetSortedEmojiList(page, perPage int, sort string) ([]*Emoji, *Response)

GetSortedEmojiList returns a page of custom emoji on the system sorted based on the sort parameter, blank for no sorting and "name" to sort by emoji names.

func (*Client4) GetSupportedTimezone

func (c *Client4) GetSupportedTimezone() ([]string, *Response)

GetSupportedTimezone returns a page of supported timezones on the system.

func (*Client4) GetSystemRoute

func (c *Client4) GetSystemRoute() string

func (*Client4) GetTeam

func (c *Client4) GetTeam(teamId, etag string) (*Team, *Response)

GetTeam returns a team based on the provided team id string.

func (*Client4) GetTeamAutoCompleteCommandsRoute

func (c *Client4) GetTeamAutoCompleteCommandsRoute(teamId string) string

func (*Client4) GetTeamByName

func (c *Client4) GetTeamByName(name, etag string) (*Team, *Response)

GetTeamByName returns a team based on the provided team name string.

func (*Client4) GetTeamByNameRoute

func (c *Client4) GetTeamByNameRoute(teamName string) string

func (*Client4) GetTeamIcon

func (c *Client4) GetTeamIcon(teamId, etag string) ([]byte, *Response)

GetTeamIcon gets the team icon of the team.

func (*Client4) GetTeamImportRoute

func (c *Client4) GetTeamImportRoute(teamId string) string

func (*Client4) GetTeamInviteInfo

func (c *Client4) GetTeamInviteInfo(inviteId string) (*Team, *Response)

GetTeamInviteInfo returns a team object from an invite id containing sanitized information.

func (*Client4) GetTeamMember

func (c *Client4) GetTeamMember(teamId, userId, etag string) (*TeamMember, *Response)

GetTeamMember returns a team member based on the provided team and user id strings.

func (*Client4) GetTeamMemberRoute

func (c *Client4) GetTeamMemberRoute(teamId, userId string) string

func (*Client4) GetTeamMembers

func (c *Client4) GetTeamMembers(teamId string, page int, perPage int, etag string) ([]*TeamMember, *Response)

GetTeamMembers returns team members based on the provided team id string.

func (*Client4) GetTeamMembersByIds

func (c *Client4) GetTeamMembersByIds(teamId string, userIds []string) ([]*TeamMember, *Response)

GetTeamMembersByIds will return an array of team members based on the team id and a list of user ids provided. Must be authenticated.

func (*Client4) GetTeamMembersForUser

func (c *Client4) GetTeamMembersForUser(userId string, etag string) ([]*TeamMember, *Response)

GetTeamMembersForUser returns the team members for a user.

func (*Client4) GetTeamMembersRoute

func (c *Client4) GetTeamMembersRoute(teamId string) string

func (*Client4) GetTeamMembersSortAndWithoutDeletedUsers added in v5.24.0

func (c *Client4) GetTeamMembersSortAndWithoutDeletedUsers(teamId string, page int, perPage int, sort string, exclude_deleted_users bool, etag string) ([]*TeamMember, *Response)

GetTeamMembersWithoutDeletedUsers returns team members based on the provided team id string. Additional parameters of sort and exclude_deleted_users accepted as well Could not add it to above function due to it be a breaking change.

func (*Client4) GetTeamRoute

func (c *Client4) GetTeamRoute(teamId string) string

func (*Client4) GetTeamSchemeRoute

func (c *Client4) GetTeamSchemeRoute(teamId string) string

func (*Client4) GetTeamStats

func (c *Client4) GetTeamStats(teamId, etag string) (*TeamStats, *Response)

GetTeamStats returns a team stats based on the team id string. Must be authenticated.

func (*Client4) GetTeamStatsRoute

func (c *Client4) GetTeamStatsRoute(teamId string) string

func (*Client4) GetTeamUnread

func (c *Client4) GetTeamUnread(teamId, userId string) (*TeamUnread, *Response)

GetTeamUnread will return a TeamUnread object that contains the amount of unread messages and mentions the user has for the specified team. Must be authenticated.

func (*Client4) GetTeamsForScheme

func (c *Client4) GetTeamsForScheme(schemeId string, page int, perPage int) ([]*Team, *Response)

GetTeamsForScheme gets the teams using this scheme, sorted alphabetically by display name.

func (*Client4) GetTeamsForUser

func (c *Client4) GetTeamsForUser(userId, etag string) ([]*Team, *Response)

GetTeamsForUser returns a list of teams a user is on. Must be logged in as the user or be a system administrator.

func (*Client4) GetTeamsRoute

func (c *Client4) GetTeamsRoute() string

func (*Client4) GetTeamsUnreadForUser

func (c *Client4) GetTeamsUnreadForUser(userId, teamIdToExclude string) ([]*TeamUnread, *Response)

GetTeamsUnreadForUser will return an array with TeamUnread objects that contain the amount of unread messages and mentions the current user has for the teams it belongs to. An optional team ID can be set to exclude that team from the results. Must be authenticated.

func (*Client4) GetTermsOfService

func (c *Client4) GetTermsOfService(etag string) (*TermsOfService, *Response)

GetTermsOfService fetches the latest terms of service

func (*Client4) GetTermsOfServiceRoute

func (c *Client4) GetTermsOfServiceRoute() string

func (*Client4) GetTestEmailRoute

func (c *Client4) GetTestEmailRoute() string

func (*Client4) GetTestS3Route

func (c *Client4) GetTestS3Route() string

func (*Client4) GetTestSiteURLRoute

func (c *Client4) GetTestSiteURLRoute() string

func (*Client4) GetTimezonesRoute

func (c *Client4) GetTimezonesRoute() string

func (*Client4) GetTotalUsersStats

func (c *Client4) GetTotalUsersStats(etag string) (*UsersStats, *Response)

GetTotalUsersStats returns a total system user stats. Must be authenticated.

func (*Client4) GetTotalUsersStatsRoute

func (c *Client4) GetTotalUsersStatsRoute() string

func (*Client4) GetUpload added in v5.28.0

func (c *Client4) GetUpload(uploadId string) (*UploadSession, *Response)

GetUpload returns the upload session for the specified uploadId.

func (*Client4) GetUploadRoute added in v5.28.0

func (c *Client4) GetUploadRoute(uploadId string) string

func (*Client4) GetUploadsForUser added in v5.28.0

func (c *Client4) GetUploadsForUser(userId string) ([]*UploadSession, *Response)

GetUploadsForUser returns the upload sessions created by the specified userId.

func (*Client4) GetUploadsRoute added in v5.28.0

func (c *Client4) GetUploadsRoute() string

func (*Client4) GetUser

func (c *Client4) GetUser(userId, etag string) (*User, *Response)

GetUser returns a user based on the provided user id string.

func (*Client4) GetUserAccessToken

func (c *Client4) GetUserAccessToken(tokenId string) (*UserAccessToken, *Response)

GetUserAccessToken will get a user access tokens' id, description, is_active and the user_id of the user it is for. The actual token will not be returned. Must have the 'read_user_access_token' permission and if getting for another user, must have the 'edit_other_users' permission.

func (*Client4) GetUserAccessTokenRoute

func (c *Client4) GetUserAccessTokenRoute(tokenId string) string

func (*Client4) GetUserAccessTokens

func (c *Client4) GetUserAccessTokens(page int, perPage int) ([]*UserAccessToken, *Response)

GetUserAccessTokens will get a page of access tokens' id, description, is_active and the user_id in the system. The actual token will not be returned. Must have the 'manage_system' permission.

func (*Client4) GetUserAccessTokensForUser

func (c *Client4) GetUserAccessTokensForUser(userId string, page, perPage int) ([]*UserAccessToken, *Response)

GetUserAccessTokensForUser will get a paged list of user access tokens showing id, description and user_id for each. The actual tokens will not be returned. Must have the 'read_user_access_token' permission and if getting for another user, must have the 'edit_other_users' permission.

func (*Client4) GetUserAccessTokensRoute

func (c *Client4) GetUserAccessTokensRoute() string

func (*Client4) GetUserAudits

func (c *Client4) GetUserAudits(userId string, page int, perPage int, etag string) (Audits, *Response)

GetUserAudits returns a list of audit based on the provided user id string.

func (*Client4) GetUserByEmail

func (c *Client4) GetUserByEmail(email, etag string) (*User, *Response)

GetUserByEmail returns a user based on the provided user email string.

func (*Client4) GetUserByEmailRoute

func (c *Client4) GetUserByEmailRoute(email string) string

func (*Client4) GetUserByUsername

func (c *Client4) GetUserByUsername(userName, etag string) (*User, *Response)

GetUserByUsername returns a user based on the provided user name string.

func (*Client4) GetUserByUsernameRoute

func (c *Client4) GetUserByUsernameRoute(userName string) string

func (*Client4) GetUserCategoryRoute added in v5.26.0

func (c *Client4) GetUserCategoryRoute(userID, teamID string) string

func (*Client4) GetUserRoute

func (c *Client4) GetUserRoute(userId string) string

func (*Client4) GetUserStatus

func (c *Client4) GetUserStatus(userId, etag string) (*Status, *Response)

GetUserStatus returns a user based on the provided user id string.

func (*Client4) GetUserStatusRoute

func (c *Client4) GetUserStatusRoute(userId string) string

func (*Client4) GetUserStatusesRoute

func (c *Client4) GetUserStatusesRoute() string

func (*Client4) GetUserTermsOfService

func (c *Client4) GetUserTermsOfService(userId, etag string) (*UserTermsOfService, *Response)

GetUserTermsOfService fetches user's latest terms of service action if the latest action was for acceptance.

func (*Client4) GetUserTermsOfServiceRoute

func (c *Client4) GetUserTermsOfServiceRoute(userId string) string

func (*Client4) GetUsers

func (c *Client4) GetUsers(page int, perPage int, etag string) ([]*User, *Response)

GetUsers returns a page of users on the system. Page counting starts at 0.

func (*Client4) GetUsersByGroupChannelIds

func (c *Client4) GetUsersByGroupChannelIds(groupChannelIds []string) (map[string][]*User, *Response)

GetUsersByGroupChannelIds returns a map with channel ids as keys and a list of users as values based on the provided user ids.

func (*Client4) GetUsersByIds

func (c *Client4) GetUsersByIds(userIds []string) ([]*User, *Response)

GetUsersByIds returns a list of users based on the provided user ids.

func (*Client4) GetUsersByIdsWithOptions

func (c *Client4) GetUsersByIdsWithOptions(userIds []string, options *UserGetByIdsOptions) ([]*User, *Response)

GetUsersByIds returns a list of users based on the provided user ids.

func (*Client4) GetUsersByUsernames

func (c *Client4) GetUsersByUsernames(usernames []string) ([]*User, *Response)

GetUsersByUsernames returns a list of users based on the provided usernames.

func (*Client4) GetUsersInChannel

func (c *Client4) GetUsersInChannel(channelId string, page int, perPage int, etag string) ([]*User, *Response)

GetUsersInChannel returns a page of users in a channel. Page counting starts at 0.

func (*Client4) GetUsersInChannelByStatus

func (c *Client4) GetUsersInChannelByStatus(channelId string, page int, perPage int, etag string) ([]*User, *Response)

GetUsersInChannelByStatus returns a page of users in a channel. Page counting starts at 0. Sorted by Status

func (*Client4) GetUsersInGroup added in v5.26.0

func (c *Client4) GetUsersInGroup(groupID string, page int, perPage int, etag string) ([]*User, *Response)

GetUsersInGroup returns a page of users in a group. Page counting starts at 0.

func (*Client4) GetUsersInTeam

func (c *Client4) GetUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)

GetUsersInTeam returns a page of users on a team. Page counting starts at 0.

func (*Client4) GetUsersNotInChannel

func (c *Client4) GetUsersNotInChannel(teamId, channelId string, page int, perPage int, etag string) ([]*User, *Response)

GetUsersNotInChannel returns a page of users not in a channel. Page counting starts at 0.

func (*Client4) GetUsersNotInTeam

func (c *Client4) GetUsersNotInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)

GetUsersNotInTeam returns a page of users who are not in a team. Page counting starts at 0.

func (*Client4) GetUsersRoute

func (c *Client4) GetUsersRoute() string

func (*Client4) GetUsersStatusesByIds

func (c *Client4) GetUsersStatusesByIds(userIds []string) ([]*Status, *Response)

GetUsersStatusesByIds returns a list of users status based on the provided user ids.

func (*Client4) GetUsersWithoutTeam

func (c *Client4) GetUsersWithoutTeam(page int, perPage int, etag string) ([]*User, *Response)

GetUsersWithoutTeam returns a page of users on the system that aren't on any teams. Page counting starts at 0.

func (*Client4) GetWebappPlugins

func (c *Client4) GetWebappPlugins() ([]*Manifest, *Response)

GetWebappPlugins will return a list of plugins that the webapp should download. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) ImportTeam

func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, teamId string) (map[string]string, *Response)

ImportTeam will import an exported team from other app into a existing team.

func (*Client4) InstallMarketplacePlugin

func (c *Client4) InstallMarketplacePlugin(request *InstallMarketplacePluginRequest) (*Manifest, *Response)

InstallMarketplacePlugin will install marketplace plugin. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) InstallPluginFromUrl

func (c *Client4) InstallPluginFromUrl(downloadUrl string, force bool) (*Manifest, *Response)

func (*Client4) InvalidateCaches

func (c *Client4) InvalidateCaches() (bool, *Response)

InvalidateCaches will purge the cache and can affect the performance while is cleaning.

func (*Client4) InvalidateEmailInvites

func (c *Client4) InvalidateEmailInvites() (bool, *Response)

InvalidateEmailInvites will invalidate active email invitations that have not been accepted by the user.

func (*Client4) InviteGuestsToTeam

func (c *Client4) InviteGuestsToTeam(teamId string, userEmails []string, channels []string, message string) (bool, *Response)

InviteGuestsToTeam invite guest by email to some channels in a team.

func (*Client4) InviteGuestsToTeamGracefully added in v5.20.0

func (c *Client4) InviteGuestsToTeamGracefully(teamId string, userEmails []string, channels []string, message string) ([]*EmailInviteWithError, *Response)

InviteGuestsToTeam invite guest by email to some channels in a team.

func (*Client4) InviteUsersToTeam

func (c *Client4) InviteUsersToTeam(teamId string, userEmails []string) (bool, *Response)

InviteUsersToTeam invite users by email to the team.

func (*Client4) InviteUsersToTeamGracefully added in v5.20.0

func (c *Client4) InviteUsersToTeamGracefully(teamId string, userEmails []string) ([]*EmailInviteWithError, *Response)

InviteUsersToTeam invite users by email to the team.

func (*Client4) LinkGroupSyncable

func (c *Client4) LinkGroupSyncable(groupID, syncableID string, syncableType GroupSyncableType, patch *GroupSyncablePatch) (*GroupSyncable, *Response)

func (*Client4) LinkLdapGroup

func (c *Client4) LinkLdapGroup(dn string) (*Group, *Response)

LinkLdapGroup creates or undeletes a Mattermost group and associates it to the given LDAP group DN.

func (*Client4) ListAutocompleteCommands

func (c *Client4) ListAutocompleteCommands(teamId string) ([]*Command, *Response)

ListAutocompleteCommands will retrieve a list of commands available in the team.

func (*Client4) ListCommandAutocompleteSuggestions added in v5.24.0

func (c *Client4) ListCommandAutocompleteSuggestions(userInput, teamId string) ([]AutocompleteSuggestion, *Response)

ListCommandAutocompleteSuggestions will retrieve a list of suggestions for a userInput.

func (*Client4) ListCommands

func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Response)

ListCommands will retrieve a list of commands available in the team.

func (*Client4) Login

func (c *Client4) Login(loginId string, password string) (*User, *Response)

Login authenticates a user by login id, which can be username, email or some sort of SSO identifier based on server configuration, and a password.

func (*Client4) LoginById

func (c *Client4) LoginById(id string, password string) (*User, *Response)

LoginById authenticates a user by user id and password.

func (*Client4) LoginByLdap

func (c *Client4) LoginByLdap(loginId string, password string) (*User, *Response)

LoginByLdap authenticates a user by LDAP id and password.

func (*Client4) LoginWithDevice

func (c *Client4) LoginWithDevice(loginId string, password string, deviceId string) (*User, *Response)

LoginWithDevice authenticates a user by login id (username, email or some sort of SSO identifier based on configuration), password and attaches a device id to the session.

func (*Client4) LoginWithMFA

func (c *Client4) LoginWithMFA(loginId, password, mfaToken string) (*User, *Response)

LoginWithMFA logs a user in with a MFA token

func (*Client4) Logout

func (c *Client4) Logout() (bool, *Response)

Logout terminates the current user's session.

func (*Client4) MarkNoticesViewed added in v5.28.0

func (c *Client4) MarkNoticesViewed(ids []string) *Response

func (*Client4) MigrateAuthToLdap added in v5.28.0

func (c *Client4) MigrateAuthToLdap(fromAuthService string, matchField string, force bool) (bool, *Response)

func (*Client4) MigrateAuthToSaml added in v5.28.0

func (c *Client4) MigrateAuthToSaml(fromAuthService string, usersMap map[string]string, auto bool) (bool, *Response)

func (*Client4) MigrateConfig added in v5.28.0

func (c *Client4) MigrateConfig(from, to string) (bool, *Response)

MigrateConfig will migrate existing config to the new one.

func (*Client4) MigrateIdLdap added in v5.26.0

func (c *Client4) MigrateIdLdap(toAttribute string) (bool, *Response)

MigrateIdLdap migrates the LDAP enabled users to given attribute

func (*Client4) MockSession

func (c *Client4) MockSession(token string)

MockSession is deprecated in favour of SetToken

func (*Client4) MoveChannel added in v5.26.0

func (c *Client4) MoveChannel(channelId, teamId string, force bool) (*Channel, *Response)

MoveChannel moves the channel to the destination team.

func (*Client4) MoveCommand added in v5.22.0

func (c *Client4) MoveCommand(teamId string, commandId string) (bool, *Response)

MoveCommand moves a command to a different team.

func (*Client4) Must

func (c *Client4) Must(result interface{}, resp *Response) interface{}

Must is a convenience function used for testing.

func (*Client4) OpenGraph

func (c *Client4) OpenGraph(url string) (map[string]string, *Response)

OpenGraph return the open graph metadata for a particular url if the site have the metadata.

func (*Client4) OpenInteractiveDialog

func (c *Client4) OpenInteractiveDialog(request OpenDialogRequest) (bool, *Response)

OpenInteractiveDialog sends a WebSocket event to a user's clients to open interactive dialogs, based on the provided trigger ID and other provided data. Used with interactive message buttons, menus and slash commands.

func (*Client4) PatchBot

func (c *Client4) PatchBot(userId string, patch *BotPatch) (*Bot, *Response)

PatchBot partially updates a bot. Any missing fields are not updated.

func (*Client4) PatchChannel

func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel, *Response)

PatchChannel partially updates a channel. Any missing fields are not updated.

func (*Client4) PatchChannelModerations added in v5.22.0

func (c *Client4) PatchChannelModerations(channelID string, patch []*ChannelModerationPatch) ([]*ChannelModeration, *Response)

func (*Client4) PatchConfig added in v5.20.0

func (c *Client4) PatchConfig(config *Config) (*Config, *Response)

func (*Client4) PatchGroup

func (c *Client4) PatchGroup(groupID string, patch *GroupPatch) (*Group, *Response)

func (*Client4) PatchGroupSyncable

func (c *Client4) PatchGroupSyncable(groupID, syncableID string, syncableType GroupSyncableType, patch *GroupSyncablePatch) (*GroupSyncable, *Response)

func (*Client4) PatchPost

func (c *Client4) PatchPost(postId string, patch *PostPatch) (*Post, *Response)

PatchPost partially updates a post. Any missing fields are not updated.

func (*Client4) PatchRole

func (c *Client4) PatchRole(roleId string, patch *RolePatch) (*Role, *Response)

PatchRole partially updates a role in the system. Any missing fields are not updated.

func (*Client4) PatchScheme

func (c *Client4) PatchScheme(id string, patch *SchemePatch) (*Scheme, *Response)

PatchScheme partially updates a scheme in the system. Any missing fields are not updated.

func (*Client4) PatchTeam

func (c *Client4) PatchTeam(teamId string, patch *TeamPatch) (*Team, *Response)

PatchTeam partially updates a team. Any missing fields are not updated.

func (*Client4) PatchUser

func (c *Client4) PatchUser(userId string, patch *UserPatch) (*User, *Response)

PatchUser partially updates a user in the system. Any missing fields are not updated.

func (*Client4) PermanentDeleteAllUsers added in v5.26.0

func (c *Client4) PermanentDeleteAllUsers() (bool, *Response)

PermanentDeleteAll permanently deletes all users in the system. This is a local only endpoint

func (*Client4) PermanentDeleteChannel added in v5.28.0

func (c *Client4) PermanentDeleteChannel(channelId string) (bool, *Response)

PermanentDeleteChannel deletes a channel based on the provided channel id string.

func (*Client4) PermanentDeleteTeam

func (c *Client4) PermanentDeleteTeam(teamId string) (bool, *Response)

PermanentDeleteTeam deletes the team, should only be used when needed for compliance and the like.

func (*Client4) PermanentDeleteUser added in v5.28.0

func (c *Client4) PermanentDeleteUser(userId string) (bool, *Response)

PermanentDeleteUser deletes a user in the system based on the provided user id string.

func (*Client4) PinPost

func (c *Client4) PinPost(postId string) (bool, *Response)

PinPost pin a post based on provided post id string.

func (*Client4) PostLog

func (c *Client4) PostLog(message map[string]string) (map[string]string, *Response)

PostLog is a convenience Web Service call so clients can log messages into the server-side logs. For example we typically log javascript error messages into the server-side. It returns the log message if the logging was successful.

func (*Client4) PromoteGuestToUser

func (c *Client4) PromoteGuestToUser(guestId string) (bool, *Response)

PromoteGuestToUser convert a guest into a regular user

func (*Client4) PublishUserTyping added in v5.26.0

func (c *Client4) PublishUserTyping(userID string, typingRequest TypingRequest) (bool, *Response)

PublishUserTyping publishes a user is typing websocket event based on the provided TypingRequest.

func (*Client4) PurgeBleveIndexes added in v5.24.0

func (c *Client4) PurgeBleveIndexes() (bool, *Response)

PurgeBleveIndexes immediately deletes all Bleve indexes.

func (*Client4) PurgeElasticsearchIndexes

func (c *Client4) PurgeElasticsearchIndexes() (bool, *Response)

PurgeElasticsearchIndexes immediately deletes all Elasticsearch indexes.

func (*Client4) RegenCommandToken

func (c *Client4) RegenCommandToken(commandId string) (string, *Response)

RegenCommandToken will create a new token if the user have the right permissions.

func (*Client4) RegenOutgoingHookToken

func (c *Client4) RegenOutgoingHookToken(hookId string) (*OutgoingWebhook, *Response)

RegenOutgoingHookToken regenerate the outgoing webhook token.

func (*Client4) RegenerateOAuthAppSecret

func (c *Client4) RegenerateOAuthAppSecret(appId string) (*OAuthApp, *Response)

RegenerateOAuthAppSecret regenerates the client secret for a registered OAuth 2.0 client application.

func (*Client4) RegenerateTeamInviteId

func (c *Client4) RegenerateTeamInviteId(teamId string) (*Team, *Response)

RegenerateTeamInviteId requests a new invite ID to be generated.

func (*Client4) RegisterTermsOfServiceAction

func (c *Client4) RegisterTermsOfServiceAction(userId, termsOfServiceId string, accepted bool) (*bool, *Response)

RegisterTermsOfServiceAction saves action performed by a user against a specific terms of service.

func (*Client4) ReloadConfig

func (c *Client4) ReloadConfig() (bool, *Response)

ReloadConfig will reload the server configuration.

func (*Client4) RemoveLicenseFile

func (c *Client4) RemoveLicenseFile() (bool, *Response)

RemoveLicenseFile will remove the server license it exists. Note that this will disable all enterprise features.

func (*Client4) RemovePlugin

func (c *Client4) RemovePlugin(id string) (bool, *Response)

RemovePlugin will disable and delete a plugin. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) RemoveTeamIcon

func (c *Client4) RemoveTeamIcon(teamId string) (bool, *Response)

RemoveTeamIcon updates LastTeamIconUpdate to 0 which indicates team icon is removed.

func (*Client4) RemoveTeamMember

func (c *Client4) RemoveTeamMember(teamId, userId string) (bool, *Response)

RemoveTeamMember will remove a user from a team.

func (*Client4) RemoveUserFromChannel

func (c *Client4) RemoveUserFromChannel(channelId, userId string) (bool, *Response)

RemoveUserFromChannel will delete the channel member object for a user, effectively removing the user from a channel.

func (*Client4) RequestTrialLicense added in v5.25.0

func (c *Client4) RequestTrialLicense(users int) (bool, *Response)

RequestTrialLicense will request a trial license and install it in the server

func (*Client4) ResetPassword

func (c *Client4) ResetPassword(token, newPassword string) (bool, *Response)

ResetPassword uses a recovery code to update reset a user's password.

func (*Client4) RestoreChannel

func (c *Client4) RestoreChannel(channelId string) (*Channel, *Response)

RestoreChannel restores a previously deleted channel. Any missing fields are not updated.

func (*Client4) RestoreTeam added in v5.24.0

func (c *Client4) RestoreTeam(teamId string) (*Team, *Response)

RestoreTeam restores a previously deleted team.

func (*Client4) RevokeAllSessions

func (c *Client4) RevokeAllSessions(userId string) (bool, *Response)

RevokeAllSessions revokes all sessions for the provided user id string.

func (*Client4) RevokeSession

func (c *Client4) RevokeSession(userId, sessionId string) (bool, *Response)

RevokeSession revokes a user session based on the provided user id and session id strings.

func (*Client4) RevokeSessionsFromAllUsers

func (c *Client4) RevokeSessionsFromAllUsers() (bool, *Response)

RevokeAllSessions revokes all sessions for all the users.

func (*Client4) RevokeUserAccessToken

func (c *Client4) RevokeUserAccessToken(tokenId string) (bool, *Response)

RevokeUserAccessToken will revoke a user access token by id. Must have the 'revoke_user_access_token' permission and if revoking for another user, must have the 'edit_other_users' permission.

func (*Client4) SaveReaction

func (c *Client4) SaveReaction(reaction *Reaction) (*Reaction, *Response)

SaveReaction saves an emoji reaction for a post. Returns the saved reaction if successful, otherwise an error will be returned.

func (*Client4) SearchAllChannels

func (c *Client4) SearchAllChannels(search *ChannelSearch) (*ChannelListWithTeamData, *Response)

SearchAllChannels search in all the channels. Must be a system administrator.

func (*Client4) SearchAllChannelsPaged

func (c *Client4) SearchAllChannelsPaged(search *ChannelSearch) (*ChannelsWithCount, *Response)

SearchAllChannelsPaged searches all the channels and returns the results paged with the total count.

func (*Client4) SearchArchivedChannels

func (c *Client4) SearchArchivedChannels(teamId string, search *ChannelSearch) ([]*Channel, *Response)

SearchArchivedChannels returns the archived channels on a team matching the provided search term.

func (*Client4) SearchChannels

func (c *Client4) SearchChannels(teamId string, search *ChannelSearch) ([]*Channel, *Response)

SearchChannels returns the channels on a team matching the provided search term.

func (*Client4) SearchEmoji

func (c *Client4) SearchEmoji(search *EmojiSearch) ([]*Emoji, *Response)

SearchEmoji returns a list of emoji matching some search criteria.

func (*Client4) SearchGroupChannels

func (c *Client4) SearchGroupChannels(search *ChannelSearch) ([]*Channel, *Response)

SearchGroupChannels returns the group channels of the user whose members' usernames match the search term.

func (*Client4) SearchPosts

func (c *Client4) SearchPosts(teamId string, terms string, isOrSearch bool) (*PostList, *Response)

SearchPosts returns any posts with matching terms string.

func (*Client4) SearchPostsWithMatches

func (c *Client4) SearchPostsWithMatches(teamId string, terms string, isOrSearch bool) (*PostSearchResults, *Response)

SearchPostsWithMatches returns any posts with matching terms string, including.

func (*Client4) SearchPostsWithParams

func (c *Client4) SearchPostsWithParams(teamId string, params *SearchParameter) (*PostList, *Response)

SearchPostsWithParams returns any posts with matching terms string.

func (*Client4) SearchTeams

func (c *Client4) SearchTeams(search *TeamSearch) ([]*Team, *Response)

SearchTeams returns teams matching the provided search term.

func (*Client4) SearchTeamsPaged

func (c *Client4) SearchTeamsPaged(search *TeamSearch) ([]*Team, int64, *Response)

SearchTeamsPaged returns a page of teams and the total count matching the provided search term.

func (*Client4) SearchUserAccessTokens

func (c *Client4) SearchUserAccessTokens(search *UserAccessTokenSearch) ([]*UserAccessToken, *Response)

SearchUserAccessTokens returns user access tokens matching the provided search term.

func (*Client4) SearchUsers

func (c *Client4) SearchUsers(search *UserSearch) ([]*User, *Response)

SearchUsers returns a list of users based on some search criteria.

func (*Client4) SendPasswordResetEmail

func (c *Client4) SendPasswordResetEmail(email string) (bool, *Response)

SendPasswordResetEmail will send a link for password resetting to a user with the provided email.

func (*Client4) SendVerificationEmail

func (c *Client4) SendVerificationEmail(email string) (bool, *Response)

SendVerificationEmail will send an email to the user with the provided email address, if that user exists. The email will contain a link that can be used to verify the user's email address.

func (*Client4) SetBoolString added in v5.26.0

func (c *Client4) SetBoolString(value bool, valueStr string)

SetBoolString is a helper method for overriding how true and false query string parameters are sent to the server.

This method is only exposed for testing. It is never necessary to configure these values in production.

func (*Client4) SetBotIconImage

func (c *Client4) SetBotIconImage(botUserId string, data []byte) (bool, *Response)

SetBotIconImage sets LHS bot icon image.

func (*Client4) SetDefaultProfileImage

func (c *Client4) SetDefaultProfileImage(userId string) (bool, *Response)

SetDefaultProfileImage resets the profile image to a default generated one.

func (*Client4) SetOAuthToken

func (c *Client4) SetOAuthToken(token string)

func (*Client4) SetPostUnread

func (c *Client4) SetPostUnread(userId string, postId string) *Response

SetPostUnread marks channel where post belongs as unread on the time of the provided post.

func (*Client4) SetProfileImage

func (c *Client4) SetProfileImage(userId string, data []byte) (bool, *Response)

SetProfileImage sets profile image of the user.

func (*Client4) SetServerBusy added in v5.20.0

func (c *Client4) SetServerBusy(secs int) (bool, *Response)

SetServerBusy will mark the server as busy, which disables non-critical services for `secs` seconds.

func (*Client4) SetTeamIcon

func (c *Client4) SetTeamIcon(teamId string, data []byte) (bool, *Response)

SetTeamIcon sets team icon of the team.

func (*Client4) SetToken

func (c *Client4) SetToken(token string)

func (*Client4) SoftDeleteTeam

func (c *Client4) SoftDeleteTeam(teamId string) (bool, *Response)

SoftDeleteTeam deletes the team softly (archive only, not permanent delete).

func (*Client4) SubmitInteractiveDialog

func (c *Client4) SubmitInteractiveDialog(request SubmitDialogRequest) (*SubmitDialogResponse, *Response)

SubmitInteractiveDialog will submit the provided dialog data to the integration configured by the URL. Used with the interactive dialogs integration feature.

func (*Client4) SwitchAccountType

func (c *Client4) SwitchAccountType(switchRequest *SwitchRequest) (string, *Response)

SwitchAccountType changes a user's login type from one type to another.

func (*Client4) SyncLdap

func (c *Client4) SyncLdap() (bool, *Response)

SyncLdap will force a sync with the configured LDAP server.

func (*Client4) TeamExists

func (c *Client4) TeamExists(name, etag string) (bool, *Response)

TeamExists returns true or false if the team exist or not.

func (*Client4) TeamMembersMinusGroupMembers

func (c *Client4) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page, perPage int, etag string) ([]*UserWithGroups, int64, *Response)

func (*Client4) TestElasticsearch

func (c *Client4) TestElasticsearch() (bool, *Response)

TestElasticsearch will attempt to connect to the configured Elasticsearch server and return OK if configured. correctly.

func (*Client4) TestEmail

func (c *Client4) TestEmail(config *Config) (bool, *Response)

TestEmail will attempt to connect to the configured SMTP server.

func (*Client4) TestLdap

func (c *Client4) TestLdap() (bool, *Response)

TestLdap will attempt to connect to the configured LDAP server and return OK if configured correctly.

func (*Client4) TestS3Connection

func (c *Client4) TestS3Connection(config *Config) (bool, *Response)

TestS3Connection will attempt to connect to the AWS S3.

func (*Client4) TestSiteURL

func (c *Client4) TestSiteURL(siteURL string) (bool, *Response)

TestSiteURL will test the validity of a site URL.

func (*Client4) UnlinkGroupSyncable

func (c *Client4) UnlinkGroupSyncable(groupID, syncableID string, syncableType GroupSyncableType) *Response

func (*Client4) UnlinkLdapGroup

func (c *Client4) UnlinkLdapGroup(dn string) (*Group, *Response)

UnlinkLdapGroup deletes the Mattermost group associated with the given LDAP group DN.

func (*Client4) UnpinPost

func (c *Client4) UnpinPost(postId string) (bool, *Response)

UnpinPost unpin a post based on provided post id string.

func (*Client4) UpdateChannel

func (c *Client4) UpdateChannel(channel *Channel) (*Channel, *Response)

UpdateChannel updates a channel based on the provided channel struct.

func (*Client4) UpdateChannelMemberSchemeRoles

func (c *Client4) UpdateChannelMemberSchemeRoles(channelId string, userId string, schemeRoles *SchemeRoles) (bool, *Response)

UpdateChannelMemberSchemeRoles will update the scheme-derived roles on a channel for a user.

func (*Client4) UpdateChannelNotifyProps

func (c *Client4) UpdateChannelNotifyProps(channelId, userId string, props map[string]string) (bool, *Response)

UpdateChannelNotifyProps will update the notification properties on a channel for a user.

func (*Client4) UpdateChannelPrivacy

func (c *Client4) UpdateChannelPrivacy(channelId string, privacy string) (*Channel, *Response)

UpdateChannelPrivacy updates channel privacy

func (*Client4) UpdateChannelRoles

func (c *Client4) UpdateChannelRoles(channelId, userId, roles string) (bool, *Response)

UpdateChannelRoles will update the roles on a channel for a user.

func (*Client4) UpdateChannelScheme

func (c *Client4) UpdateChannelScheme(channelId, schemeId string) (bool, *Response)

UpdateChannelScheme will update a channel's scheme.

func (*Client4) UpdateCommand

func (c *Client4) UpdateCommand(cmd *Command) (*Command, *Response)

UpdateCommand updates a command based on the provided Command struct.

func (*Client4) UpdateConfig

func (c *Client4) UpdateConfig(config *Config) (*Config, *Response)

UpdateConfig will update the server configuration.

func (*Client4) UpdateIncomingWebhook

func (c *Client4) UpdateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response)

UpdateIncomingWebhook updates an incoming webhook for a channel.

func (*Client4) UpdateOAuthApp

func (c *Client4) UpdateOAuthApp(app *OAuthApp) (*OAuthApp, *Response)

UpdateOAuthApp updates a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider.

func (*Client4) UpdateOutgoingWebhook

func (c *Client4) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response)

UpdateOutgoingWebhook creates an outgoing webhook for a team or channel.

func (*Client4) UpdatePassword added in v5.28.0

func (c *Client4) UpdatePassword(userId, currentPassword, newPassword string) *Response

func (*Client4) UpdatePost

func (c *Client4) UpdatePost(postId string, post *Post) (*Post, *Response)

UpdatePost updates a post based on the provided post struct.

func (*Client4) UpdatePreferences

func (c *Client4) UpdatePreferences(userId string, preferences *Preferences) (bool, *Response)

UpdatePreferences saves the user's preferences.

func (*Client4) UpdateSidebarCategoriesForTeamForUser added in v5.28.0

func (c *Client4) UpdateSidebarCategoriesForTeamForUser(userID, teamID string, categories []*SidebarCategoryWithChannels) ([]*SidebarCategoryWithChannels, *Response)

func (*Client4) UpdateSidebarCategoryForTeamForUser added in v5.26.0

func (c *Client4) UpdateSidebarCategoryForTeamForUser(userID, teamID, categoryID string, category *SidebarCategoryWithChannels) (*SidebarCategoryWithChannels, *Response)

func (*Client4) UpdateSidebarCategoryOrderForTeamForUser added in v5.26.0

func (c *Client4) UpdateSidebarCategoryOrderForTeamForUser(userID, teamID string, order []string) ([]string, *Response)

func (*Client4) UpdateTeam

func (c *Client4) UpdateTeam(team *Team) (*Team, *Response)

UpdateTeam will update a team.

func (*Client4) UpdateTeamMemberRoles

func (c *Client4) UpdateTeamMemberRoles(teamId, userId, newRoles string) (bool, *Response)

UpdateTeamMemberRoles will update the roles on a team for a user.

func (*Client4) UpdateTeamMemberSchemeRoles

func (c *Client4) UpdateTeamMemberSchemeRoles(teamId string, userId string, schemeRoles *SchemeRoles) (bool, *Response)

UpdateTeamMemberSchemeRoles will update the scheme-derived roles on a team for a user.

func (*Client4) UpdateTeamPrivacy added in v5.24.0

func (c *Client4) UpdateTeamPrivacy(teamId string, privacy string) (*Team, *Response)

UpdateTeamPrivacy modifies the team type (model.TEAM_OPEN <--> model.TEAM_INVITE) and sets the corresponding AllowOpenInvite appropriately.

func (*Client4) UpdateTeamScheme

func (c *Client4) UpdateTeamScheme(teamId, schemeId string) (bool, *Response)

UpdateTeamScheme will update a team's scheme.

func (*Client4) UpdateUser

func (c *Client4) UpdateUser(user *User) (*User, *Response)

UpdateUser updates a user in the system based on the provided user struct.

func (*Client4) UpdateUserActive

func (c *Client4) UpdateUserActive(userId string, active bool) (bool, *Response)

UpdateUserActive updates status of a user whether active or not.

func (*Client4) UpdateUserAuth

func (c *Client4) UpdateUserAuth(userId string, userAuth *UserAuth) (*UserAuth, *Response)

UpdateUserAuth updates a user AuthData (uthData, authService and password) in the system.

func (*Client4) UpdateUserHashedPassword added in v5.28.0

func (c *Client4) UpdateUserHashedPassword(userId, newHashedPassword string) (bool, *Response)

UpdateUserHashedPassword updates a user's password with an already-hashed password. Must be a system administrator.

func (*Client4) UpdateUserMfa

func (c *Client4) UpdateUserMfa(userId, code string, activate bool) (bool, *Response)

UpdateUserMfa activates multi-factor authentication for a user if activate is true and a valid code is provided. If activate is false, then code is not required and multi-factor authentication is disabled for the user.

func (*Client4) UpdateUserPassword

func (c *Client4) UpdateUserPassword(userId, currentPassword, newPassword string) (bool, *Response)

UpdateUserPassword updates a user's password. Must be logged in as the user or be a system administrator.

func (*Client4) UpdateUserRoles

func (c *Client4) UpdateUserRoles(userId, roles string) (bool, *Response)

UpdateUserRoles updates a user's roles in the system. A user can have "system_user" and "system_admin" roles.

func (*Client4) UpdateUserStatus

func (c *Client4) UpdateUserStatus(userId string, userStatus *Status) (*Status, *Response)

UpdateUserStatus sets a user's status based on the provided user id string.

func (*Client4) UploadBrandImage

func (c *Client4) UploadBrandImage(data []byte) (bool, *Response)

UploadBrandImage sets the brand image for the system.

func (*Client4) UploadData added in v5.28.0

func (c *Client4) UploadData(uploadId string, data io.Reader) (*FileInfo, *Response)

UploadData performs an upload. On success it returns a FileInfo object.

func (*Client4) UploadFile

func (c *Client4) UploadFile(data []byte, channelId string, filename string) (*FileUploadResponse, *Response)

UploadFile will upload a file to a channel using a multipart request, to be later attached to a post. This method is functionally equivalent to Client4.UploadFileAsRequestBody.

func (*Client4) UploadFileAsRequestBody

func (c *Client4) UploadFileAsRequestBody(data []byte, channelId string, filename string) (*FileUploadResponse, *Response)

UploadFileAsRequestBody will upload a file to a channel as the body of a request, to be later attached to a post. This method is functionally equivalent to Client4.UploadFile.

func (*Client4) UploadLdapPrivateCertificate added in v5.28.0

func (c *Client4) UploadLdapPrivateCertificate(data []byte) (bool, *Response)

UploadLdapPrivateCertificate will upload a private key for LDAP and set the config to use it.

func (*Client4) UploadLdapPublicCertificate added in v5.28.0

func (c *Client4) UploadLdapPublicCertificate(data []byte) (bool, *Response)

UploadLdapPublicCertificate will upload a public certificate for LDAP and set the config to use it.

func (*Client4) UploadLicenseFile

func (c *Client4) UploadLicenseFile(data []byte) (bool, *Response)

UploadLicenseFile will add a license file to the system.

func (*Client4) UploadPlugin

func (c *Client4) UploadPlugin(file io.Reader) (*Manifest, *Response)

UploadPlugin takes an io.Reader stream pointing to the contents of a .tar.gz plugin. WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE.

func (*Client4) UploadPluginForced

func (c *Client4) UploadPluginForced(file io.Reader) (*Manifest, *Response)

func (*Client4) UploadSamlIdpCertificate

func (c *Client4) UploadSamlIdpCertificate(data []byte, filename string) (bool, *Response)

UploadSamlIdpCertificate will upload an IDP certificate for SAML and set the config to use it. The filename parameter is deprecated and ignored: the server will pick a hard-coded filename when writing to disk.

func (*Client4) UploadSamlPrivateCertificate

func (c *Client4) UploadSamlPrivateCertificate(data []byte, filename string) (bool, *Response)

UploadSamlPrivateCertificate will upload a private key for SAML and set the config to use it. The filename parameter is deprecated and ignored: the server will pick a hard-coded filename when writing to disk.

func (*Client4) UploadSamlPublicCertificate

func (c *Client4) UploadSamlPublicCertificate(data []byte, filename string) (bool, *Response)

UploadSamlPublicCertificate will upload a public certificate for SAML and set the config to use it. The filename parameter is deprecated and ignored: the server will pick a hard-coded filename when writing to disk.

func (*Client4) VerifyUserEmail

func (c *Client4) VerifyUserEmail(token string) (bool, *Response)

VerifyUserEmail will verify a user's email using the supplied token.

func (*Client4) VerifyUserEmailWithoutToken added in v5.26.0

func (c *Client4) VerifyUserEmailWithoutToken(userId string) (*User, *Response)

VerifyUserEmailWithoutToken will verify a user's email by its Id. (Requires manage system role)

func (*Client4) ViewChannel

func (c *Client4) ViewChannel(userId string, view *ChannelView) (*ChannelViewResponse, *Response)

ViewChannel performs a view action for a user. Synonymous with switching channels or marking channels as read by a user.

type ClientRequirements

type ClientRequirements struct {
	AndroidLatestVersion string `access:"write_restrictable"`
	AndroidMinVersion    string `access:"write_restrictable"`
	DesktopLatestVersion string `access:"write_restrictable"`
	DesktopMinVersion    string `access:"write_restrictable"`
	IosLatestVersion     string `access:"write_restrictable"`
	IosMinVersion        string `access:"write_restrictable"`
}

type ClusterDiscovery

type ClusterDiscovery struct {
	Id          string `json:"id"`
	Type        string `json:"type"`
	ClusterName string `json:"cluster_name"`
	Hostname    string `json:"hostname"`
	GossipPort  int32  `json:"gossip_port"`
	Port        int32  `json:"port"`
	CreateAt    int64  `json:"create_at"`
	LastPingAt  int64  `json:"last_ping_at"`
}

func ClusterDiscoveryFromJson

func ClusterDiscoveryFromJson(data io.Reader) *ClusterDiscovery

func FilterClusterDiscovery

func FilterClusterDiscovery(vs []*ClusterDiscovery, f func(*ClusterDiscovery) bool) []*ClusterDiscovery

func (*ClusterDiscovery) AutoFillHostname

func (o *ClusterDiscovery) AutoFillHostname()

func (*ClusterDiscovery) AutoFillIpAddress

func (o *ClusterDiscovery) AutoFillIpAddress(iface string, ipAddress string)

func (*ClusterDiscovery) IsEqual

func (o *ClusterDiscovery) IsEqual(in *ClusterDiscovery) bool

func (*ClusterDiscovery) IsValid

func (o *ClusterDiscovery) IsValid() *AppError

func (*ClusterDiscovery) PreSave

func (o *ClusterDiscovery) PreSave()

func (*ClusterDiscovery) ToJson

func (o *ClusterDiscovery) ToJson() string

type ClusterInfo

type ClusterInfo struct {
	Id         string `json:"id"`
	Version    string `json:"version"`
	ConfigHash string `json:"config_hash"`
	IpAddress  string `json:"ipaddress"`
	Hostname   string `json:"hostname"`
}

func ClusterInfoFromJson

func ClusterInfoFromJson(data io.Reader) *ClusterInfo

func ClusterInfosFromJson

func ClusterInfosFromJson(data io.Reader) []*ClusterInfo

func (*ClusterInfo) ToJson

func (me *ClusterInfo) ToJson() string

type ClusterMessage

type ClusterMessage struct {
	Event            string            `json:"event"`
	SendType         string            `json:"-"`
	WaitForAllToSend bool              `json:"-"`
	Data             string            `json:"data,omitempty"`
	Props            map[string]string `json:"props,omitempty"`
}

func ClusterMessageFromJson

func ClusterMessageFromJson(data io.Reader) *ClusterMessage

func (*ClusterMessage) ToJson

func (o *ClusterMessage) ToJson() string

type ClusterSettings

type ClusterSettings struct {
	Enable                             *bool   `access:"environment,write_restrictable"`
	ClusterName                        *string `access:"environment,write_restrictable"`
	OverrideHostname                   *string `access:"environment,write_restrictable"`
	NetworkInterface                   *string `access:"environment,write_restrictable"`
	BindAddress                        *string `access:"environment,write_restrictable"`
	AdvertiseAddress                   *string `access:"environment,write_restrictable"`
	UseIpAddress                       *bool   `access:"environment,write_restrictable"`
	UseExperimentalGossip              *bool   `access:"environment,write_restrictable"`
	EnableExperimentalGossipEncryption *bool   `access:"environment,write_restrictable"`
	ReadOnlyConfig                     *bool   `access:"environment,write_restrictable"`
	GossipPort                         *int    `access:"environment,write_restrictable"`
	StreamingPort                      *int    `access:"environment,write_restrictable"`
	MaxIdleConns                       *int    `access:"environment,write_restrictable"`
	MaxIdleConnsPerHost                *int    `access:"environment,write_restrictable"`
	IdleConnTimeoutMilliseconds        *int    `access:"environment,write_restrictable"`
}

func (*ClusterSettings) SetDefaults

func (s *ClusterSettings) SetDefaults()

type ClusterStats

type ClusterStats struct {
	Id                        string `json:"id"`
	TotalWebsocketConnections int    `json:"total_websocket_connections"`
	TotalReadDbConnections    int    `json:"total_read_db_connections"`
	TotalMasterDbConnections  int    `json:"total_master_db_connections"`
}

func ClusterStatsFromJson

func ClusterStatsFromJson(data io.Reader) *ClusterStats

func (*ClusterStats) ToJson

func (me *ClusterStats) ToJson() string

type Command

type Command struct {
	Id               string `json:"id"`
	Token            string `json:"token"`
	CreateAt         int64  `json:"create_at"`
	UpdateAt         int64  `json:"update_at"`
	DeleteAt         int64  `json:"delete_at"`
	CreatorId        string `json:"creator_id"`
	TeamId           string `json:"team_id"`
	Trigger          string `json:"trigger"`
	Method           string `json:"method"`
	Username         string `json:"username"`
	IconURL          string `json:"icon_url"`
	AutoComplete     bool   `json:"auto_complete"`
	AutoCompleteDesc string `json:"auto_complete_desc"`
	AutoCompleteHint string `json:"auto_complete_hint"`
	DisplayName      string `json:"display_name"`
	Description      string `json:"description"`
	URL              string `json:"url"`
	// PluginId records the id of the plugin that created this Command. If it is blank, the Command
	// was not created by a plugin.
	PluginId         string            `json:"plugin_id"`
	AutocompleteData *AutocompleteData `db:"-" json:"autocomplete_data,omitempty"`
	// AutocompleteIconData is a base64 encoded svg
	AutocompleteIconData string `db:"-" json:"autocomplete_icon_data,omitempty"`
}

func CommandFromJson

func CommandFromJson(data io.Reader) *Command

func CommandListFromJson

func CommandListFromJson(data io.Reader) []*Command

func (*Command) IsValid

func (o *Command) IsValid() *AppError

func (*Command) PreSave

func (o *Command) PreSave()

func (*Command) PreUpdate

func (o *Command) PreUpdate()

func (*Command) Sanitize

func (o *Command) Sanitize()

func (*Command) ToJson

func (o *Command) ToJson() string

type CommandArgs

type CommandArgs struct {
	UserId          string               `json:"user_id"`
	ChannelId       string               `json:"channel_id"`
	TeamId          string               `json:"team_id"`
	RootId          string               `json:"root_id"`
	ParentId        string               `json:"parent_id"`
	TriggerId       string               `json:"trigger_id,omitempty"`
	Command         string               `json:"command"`
	SiteURL         string               `json:"-"`
	T               goi18n.TranslateFunc `json:"-"`
	UserMentions    UserMentionMap       `json:"-"`
	ChannelMentions ChannelMentionMap    `json:"-"`

	// DO NOT USE Session field is deprecated. MM-26398
	Session Session `json:"-"`
}

func CommandArgsFromJson

func CommandArgsFromJson(data io.Reader) *CommandArgs

func (*CommandArgs) AddChannelMention added in v5.22.0

func (o *CommandArgs) AddChannelMention(channelName, channelId string)

AddChannelMention adds or overrides an entry in ChannelMentions with name channelName and identifier channelId

func (*CommandArgs) AddUserMention added in v5.22.0

func (o *CommandArgs) AddUserMention(username, userId string)

AddUserMention adds or overrides an entry in UserMentions with name username and identifier userId

func (*CommandArgs) ToJson

func (o *CommandArgs) ToJson() string

type CommandMoveRequest added in v5.22.0

type CommandMoveRequest struct {
	TeamId string `json:"team_id"`
}

func CommandMoveRequestFromJson added in v5.22.0

func CommandMoveRequestFromJson(data io.Reader) (*CommandMoveRequest, error)

func (*CommandMoveRequest) ToJson added in v5.22.0

func (cmr *CommandMoveRequest) ToJson() string

type CommandResponse

type CommandResponse struct {
	ResponseType     string             `json:"response_type"`
	Text             string             `json:"text"`
	Username         string             `json:"username"`
	ChannelId        string             `json:"channel_id"`
	IconURL          string             `json:"icon_url"`
	Type             string             `json:"type"`
	Props            StringInterface    `json:"props"`
	GotoLocation     string             `json:"goto_location"`
	TriggerId        string             `json:"trigger_id"`
	SkipSlackParsing bool               `json:"skip_slack_parsing"` // Set to `true` to skip the Slack-compatibility handling of Text.
	Attachments      []*SlackAttachment `json:"attachments"`
	ExtraResponses   []*CommandResponse `json:"extra_responses"`
}

func CommandResponseFromHTTPBody

func CommandResponseFromHTTPBody(contentType string, body io.Reader) (*CommandResponse, error)

func CommandResponseFromJson

func CommandResponseFromJson(data io.Reader) (*CommandResponse, error)

func CommandResponseFromPlainText

func CommandResponseFromPlainText(text string) *CommandResponse

func (*CommandResponse) ToJson

func (o *CommandResponse) ToJson() string

type CommandWebhook

type CommandWebhook struct {
	Id        string
	CreateAt  int64
	CommandId string
	UserId    string
	ChannelId string
	RootId    string
	ParentId  string
	UseCount  int
}

func (*CommandWebhook) IsValid

func (o *CommandWebhook) IsValid() *AppError

func (*CommandWebhook) PreSave

func (o *CommandWebhook) PreSave()

type Compliance

type Compliance struct {
	Id       string `json:"id"`
	CreateAt int64  `json:"create_at"`
	UserId   string `json:"user_id"`
	Status   string `json:"status"`
	Count    int    `json:"count"`
	Desc     string `json:"desc"`
	Type     string `json:"type"`
	StartAt  int64  `json:"start_at"`
	EndAt    int64  `json:"end_at"`
	Keywords string `json:"keywords"`
	Emails   string `json:"emails"`
}

func ComplianceFromJson

func ComplianceFromJson(data io.Reader) *Compliance

func (*Compliance) IsValid

func (c *Compliance) IsValid() *AppError

func (*Compliance) JobName

func (c *Compliance) JobName() string

func (*Compliance) PreSave

func (c *Compliance) PreSave()

func (*Compliance) ToJson

func (c *Compliance) ToJson() string

type CompliancePost

type CompliancePost struct {

	// From Team
	TeamName        string
	TeamDisplayName string

	// From Channel
	ChannelName        string
	ChannelDisplayName string
	ChannelType        string

	// From User
	UserUsername string
	UserEmail    string
	UserNickname string

	// From Post
	PostId         string
	PostCreateAt   int64
	PostUpdateAt   int64
	PostDeleteAt   int64
	PostRootId     string
	PostParentId   string
	PostOriginalId string
	PostMessage    string
	PostType       string
	PostProps      string
	PostHashtags   string
	PostFileIds    string

	IsBot bool
}

func (*CompliancePost) Row

func (me *CompliancePost) Row() []string

type ComplianceSettings

type ComplianceSettings struct {
	Enable      *bool   `access:"compliance"`
	Directory   *string `access:"compliance"`
	EnableDaily *bool   `access:"compliance"`
}

func (*ComplianceSettings) SetDefaults

func (s *ComplianceSettings) SetDefaults()

type Compliances

type Compliances []Compliance

func CompliancesFromJson

func CompliancesFromJson(data io.Reader) Compliances

func (Compliances) ToJson

func (c Compliances) ToJson() string

type Conditions added in v5.28.0

type Conditions struct {
	Audience       *NoticeAudience        `json:"audience,omitempty"`
	ClientType     *NoticeClientType      `json:"clientType,omitempty"`     // Only show the notice on specific clients. Defaults to 'all'
	DesktopVersion []string               `json:"desktopVersion,omitempty"` // What desktop client versions does this notice apply to.; Format: semver ranges (https://devhints.io/semver); Example: [">=1.2.3 < ~2.4.x"]; Example: ["<v5.19", "v5.20-v5.22"]
	DisplayDate    *string                `json:"displayDate,omitempty"`    // When to display the notice.; Examples:; "2020-03-01T00:00:00Z" - show on specified date; ">= 2020-03-01T00:00:00Z" - show after specified date; "< 2020-03-01T00:00:00Z" - show before the specified date; "> 2020-03-01T00:00:00Z <= 2020-04-01T00:00:00Z" - show only between the specified dates
	InstanceType   *NoticeInstanceType    `json:"instanceType,omitempty"`
	MobileVersion  []string               `json:"mobileVersion,omitempty"` // What mobile client versions does this notice apply to.; Format: semver ranges (https://devhints.io/semver); Example: [">=1.2.3 < ~2.4.x"]; Example: ["<v5.19", "v5.20-v5.22"]
	NumberOfPosts  *int64                 `json:"numberOfPosts,omitempty"` // Only show the notice when server has more than specified number of posts
	NumberOfUsers  *int64                 `json:"numberOfUsers,omitempty"` // Only show the notice when server has more than specified number of users
	ServerConfig   map[string]interface{} `json:"serverConfig,omitempty"`  // Map of mattermost server config paths and their values. Notice will be displayed only if; the values match the target server config; Example: serverConfig: { "PluginSettings.Enable": true, "GuestAccountsSettings.Enable":; false }
	ServerVersion  []string               `json:"serverVersion,omitempty"` // What server versions does this notice apply to.; Format: semver ranges (https://devhints.io/semver); Example: [">=1.2.3 < ~2.4.x"]; Example: ["<v5.19", "v5.20-v5.22"]
	Sku            *NoticeSKU             `json:"sku,omitempty"`
	UserConfig     map[string]interface{} `json:"userConfig,omitempty"` // Map of user's settings and their values. Notice will be displayed only if the values; match the viewing users' config; Example: userConfig: { "new_sidebar.disabled": true }
}

type Config

type Config struct {
	ServiceSettings           ServiceSettings
	TeamSettings              TeamSettings
	ClientRequirements        ClientRequirements
	SqlSettings               SqlSettings
	LogSettings               LogSettings
	ExperimentalAuditSettings ExperimentalAuditSettings
	NotificationLogSettings   NotificationLogSettings
	PasswordSettings          PasswordSettings
	FileSettings              FileSettings
	EmailSettings             EmailSettings
	RateLimitSettings         RateLimitSettings
	PrivacySettings           PrivacySettings
	SupportSettings           SupportSettings
	AnnouncementSettings      AnnouncementSettings
	ThemeSettings             ThemeSettings
	GitLabSettings            SSOSettings
	GoogleSettings            SSOSettings
	Office365Settings         Office365Settings
	LdapSettings              LdapSettings
	ComplianceSettings        ComplianceSettings
	LocalizationSettings      LocalizationSettings
	SamlSettings              SamlSettings
	NativeAppSettings         NativeAppSettings
	ClusterSettings           ClusterSettings
	MetricsSettings           MetricsSettings
	ExperimentalSettings      ExperimentalSettings
	AnalyticsSettings         AnalyticsSettings
	ElasticsearchSettings     ElasticsearchSettings
	BleveSettings             BleveSettings
	DataRetentionSettings     DataRetentionSettings
	MessageExportSettings     MessageExportSettings
	JobSettings               JobSettings
	PluginSettings            PluginSettings
	DisplaySettings           DisplaySettings
	GuestAccountsSettings     GuestAccountsSettings
	ImageProxySettings        ImageProxySettings
}

Config fields support the 'access' tag with the following values corresponding to the suffix of the associated PERMISSION_SYSCONSOLE_*_* permission Id: 'about', 'reporting', 'user_management_users', 'user_management_groups', 'user_management_teams', 'user_management_channels', 'user_management_permissions', 'environment', 'site', 'authentication', 'plugins', 'integrations', 'compliance', 'plugins', and 'experimental'. They grant read and/or write access to the config field to roles without PERMISSION_MANAGE_SYSTEM.

By default config values can be written with PERMISSION_MANAGE_SYSTEM, but if ExperimentalSettings.RestrictSystemAdmin is true and the access tag contains the value 'write_restrictable', then even PERMISSION_MANAGE_SYSTEM does not grant write access.

PERMISSION_MANAGE_SYSTEM always grants read access.

Example:

type HairSettings struct {
    // Colour is writeable with either PERMISSION_SYSCONSOLE_WRITE_REPORTING or PERMISSION_SYSCONSOLE_WRITE_USER_MANAGEMENT_GROUPS.
    // It is readable by PERMISSION_SYSCONSOLE_READ_REPORTING and PERMISSION_SYSCONSOLE_READ_USER_MANAGEMENT_GROUPS permissions.
    // PERMISSION_MANAGE_SYSTEM grants read and write access.
    Colour string `access:"reporting,user_management_groups"`

    // Length is only readable and writable via PERMISSION_MANAGE_SYSTEM.
    Length string

    // Product is only writeable by PERMISSION_MANAGE_SYSTEM if ExperimentalSettings.RestrictSystemAdmin is false.
    // PERMISSION_MANAGE_SYSTEM can always read the value.
    Product bool `access:write_restrictable`
}

func ConfigFromJson

func ConfigFromJson(data io.Reader) *Config

func (*Config) Clone

func (o *Config) Clone() *Config

func (*Config) GetSSOService

func (o *Config) GetSSOService(service string) *SSOSettings

func (*Config) GetSanitizeOptions

func (o *Config) GetSanitizeOptions() map[string]bool

func (*Config) IsValid

func (o *Config) IsValid() *AppError

func (*Config) Sanitize

func (o *Config) Sanitize()

func (*Config) SetDefaults

func (o *Config) SetDefaults()

func (*Config) ToJson

func (o *Config) ToJson() string

type ConfigFunc

type ConfigFunc func() *Config

type ContactPerson added in v5.20.0

type ContactPerson struct {
	XMLName          xml.Name
	ContactType      string `xml:"contactType,attr"`
	Company          string
	GivenName        string
	SurName          string
	EmailAddresses   []string `xml:"EmailAddress"`
	TelephoneNumbers []string `xml:"TelephoneNumber"`
}

type Customer

type Customer struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Email   string `json:"email"`
	Company string `json:"company"`
}

type DataRetentionPolicy

type DataRetentionPolicy struct {
	MessageDeletionEnabled bool  `json:"message_deletion_enabled"`
	FileDeletionEnabled    bool  `json:"file_deletion_enabled"`
	MessageRetentionCutoff int64 `json:"message_retention_cutoff"`
	FileRetentionCutoff    int64 `json:"file_retention_cutoff"`
}

func DataRetentionPolicyFromJson

func DataRetentionPolicyFromJson(data io.Reader) *DataRetentionPolicy

func (*DataRetentionPolicy) ToJson

func (me *DataRetentionPolicy) ToJson() string

type DataRetentionSettings

type DataRetentionSettings struct {
	EnableMessageDeletion *bool   `access:"compliance"`
	EnableFileDeletion    *bool   `access:"compliance"`
	MessageRetentionDays  *int    `access:"compliance"`
	FileRetentionDays     *int    `access:"compliance"`
	DeletionJobStartTime  *string `access:"compliance"`
}

func (*DataRetentionSettings) SetDefaults

func (s *DataRetentionSettings) SetDefaults()

type Dialog

type Dialog struct {
	CallbackId       string          `json:"callback_id"`
	Title            string          `json:"title"`
	IntroductionText string          `json:"introduction_text"`
	IconURL          string          `json:"icon_url"`
	Elements         []DialogElement `json:"elements"`
	SubmitLabel      string          `json:"submit_label"`
	NotifyOnCancel   bool            `json:"notify_on_cancel"`
	State            string          `json:"state"`
}

type DialogElement

type DialogElement struct {
	DisplayName string               `json:"display_name"`
	Name        string               `json:"name"`
	Type        string               `json:"type"`
	SubType     string               `json:"subtype"`
	Default     string               `json:"default"`
	Placeholder string               `json:"placeholder"`
	HelpText    string               `json:"help_text"`
	Optional    bool                 `json:"optional"`
	MinLength   int                  `json:"min_length"`
	MaxLength   int                  `json:"max_length"`
	DataSource  string               `json:"data_source"`
	Options     []*PostActionOptions `json:"options"`
}

type DirectChannelForExport

type DirectChannelForExport struct {
	Channel
	Members *[]string
}

type DirectPostForExport

type DirectPostForExport struct {
	Post
	User           string
	ChannelMembers *[]string
}

type DisplaySettings

type DisplaySettings struct {
	CustomUrlSchemes     []string `access:"site"`
	ExperimentalTimezone *bool    `access:"experimental"`
}

func (*DisplaySettings) SetDefaults

func (s *DisplaySettings) SetDefaults()

type DoPostActionRequest

type DoPostActionRequest struct {
	SelectedOption string `json:"selected_option,omitempty"`
	Cookie         string `json:"cookie,omitempty"`
}

func DoPostActionRequestFromJson

func DoPostActionRequestFromJson(data io.Reader) *DoPostActionRequest

type ElasticsearchSettings

type ElasticsearchSettings struct {
	ConnectionUrl                 *string `access:"environment,write_restrictable"`
	Username                      *string `access:"environment,write_restrictable"`
	Password                      *string `access:"environment,write_restrictable"`
	EnableIndexing                *bool   `access:"environment,write_restrictable"`
	EnableSearching               *bool   `access:"environment,write_restrictable"`
	EnableAutocomplete            *bool   `access:"environment,write_restrictable"`
	Sniff                         *bool   `access:"environment,write_restrictable"`
	PostIndexReplicas             *int    `access:"environment,write_restrictable"`
	PostIndexShards               *int    `access:"environment,write_restrictable"`
	ChannelIndexReplicas          *int    `access:"environment,write_restrictable"`
	ChannelIndexShards            *int    `access:"environment,write_restrictable"`
	UserIndexReplicas             *int    `access:"environment,write_restrictable"`
	UserIndexShards               *int    `access:"environment,write_restrictable"`
	AggregatePostsAfterDays       *int    `access:"environment,write_restrictable"`
	PostsAggregatorJobStartTime   *string `access:"environment,write_restrictable"`
	IndexPrefix                   *string `access:"environment,write_restrictable"`
	LiveIndexingBatchSize         *int    `access:"environment,write_restrictable"`
	BulkIndexingTimeWindowSeconds *int    `access:"environment,write_restrictable"`
	RequestTimeoutSeconds         *int    `access:"environment,write_restrictable"`
	SkipTLSVerification           *bool   `access:"environment,write_restrictable"`
	Trace                         *string `access:"environment,write_restrictable"`
}

func (*ElasticsearchSettings) SetDefaults

func (s *ElasticsearchSettings) SetDefaults()

type EmailInviteWithError added in v5.20.0

type EmailInviteWithError struct {
	Email string    `json:"email"`
	Error *AppError `json:"error"`
}

func EmailInviteWithErrorFromJson added in v5.20.0

func EmailInviteWithErrorFromJson(data io.Reader) []*EmailInviteWithError

type EmailSettings

type EmailSettings struct {
	EnableSignUpWithEmail             *bool   `access:"authentication"`
	EnableSignInWithEmail             *bool   `access:"authentication"`
	EnableSignInWithUsername          *bool   `access:"authentication"`
	SendEmailNotifications            *bool   `access:"site"`
	UseChannelInEmailNotifications    *bool   `access:"experimental"`
	RequireEmailVerification          *bool   `access:"authentication"`
	FeedbackName                      *string `access:"site"`
	FeedbackEmail                     *string `access:"site"`
	ReplyToAddress                    *string `access:"site"`
	FeedbackOrganization              *string `access:"site"`
	EnableSMTPAuth                    *bool   `access:"environment,write_restrictable"`
	SMTPUsername                      *string `access:"environment,write_restrictable"`
	SMTPPassword                      *string `access:"environment,write_restrictable"`
	SMTPServer                        *string `access:"environment,write_restrictable"`
	SMTPPort                          *string `access:"environment,write_restrictable"`
	SMTPServerTimeout                 *int
	ConnectionSecurity                *string `access:"environment,write_restrictable"`
	SendPushNotifications             *bool   `access:"environment"`
	PushNotificationServer            *string `access:"environment"`
	PushNotificationContents          *string `access:"site"`
	PushNotificationBuffer            *int
	EnableEmailBatching               *bool   `access:"site"`
	EmailBatchingBufferSize           *int    `access:"experimental"`
	EmailBatchingInterval             *int    `access:"experimental"`
	EnablePreviewModeBanner           *bool   `access:"site"`
	SkipServerCertificateVerification *bool   `access:"environment,write_restrictable"`
	EmailNotificationContentsType     *string `access:"site"`
	LoginButtonColor                  *string `access:"experimental"`
	LoginButtonBorderColor            *string `access:"experimental"`
	LoginButtonTextColor              *string `access:"experimental"`
}

func (*EmailSettings) SetDefaults

func (s *EmailSettings) SetDefaults(isUpdate bool)

type Emoji

type Emoji struct {
	Id        string `json:"id"`
	CreateAt  int64  `json:"create_at"`
	UpdateAt  int64  `json:"update_at"`
	DeleteAt  int64  `json:"delete_at"`
	CreatorId string `json:"creator_id"`
	Name      string `json:"name"`
}

func EmojiFromJson

func EmojiFromJson(data io.Reader) *Emoji

func EmojiListFromJson

func EmojiListFromJson(data io.Reader) []*Emoji

func (*Emoji) IsValid

func (emoji *Emoji) IsValid() *AppError

func (*Emoji) PreSave

func (emoji *Emoji) PreSave()

func (*Emoji) ToJson

func (emoji *Emoji) ToJson() string

type EmojiSearch

type EmojiSearch struct {
	Term       string `json:"term"`
	PrefixOnly bool   `json:"prefix_only"`
}

func EmojiSearchFromJson

func EmojiSearchFromJson(data io.Reader) *EmojiSearch

func (*EmojiSearch) ToJson

func (es *EmojiSearch) ToJson() string

type EncryptionMethod added in v5.20.0

type EncryptionMethod struct {
	Algorithm string `xml:"Algorithm,attr"`
}

type Endpoint added in v5.20.0

type Endpoint struct {
	XMLName          xml.Name
	Binding          string `xml:"Binding,attr"`
	Location         string `xml:"Location,attr"`
	ResponseLocation string `xml:"ResponseLocation,attr,omitempty"`
}

type EntityDescriptor added in v5.20.0

type EntityDescriptor struct {
	XMLName           xml.Name           `xml:"urn:oasis:names:tc:SAML:2.0:metadata EntityDescriptor"`
	EntityID          string             `xml:"entityID,attr"`
	ID                string             `xml:",attr,omitempty"`
	ValidUntil        time.Time          `xml:"validUntil,attr,omitempty"`
	CacheDuration     time.Duration      `xml:"cacheDuration,attr,omitempty"`
	RoleDescriptors   []RoleDescriptor   `xml:"RoleDescriptor"`
	IDPSSODescriptors []IDPSSODescriptor `xml:"IDPSSODescriptor"`
	Organization      Organization       `xml:"Organization"`
	ContactPerson     ContactPerson      `xml:"ContactPerson"`
}

type ExperimentalAuditSettings added in v5.22.0

type ExperimentalAuditSettings struct {
	FileEnabled           *bool   `access:"experimental,write_restrictable"`
	FileName              *string `access:"experimental,write_restrictable"`
	FileMaxSizeMB         *int    `access:"experimental,write_restrictable"`
	FileMaxAgeDays        *int    `access:"experimental,write_restrictable"`
	FileMaxBackups        *int    `access:"experimental,write_restrictable"`
	FileCompress          *bool   `access:"experimental,write_restrictable"`
	FileMaxQueueSize      *int    `access:"experimental,write_restrictable"`
	AdvancedLoggingConfig *string `access:"experimental,write_restrictable"`
}

func (*ExperimentalAuditSettings) SetDefaults added in v5.22.0

func (s *ExperimentalAuditSettings) SetDefaults()

type ExperimentalSettings

type ExperimentalSettings struct {
	ClientSideCertEnable            *bool   `access:"experimental"`
	ClientSideCertCheck             *string `access:"experimental"`
	EnableClickToReply              *bool   `access:"experimental,write_restrictable"`
	LinkMetadataTimeoutMilliseconds *int64  `access:"experimental,write_restrictable"`
	RestrictSystemAdmin             *bool   `access:"experimental,write_restrictable"`
	UseNewSAMLLibrary               *bool   `access:"experimental"`
	CloudUserLimit                  *int64  `access:"experimental,write_restrictable"`
	CloudBilling                    *bool   `access:"experimental,write_restrictable"`
}

func (*ExperimentalSettings) SetDefaults

func (s *ExperimentalSettings) SetDefaults()

type Features

type Features struct {
	Users                     *int  `json:"users"`
	LDAP                      *bool `json:"ldap"`
	LDAPGroups                *bool `json:"ldap_groups"`
	MFA                       *bool `json:"mfa"`
	GoogleOAuth               *bool `json:"google_oauth"`
	Office365OAuth            *bool `json:"office365_oauth"`
	Compliance                *bool `json:"compliance"`
	Cluster                   *bool `json:"cluster"`
	Metrics                   *bool `json:"metrics"`
	MHPNS                     *bool `json:"mhpns"`
	SAML                      *bool `json:"saml"`
	Elasticsearch             *bool `json:"elastic_search"`
	Announcement              *bool `json:"announcement"`
	ThemeManagement           *bool `json:"theme_management"`
	EmailNotificationContents *bool `json:"email_notification_contents"`
	DataRetention             *bool `json:"data_retention"`
	MessageExport             *bool `json:"message_export"`
	CustomPermissionsSchemes  *bool `json:"custom_permissions_schemes"`
	CustomTermsOfService      *bool `json:"custom_terms_of_service"`
	GuestAccounts             *bool `json:"guest_accounts"`
	GuestAccountsPermissions  *bool `json:"guest_accounts_permissions"`
	IDLoadedPushNotifications *bool `json:"id_loaded"`
	LockTeammateNameDisplay   *bool `json:"lock_teammate_name_display"`
	EnterprisePlugins         *bool `json:"enterprise_plugins"`
	AdvancedLogging           *bool `json:"advanced_logging"`
	Cloud                     *bool `json:"cloud"`

	// after we enabled more features we'll need to control them with this
	FutureFeatures *bool `json:"future_features"`
}

func (*Features) SetDefaults

func (f *Features) SetDefaults()

func (*Features) ToMap

func (f *Features) ToMap() map[string]interface{}

type FileInfo

type FileInfo struct {
	Id              string  `json:"id"`
	CreatorId       string  `json:"user_id"`
	PostId          string  `json:"post_id,omitempty"`
	CreateAt        int64   `json:"create_at"`
	UpdateAt        int64   `json:"update_at"`
	DeleteAt        int64   `json:"delete_at"`
	Path            string  `json:"-"` // not sent back to the client
	ThumbnailPath   string  `json:"-"` // not sent back to the client
	PreviewPath     string  `json:"-"` // not sent back to the client
	Name            string  `json:"name"`
	Extension       string  `json:"extension"`
	Size            int64   `json:"size"`
	MimeType        string  `json:"mime_type"`
	Width           int     `json:"width,omitempty"`
	Height          int     `json:"height,omitempty"`
	HasPreviewImage bool    `json:"has_preview_image,omitempty"`
	MiniPreview     *[]byte `json:"mini_preview"` // declared as *[]byte to avoid postgres/mysql differences in deserialization
}

func FileInfoFromJson

func FileInfoFromJson(data io.Reader) *FileInfo

func FileInfosFromJson

func FileInfosFromJson(data io.Reader) []*FileInfo

func NewInfo

func NewInfo(name string) *FileInfo

func (*FileInfo) IsImage

func (fi *FileInfo) IsImage() bool

func (*FileInfo) IsValid

func (fi *FileInfo) IsValid() *AppError

func (*FileInfo) PreSave

func (fi *FileInfo) PreSave()

func (*FileInfo) ToJson

func (fi *FileInfo) ToJson() string

type FileSettings

type FileSettings struct {
	EnableFileAttachments   *bool   `access:"site"`
	EnableMobileUpload      *bool   `access:"site"`
	EnableMobileDownload    *bool   `access:"site"`
	MaxFileSize             *int64  `access:"environment"`
	DriverName              *string `access:"environment,write_restrictable"`
	Directory               *string `access:"environment,write_restrictable"`
	EnablePublicLink        *bool   `access:"site"`
	PublicLinkSalt          *string `access:"site"`
	InitialFont             *string `access:"environment"`
	AmazonS3AccessKeyId     *string `access:"environment,write_restrictable"`
	AmazonS3SecretAccessKey *string `access:"environment,write_restrictable"`
	AmazonS3Bucket          *string `access:"environment,write_restrictable"`
	AmazonS3PathPrefix      *string `access:"environment,write_restrictable"`
	AmazonS3Region          *string `access:"environment,write_restrictable"`
	AmazonS3Endpoint        *string `access:"environment,write_restrictable"`
	AmazonS3SSL             *bool   `access:"environment,write_restrictable"`
	AmazonS3SignV2          *bool   `access:"environment,write_restrictable"`
	AmazonS3SSE             *bool   `access:"environment,write_restrictable"`
	AmazonS3Trace           *bool   `access:"environment,write_restrictable"`
}

func (*FileSettings) SetDefaults

func (s *FileSettings) SetDefaults(isUpdate bool)

type FileUploadResponse

type FileUploadResponse struct {
	FileInfos []*FileInfo `json:"file_infos"`
	ClientIds []string    `json:"client_ids"`
}

func FileUploadResponseFromJson

func FileUploadResponseFromJson(data io.Reader) *FileUploadResponse

func (*FileUploadResponse) ToJson

func (o *FileUploadResponse) ToJson() string

type GetFileInfosOptions added in v5.22.0

type GetFileInfosOptions struct {
	// UserIds optionally limits the FileInfos to those created by the given users.
	UserIds []string `json:"user_ids"`
	// ChannelIds optionally limits the FileInfos to those created in the given channels.
	ChannelIds []string `json:"channel_ids"`
	// Since optionally limits FileInfos to those created at or after the given time, specified as Unix time in milliseconds.
	Since int64 `json:"since"`
	// IncludeDeleted if set includes deleted FileInfos.
	IncludeDeleted bool `json:"include_deleted"`
	// SortBy sorts the FileInfos by this field. The default is to sort by date created.
	SortBy string `json:"sort_by"`
	// SortDescending changes the sort direction to descending order when true.
	SortDescending bool `json:"sort_descending"`
}

GetFileInfosOptions contains options for getting FileInfos

type GetPostsOptions added in v5.22.0

type GetPostsOptions struct {
	ChannelId        string
	PostId           string
	Page             int
	PerPage          int
	SkipFetchThreads bool
}

type GetPostsSinceOptions added in v5.22.0

type GetPostsSinceOptions struct {
	ChannelId        string
	Time             int64
	SkipFetchThreads bool
}

type GlobalRelayMessageExportSettings

type GlobalRelayMessageExportSettings struct {
	CustomerType      *string `access:"compliance"` // must be either A9 or A10, dictates SMTP server url
	SmtpUsername      *string `access:"compliance"`
	SmtpPassword      *string `access:"compliance"`
	EmailAddress      *string `access:"compliance"` // the address to send messages to
	SMTPServerTimeout *int    `access:"compliance"`
}

func (*GlobalRelayMessageExportSettings) SetDefaults

func (s *GlobalRelayMessageExportSettings) SetDefaults()

type Group

type Group struct {
	Id             string      `json:"id"`
	Name           *string     `json:"name,omitempty"`
	DisplayName    string      `json:"display_name"`
	Description    string      `json:"description"`
	Source         GroupSource `json:"source"`
	RemoteId       string      `json:"remote_id"`
	CreateAt       int64       `json:"create_at"`
	UpdateAt       int64       `json:"update_at"`
	DeleteAt       int64       `json:"delete_at"`
	HasSyncables   bool        `db:"-" json:"has_syncables"`
	MemberCount    *int        `db:"-" json:"member_count,omitempty"`
	AllowReference bool        `json:"allow_reference"`
}

func GroupFromJson

func GroupFromJson(data io.Reader) *Group

func GroupsFromJson

func GroupsFromJson(data io.Reader) []*Group

func (*Group) IsValidForCreate

func (group *Group) IsValidForCreate() *AppError

func (*Group) IsValidForUpdate

func (group *Group) IsValidForUpdate() *AppError

func (*Group) IsValidName added in v5.24.0

func (group *Group) IsValidName() *AppError

func (*Group) Patch

func (group *Group) Patch(patch *GroupPatch)

func (*Group) ToJson added in v5.24.0

func (group *Group) ToJson() string

type GroupMember

type GroupMember struct {
	GroupId  string `json:"group_id"`
	UserId   string `json:"user_id"`
	CreateAt int64  `json:"create_at"`
	DeleteAt int64  `json:"delete_at"`
}

func (*GroupMember) IsValid

func (gm *GroupMember) IsValid() *AppError

type GroupPatch

type GroupPatch struct {
	Name           *string `json:"name"`
	DisplayName    *string `json:"display_name"`
	Description    *string `json:"description"`
	AllowReference *bool   `json:"allow_reference"`
}

func GroupPatchFromJson

func GroupPatchFromJson(data io.Reader) *GroupPatch

type GroupSearchOpts

type GroupSearchOpts struct {
	Q                      string
	NotAssociatedToTeam    string
	NotAssociatedToChannel string
	IncludeMemberCount     bool
	FilterAllowReference   bool
	PageOpts               *PageOpts
	Since                  int64

	// FilterParentTeamPermitted filters the groups to the intersect of the
	// set associated to the parent team and those returned by the query.
	// If the parent team is not group-constrained or if NotAssociatedToChannel
	// is not set then this option is ignored.
	FilterParentTeamPermitted bool
}

type GroupSource

type GroupSource string

type GroupStats added in v5.26.0

type GroupStats struct {
	GroupID          string `json:"group_id"`
	TotalMemberCount int64  `json:"total_member_count"`
}

func GroupStatsFromJson added in v5.26.0

func GroupStatsFromJson(data io.Reader) *GroupStats

type GroupSyncable

type GroupSyncable struct {
	GroupId string `json:"group_id"`

	// SyncableId represents the Id of the model that is being synced with the group, for example a ChannelId or
	// TeamId.
	SyncableId string `db:"-" json:"-"`

	AutoAdd     bool              `json:"auto_add"`
	SchemeAdmin bool              `json:"scheme_admin"`
	CreateAt    int64             `json:"create_at"`
	DeleteAt    int64             `json:"delete_at"`
	UpdateAt    int64             `json:"update_at"`
	Type        GroupSyncableType `db:"-" json:"-"`

	// Values joined in from the associated team and/or channel
	ChannelDisplayName string `db:"-" json:"-"`
	TeamDisplayName    string `db:"-" json:"-"`
	TeamType           string `db:"-" json:"-"`
	ChannelType        string `db:"-" json:"-"`
	TeamID             string `db:"-" json:"-"`
}

func GroupSyncableFromJson

func GroupSyncableFromJson(data io.Reader) *GroupSyncable

func GroupSyncablesFromJson

func GroupSyncablesFromJson(data io.Reader) []*GroupSyncable

func NewGroupChannel

func NewGroupChannel(groupID, channelID string, autoAdd bool) *GroupSyncable

func NewGroupTeam

func NewGroupTeam(groupID, teamID string, autoAdd bool) *GroupSyncable

func (*GroupSyncable) IsValid

func (syncable *GroupSyncable) IsValid() *AppError

func (*GroupSyncable) MarshalJSON

func (syncable *GroupSyncable) MarshalJSON() ([]byte, error)

func (*GroupSyncable) Patch

func (syncable *GroupSyncable) Patch(patch *GroupSyncablePatch)

func (*GroupSyncable) UnmarshalJSON

func (syncable *GroupSyncable) UnmarshalJSON(b []byte) error

type GroupSyncablePatch

type GroupSyncablePatch struct {
	AutoAdd     *bool `json:"auto_add"`
	SchemeAdmin *bool `json:"scheme_admin"`
}

type GroupSyncableType

type GroupSyncableType string
const (
	GroupSyncableTypeTeam    GroupSyncableType = "Team"
	GroupSyncableTypeChannel GroupSyncableType = "Channel"
)

func (GroupSyncableType) String

func (gst GroupSyncableType) String() string

type GroupWithSchemeAdmin added in v5.20.0

type GroupWithSchemeAdmin struct {
	Group
	SchemeAdmin *bool `db:"SyncableSchemeAdmin" json:"scheme_admin,omitempty"`
}

type GroupsAssociatedToChannel added in v5.24.0

type GroupsAssociatedToChannel struct {
	ChannelId string                  `json:"channel_id"`
	Groups    []*GroupWithSchemeAdmin `json:"groups"`
}

type GroupsAssociatedToChannelWithSchemeAdmin added in v5.24.0

type GroupsAssociatedToChannelWithSchemeAdmin struct {
	ChannelId string `json:"channel_id"`
	Group
	SchemeAdmin *bool `db:"SyncableSchemeAdmin" json:"scheme_admin,omitempty"`
}

type GuestAccountsSettings

type GuestAccountsSettings struct {
	Enable                           *bool   `access:"authentication"`
	AllowEmailAccounts               *bool   `access:"authentication"`
	EnforceMultifactorAuthentication *bool   `access:"authentication"`
	RestrictCreationToDomains        *string `access:"authentication"`
}

func (*GuestAccountsSettings) SetDefaults

func (s *GuestAccountsSettings) SetDefaults()

type GuestsInvite

type GuestsInvite struct {
	Emails   []string `json:"emails"`
	Channels []string `json:"channels"`
	Message  string   `json:"message"`
}

func GuestsInviteFromJson

func GuestsInviteFromJson(data io.Reader) *GuestsInvite

GuestsInviteFromJson will decode the input and return a GuestsInvite

func (*GuestsInvite) IsValid

func (i *GuestsInvite) IsValid() *AppError

IsValid validates the user and returns an error if it isn't configured correctly.

func (*GuestsInvite) ToJson

func (i *GuestsInvite) ToJson() string

type IDPSSODescriptor added in v5.20.0

type IDPSSODescriptor struct {
	XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata IDPSSODescriptor"`
	SSODescriptor
	WantAuthnRequestsSigned *bool `xml:",attr"`

	SingleSignOnServices       []Endpoint  `xml:"SingleSignOnService"`
	NameIDMappingServices      []Endpoint  `xml:"NameIDMappingService"`
	AssertionIDRequestServices []Endpoint  `xml:"AssertionIDRequestService"`
	AttributeProfiles          []string    `xml:"AttributeProfile"`
	Attributes                 []Attribute `xml:"Attribute"`
}

type ImageProxySettings

type ImageProxySettings struct {
	Enable                  *bool   `access:"environment"`
	ImageProxyType          *string `access:"environment"`
	RemoteImageProxyURL     *string `access:"environment"`
	RemoteImageProxyOptions *string `access:"environment"`
}

func (*ImageProxySettings) SetDefaults

func (s *ImageProxySettings) SetDefaults(ss ServiceSettings)

type IncomingWebhook

type IncomingWebhook struct {
	Id            string `json:"id"`
	CreateAt      int64  `json:"create_at"`
	UpdateAt      int64  `json:"update_at"`
	DeleteAt      int64  `json:"delete_at"`
	UserId        string `json:"user_id"`
	ChannelId     string `json:"channel_id"`
	TeamId        string `json:"team_id"`
	DisplayName   string `json:"display_name"`
	Description   string `json:"description"`
	Username      string `json:"username"`
	IconURL       string `json:"icon_url"`
	ChannelLocked bool   `json:"channel_locked"`
}

func IncomingWebhookFromJson

func IncomingWebhookFromJson(data io.Reader) *IncomingWebhook

func IncomingWebhookListFromJson

func IncomingWebhookListFromJson(data io.Reader) []*IncomingWebhook

func (*IncomingWebhook) IsValid

func (o *IncomingWebhook) IsValid() *AppError

func (*IncomingWebhook) PreSave

func (o *IncomingWebhook) PreSave()

func (*IncomingWebhook) PreUpdate

func (o *IncomingWebhook) PreUpdate()

func (*IncomingWebhook) ToJson

func (o *IncomingWebhook) ToJson() string

type IncomingWebhookRequest

type IncomingWebhookRequest struct {
	Text        string             `json:"text"`
	Username    string             `json:"username"`
	IconURL     string             `json:"icon_url"`
	ChannelName string             `json:"channel"`
	Props       StringInterface    `json:"props"`
	Attachments []*SlackAttachment `json:"attachments"`
	Type        string             `json:"type"`
	IconEmoji   string             `json:"icon_emoji"`
}

func (*IncomingWebhookRequest) ToJson

func (o *IncomingWebhookRequest) ToJson() string

type IndexedEndpoint added in v5.20.0

type IndexedEndpoint struct {
	XMLName          xml.Name
	Binding          string  `xml:"Binding,attr"`
	Location         string  `xml:"Location,attr"`
	ResponseLocation *string `xml:"ResponseLocation,attr,omitempty"`
	Index            int     `xml:"index,attr"`
	IsDefault        *bool   `xml:"isDefault,attr"`
}

type InitialLoad

type InitialLoad struct {
	User        *User             `json:"user"`
	TeamMembers []*TeamMember     `json:"team_members"`
	Teams       []*Team           `json:"teams"`
	Preferences Preferences       `json:"preferences"`
	ClientCfg   map[string]string `json:"client_cfg"`
	LicenseCfg  map[string]string `json:"license_cfg"`
	NoAccounts  bool              `json:"no_accounts"`
}

func InitialLoadFromJson

func InitialLoadFromJson(data io.Reader) *InitialLoad

func (*InitialLoad) ToJson

func (me *InitialLoad) ToJson() string

type InstallMarketplacePluginRequest

type InstallMarketplacePluginRequest struct {
	Id      string `json:"id"`
	Version string `json:"version"`
}

InstallMarketplacePluginRequest struct describes parameters of the requested plugin.

func PluginRequestFromReader

func PluginRequestFromReader(reader io.Reader) (*InstallMarketplacePluginRequest, error)

PluginRequestFromReader decodes a json-encoded plugin request from the given io.Reader.

func (*InstallMarketplacePluginRequest) ToJson

ToJson method will return json from plugin request.

type IntegrityCheckResult added in v5.28.0

type IntegrityCheckResult struct {
	Data interface{} `json:"data"`
	Err  error       `json:"err"`
}

func (*IntegrityCheckResult) UnmarshalJSON added in v5.28.0

func (r *IntegrityCheckResult) UnmarshalJSON(b []byte) error

type Invites

type Invites struct {
	Invites []map[string]string `json:"invites"`
}

func InvitesFromJson

func InvitesFromJson(data io.Reader) *Invites

func (*Invites) ToEmailList

func (o *Invites) ToEmailList() []string

func (*Invites) ToJson

func (o *Invites) ToJson() string

type Job

type Job struct {
	Id             string            `json:"id"`
	Type           string            `json:"type"`
	Priority       int64             `json:"priority"`
	CreateAt       int64             `json:"create_at"`
	StartAt        int64             `json:"start_at"`
	LastActivityAt int64             `json:"last_activity_at"`
	Status         string            `json:"status"`
	Progress       int64             `json:"progress"`
	Data           map[string]string `json:"data"`
}

func JobFromJson

func JobFromJson(data io.Reader) *Job

func JobsFromJson

func JobsFromJson(data io.Reader) []*Job

func (*Job) DataToJson

func (j *Job) DataToJson() string

func (*Job) IsValid

func (j *Job) IsValid() *AppError

func (*Job) ToJson

func (j *Job) ToJson() string

type JobSettings

type JobSettings struct {
	RunJobs      *bool `access:"write_restrictable"`
	RunScheduler *bool `access:"write_restrictable"`
}

func (*JobSettings) SetDefaults

func (s *JobSettings) SetDefaults()

type KeyDescriptor added in v5.20.0

type KeyDescriptor struct {
	XMLName xml.Name
	Use     string  `xml:"use,attr,omitempty"`
	KeyInfo KeyInfo `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo,omitempty"`
}

type KeyInfo added in v5.20.0

type KeyInfo struct {
	XMLName  xml.Name
	DS       string   `xml:"xmlns:ds,attr"`
	X509Data X509Data `xml:"X509Data"`
}

type LdapGroupSearchOpts

type LdapGroupSearchOpts struct {
	Q            string
	IsLinked     *bool
	IsConfigured *bool
}

type LdapSettings

type LdapSettings struct {
	// Basic
	Enable             *bool   `access:"authentication"`
	EnableSync         *bool   `access:"authentication"`
	LdapServer         *string `access:"authentication"`
	LdapPort           *int    `access:"authentication"`
	ConnectionSecurity *string `access:"authentication"`
	BaseDN             *string `access:"authentication"`
	BindUsername       *string `access:"authentication"`
	BindPassword       *string `access:"authentication"`

	// Filtering
	UserFilter        *string `access:"authentication"`
	GroupFilter       *string `access:"authentication"`
	GuestFilter       *string `access:"authentication"`
	EnableAdminFilter *bool
	AdminFilter       *string

	// Group Mapping
	GroupDisplayNameAttribute *string `access:"authentication"`
	GroupIdAttribute          *string `access:"authentication"`

	// User Mapping
	FirstNameAttribute *string `access:"authentication"`
	LastNameAttribute  *string `access:"authentication"`
	EmailAttribute     *string `access:"authentication"`
	UsernameAttribute  *string `access:"authentication"`
	NicknameAttribute  *string `access:"authentication"`
	IdAttribute        *string `access:"authentication"`
	PositionAttribute  *string `access:"authentication"`
	LoginIdAttribute   *string `access:"authentication"`
	PictureAttribute   *string `access:"authentication"`

	// Synchronization
	SyncIntervalMinutes *int `access:"authentication"`

	// Advanced
	SkipCertificateVerification *bool   `access:"authentication"`
	PublicCertificateFile       *string `access:"authentication"`
	PrivateKeyFile              *string `access:"authentication"`
	QueryTimeout                *int    `access:"authentication"`
	MaxPageSize                 *int    `access:"authentication"`

	// Customization
	LoginFieldName *string `access:"authentication"`

	LoginButtonColor       *string `access:"authentication"`
	LoginButtonBorderColor *string `access:"authentication"`
	LoginButtonTextColor   *string `access:"authentication"`

	Trace *bool `access:"authentication"`
}

func (*LdapSettings) SetDefaults

func (s *LdapSettings) SetDefaults()

type License

type License struct {
	Id           string    `json:"id"`
	IssuedAt     int64     `json:"issued_at"`
	StartsAt     int64     `json:"starts_at"`
	ExpiresAt    int64     `json:"expires_at"`
	Customer     *Customer `json:"customer"`
	Features     *Features `json:"features"`
	SkuName      string    `json:"sku_name"`
	SkuShortName string    `json:"sku_short_name"`
}

func LicenseFromJson

func LicenseFromJson(data io.Reader) *License

func NewTestLicense

func NewTestLicense(features ...string) *License

NewTestLicense returns a license that expires in the future and has the given features.

func (*License) IsExpired

func (l *License) IsExpired() bool

func (*License) IsPastGracePeriod added in v5.24.0

func (l *License) IsPastGracePeriod() bool

func (*License) IsStarted

func (l *License) IsStarted() bool

func (*License) ToJson

func (l *License) ToJson() string

type LicenseRecord

type LicenseRecord struct {
	Id       string `json:"id"`
	CreateAt int64  `json:"create_at"`
	Bytes    string `json:"-"`
}

func (*LicenseRecord) IsValid

func (lr *LicenseRecord) IsValid() *AppError

func (*LicenseRecord) PreSave

func (lr *LicenseRecord) PreSave()

type LinkMetadata

type LinkMetadata struct {
	// Hash is a value computed from the URL and Timestamp for use as a primary key in the database.
	Hash int64

	URL       string
	Timestamp int64
	Type      LinkMetadataType

	// Data is the actual metadata for the link. It should contain data of one of the following types:
	// - *model.PostImage if the linked content is an image
	// - *opengraph.OpenGraph if the linked content is an HTML document
	// - nil if the linked content has no metadata
	Data interface{}
}

LinkMetadata stores arbitrary data about a link posted in a message. This includes dimensions of linked images and OpenGraph metadata.

func (*LinkMetadata) DeserializeDataToConcreteType

func (o *LinkMetadata) DeserializeDataToConcreteType() error

DeserializeDataToConcreteType converts o.Data from JSON into properly structured data. This is intended to be used after getting a LinkMetadata object that has been stored in the database.

func (*LinkMetadata) IsValid

func (o *LinkMetadata) IsValid() *AppError

func (*LinkMetadata) PreSave

func (o *LinkMetadata) PreSave()

type LinkMetadataType

type LinkMetadataType string

type LocalizationSettings

type LocalizationSettings struct {
	DefaultServerLocale *string `access:"site"`
	DefaultClientLocale *string `access:"site"`
	AvailableLocales    *string `access:"site"`
}

func (*LocalizationSettings) SetDefaults

func (s *LocalizationSettings) SetDefaults()

type LocalizedName added in v5.20.0

type LocalizedName struct {
	Lang  string `xml:"xml lang,attr"`
	Value string `xml:",chardata"`
}

type LocalizedURI added in v5.20.0

type LocalizedURI struct {
	Lang  string `xml:"xml lang,attr"`
	Value string `xml:",chardata"`
}

type LogSettings

type LogSettings struct {
	EnableConsole          *bool   `access:"environment,write_restrictable"`
	ConsoleLevel           *string `access:"environment,write_restrictable"`
	ConsoleJson            *bool   `access:"environment,write_restrictable"`
	EnableFile             *bool   `access:"environment,write_restrictable"`
	FileLevel              *string `access:"environment,write_restrictable"`
	FileJson               *bool   `access:"environment,write_restrictable"`
	FileLocation           *string `access:"environment,write_restrictable"`
	EnableWebhookDebugging *bool   `access:"environment,write_restrictable"`
	EnableDiagnostics      *bool   `access:"environment,write_restrictable"`
	EnableSentry           *bool   `access:"environment,write_restrictable"`
	AdvancedLoggingConfig  *string `access:"environment,write_restrictable"`
}

func (*LogSettings) SetDefaults

func (s *LogSettings) SetDefaults()

type Manifest

type Manifest struct {
	// The id is a globally unique identifier that represents your plugin. Ids must be at least
	// 3 characters, at most 190 characters and must match ^[a-zA-Z0-9-_\.]+$.
	// Reverse-DNS notation using a name you control is a good option, e.g. "com.mycompany.myplugin".
	Id string `json:"id" yaml:"id"`

	// The name to be displayed for the plugin.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`

	// A description of what your plugin is and does.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	// HomepageURL is an optional link to learn more about the plugin.
	HomepageURL string `json:"homepage_url,omitempty" yaml:"homepage_url,omitempty"`

	// SupportURL is an optional URL where plugin issues can be reported.
	SupportURL string `json:"support_url,omitempty" yaml:"support_url,omitempty"`

	// ReleaseNotesURL is an optional URL where a changelog for the release can be found.
	ReleaseNotesURL string `json:"release_notes_url,omitempty" yaml:"release_notes_url,omitempty"`

	// A relative file path in the bundle that points to the plugins svg icon for use with the Plugin Marketplace.
	// This should be relative to the root of your bundle and the location of the manifest file. Bitmap image formats are not supported.
	IconPath string `json:"icon_path,omitempty" yaml:"icon_path,omitempty"`

	// A version number for your plugin. Semantic versioning is recommended: http://semver.org
	Version string `json:"version" yaml:"version"`

	// The minimum Mattermost server version required for your plugin.
	//
	// Minimum server version: 5.6
	MinServerVersion string `json:"min_server_version,omitempty" yaml:"min_server_version,omitempty"`

	// Server defines the server-side portion of your plugin.
	Server *ManifestServer `json:"server,omitempty" yaml:"server,omitempty"`

	// Backend is a deprecated flag for defining the server-side portion of your plugin. Going forward, use Server instead.
	Backend *ManifestServer `json:"backend,omitempty" yaml:"backend,omitempty"`

	// If your plugin extends the web app, you'll need to define webapp.
	Webapp *ManifestWebapp `json:"webapp,omitempty" yaml:"webapp,omitempty"`

	// To allow administrators to configure your plugin via the Mattermost system console, you can
	// provide your settings schema.
	SettingsSchema *PluginSettingsSchema `json:"settings_schema,omitempty" yaml:"settings_schema,omitempty"`

	// Plugins can store any kind of data in Props to allow other plugins to use it.
	Props map[string]interface{} `json:"props,omitempty" yaml:"props,omitempty"`

	// RequiredConfig defines any required server configuration fields for the plugin to function properly.
	//
	// Use the plugin helpers CheckRequiredServerConfiguration method to enforce this.
	RequiredConfig *Config `json:"required_configuration,omitempty" yaml:"required_configuration,omitempty"`
}

The plugin manifest defines the metadata required to load and present your plugin. The manifest file should be named plugin.json or plugin.yaml and placed in the top of your plugin bundle.

Example plugin.json:

{
  "id": "com.mycompany.myplugin",
  "name": "My Plugin",
  "description": "This is my plugin",
  "homepage_url": "https://example.com",
  "support_url": "https://example.com/support",
  "release_notes_url": "https://example.com/releases/v0.0.1",
  "icon_path": "assets/logo.svg",
  "version": "0.1.0",
  "min_server_version": "5.6.0",
  "server": {
    "executables": {
      "linux-amd64": "server/dist/plugin-linux-amd64",
      "darwin-amd64": "server/dist/plugin-darwin-amd64",
      "windows-amd64": "server/dist/plugin-windows-amd64.exe"
    }
  },
  "webapp": {
      "bundle_path": "webapp/dist/main.js"
  },
  "settings_schema": {
    "header": "Some header text",
    "footer": "Some footer text",
    "settings": [{
      "key": "someKey",
      "display_name": "Enable Extra Feature",
      "type": "bool",
      "help_text": "When true, an extra feature will be enabled!",
      "default": "false"
    }]
  },
  "props": {
    "someKey": "someData"
  }
}

func FindManifest

func FindManifest(dir string) (manifest *Manifest, path string, err error)

FindManifest will find and parse the manifest in a given directory.

In all cases other than a does-not-exist error, path is set to the path of the manifest file that was found.

Manifests are JSON or YAML files named plugin.json, plugin.yaml, or plugin.yml.

func ManifestFromJson

func ManifestFromJson(data io.Reader) *Manifest

func ManifestListFromJson

func ManifestListFromJson(data io.Reader) []*Manifest

func (*Manifest) ClientManifest

func (m *Manifest) ClientManifest() *Manifest

func (*Manifest) GetExecutableForRuntime

func (m *Manifest) GetExecutableForRuntime(goOs, goArch string) string

GetExecutableForRuntime returns the path to the executable for the given runtime architecture.

If the manifest defines multiple executables, but none match, or if only a single executable is defined, the Executable field will be returned. This method does not guarantee that the resulting binary can actually execute on the given platform.

func (*Manifest) HasClient

func (m *Manifest) HasClient() bool

func (*Manifest) HasServer

func (m *Manifest) HasServer() bool

func (*Manifest) HasWebapp

func (m *Manifest) HasWebapp() bool

func (*Manifest) IsValid added in v5.22.0

func (m *Manifest) IsValid() error

func (*Manifest) MeetMinServerVersion

func (m *Manifest) MeetMinServerVersion(serverVersion string) (bool, error)

func (*Manifest) ToJson

func (m *Manifest) ToJson() string

type ManifestExecutables

type ManifestExecutables struct {
	// LinuxAmd64 is the path to your executable binary for the corresponding platform
	LinuxAmd64 string `json:"linux-amd64,omitempty" yaml:"linux-amd64,omitempty"`
	// DarwinAmd64 is the path to your executable binary for the corresponding platform
	DarwinAmd64 string `json:"darwin-amd64,omitempty" yaml:"darwin-amd64,omitempty"`
	// WindowsAmd64 is the path to your executable binary for the corresponding platform
	// This file must have a ".exe" extension
	WindowsAmd64 string `json:"windows-amd64,omitempty" yaml:"windows-amd64,omitempty"`
}

type ManifestServer

type ManifestServer struct {
	// Executables are the paths to your executable binaries, specifying multiple entry points
	// for different platforms when bundled together in a single plugin.
	Executables *ManifestExecutables `json:"executables,omitempty" yaml:"executables,omitempty"`

	// Executable is the path to your executable binary. This should be relative to the root
	// of your bundle and the location of the manifest file.
	//
	// On Windows, this file must have a ".exe" extension.
	//
	// If your plugin is compiled for multiple platforms, consider bundling them together
	// and using the Executables field instead.
	Executable string `json:"executable" yaml:"executable"`
}

type ManifestWebapp

type ManifestWebapp struct {
	// The path to your webapp bundle. This should be relative to the root of your bundle and the
	// location of the manifest file.
	BundlePath string `json:"bundle_path" yaml:"bundle_path"`

	// BundleHash is the 64-bit FNV-1a hash of the webapp bundle, computed when the plugin is loaded
	BundleHash []byte `json:"-"`
}

type MarketplaceLabel added in v5.20.0

type MarketplaceLabel struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	URL         string `json:"url"`
	Color       string `json:"color"`
}

MarketplaceLabel represents a label shown in the Marketplace UI.

type MarketplacePlugin

type MarketplacePlugin struct {
	*BaseMarketplacePlugin
	InstalledVersion string `json:"installed_version"`
}

MarketplacePlugin is a state aware Marketplace plugin.

func MarketplacePluginsFromReader

func MarketplacePluginsFromReader(reader io.Reader) ([]*MarketplacePlugin, error)

MarketplacePluginsFromReader decodes a json-encoded list of plugins from the given io.Reader.

type MarketplacePluginFilter

type MarketplacePluginFilter struct {
	Page                 int
	PerPage              int
	Filter               string
	ServerVersion        string
	BuildEnterpriseReady bool
	EnterprisePlugins    bool
	LocalOnly            bool
}

MarketplacePluginFilter describes the parameters to request a list of plugins.

func (*MarketplacePluginFilter) ApplyToURL

func (filter *MarketplacePluginFilter) ApplyToURL(u *url.URL)

ApplyToURL modifies the given url to include query string parameters for the request.

type MessageExport

type MessageExport struct {
	TeamId          *string
	TeamName        *string
	TeamDisplayName *string

	ChannelId          *string
	ChannelName        *string
	ChannelDisplayName *string
	ChannelType        *string

	UserId    *string
	UserEmail *string
	Username  *string
	IsBot     bool

	PostId         *string
	PostCreateAt   *int64
	PostUpdateAt   *int64
	PostDeleteAt   *int64
	PostMessage    *string
	PostType       *string
	PostRootId     *string
	PostProps      *string
	PostOriginalId *string
	PostFileIds    StringArray
}

type MessageExportSettings

type MessageExportSettings struct {
	EnableExport          *bool   `access:"compliance"`
	ExportFormat          *string `access:"compliance"`
	DailyRunTime          *string `access:"compliance"`
	ExportFromTimestamp   *int64  `access:"compliance"`
	BatchSize             *int    `access:"compliance"`
	DownloadExportResults *bool   `access:"compliance"`

	// formatter-specific settings - these are only expected to be non-nil if ExportFormat is set to the associated format
	GlobalRelaySettings *GlobalRelayMessageExportSettings
}

func (*MessageExportSettings) SetDefaults

func (s *MessageExportSettings) SetDefaults()

type MetricsSettings

type MetricsSettings struct {
	Enable           *bool   `access:"environment,write_restrictable"`
	BlockProfileRate *int    `access:"environment,write_restrictable"`
	ListenAddress    *string `access:"environment,write_restrictable"`
}

func (*MetricsSettings) SetDefaults

func (s *MetricsSettings) SetDefaults()

type MfaSecret

type MfaSecret struct {
	Secret string `json:"secret"`
	QRCode string `json:"qr_code"`
}

func MfaSecretFromJson

func MfaSecretFromJson(data io.Reader) *MfaSecret

func (*MfaSecret) ToJson

func (me *MfaSecret) ToJson() string

type NameID added in v5.20.0

type NameID struct {
	NameQualifier   string `xml:",attr"`
	SPNameQualifier string `xml:",attr"`
	Format          string `xml:",attr,omitempty"`
	SPProvidedID    string `xml:",attr"`
	Value           string `xml:",chardata"`
}

type NameIDFormat added in v5.20.0

type NameIDFormat struct {
	XMLName xml.Name
	Format  string `xml:",attr,omitempty"`
	Value   string `xml:",innerxml"`
}

type NativeAppSettings

type NativeAppSettings struct {
	AppDownloadLink        *string `access:"site,write_restrictable"`
	AndroidAppDownloadLink *string `access:"site,write_restrictable"`
	IosAppDownloadLink     *string `access:"site,write_restrictable"`
}

func (*NativeAppSettings) SetDefaults

func (s *NativeAppSettings) SetDefaults()

type NoticeAction added in v5.28.0

type NoticeAction string

Optional action to perform on action button click. (defaults to closing the notice)

Possible actions to execute on button press

const (
	URL NoticeAction = "url"
)

type NoticeAudience added in v5.28.0

type NoticeAudience string

User role, i.e. who will see the notice. Defaults to "all"

const (
	NoticeAudience_All       NoticeAudience = "all"
	NoticeAudience_Member    NoticeAudience = "member"
	NoticeAudience_Sysadmin  NoticeAudience = "sysadmin"
	NoticeAudience_TeamAdmin NoticeAudience = "teamadmin"
)

func NewNoticeAudience added in v5.28.0

func NewNoticeAudience(s NoticeAudience) *NoticeAudience

func (*NoticeAudience) Matches added in v5.28.0

func (a *NoticeAudience) Matches(sysAdmin bool, teamAdmin bool) bool

type NoticeClientType added in v5.28.0

type NoticeClientType string

Only show the notice on specific clients. Defaults to 'all'

Client type. Defaults to "all"

const (
	NoticeClientType_All           NoticeClientType = "all"
	NoticeClientType_Desktop       NoticeClientType = "desktop"
	NoticeClientType_Mobile        NoticeClientType = "mobile"
	NoticeClientType_MobileAndroid NoticeClientType = "mobile-android"
	NoticeClientType_MobileIos     NoticeClientType = "mobile-ios"
	NoticeClientType_Web           NoticeClientType = "web"
)

func NewNoticeClientType added in v5.28.0

func NewNoticeClientType(s NoticeClientType) *NoticeClientType

func NoticeClientTypeFromString added in v5.28.0

func NoticeClientTypeFromString(s string) (NoticeClientType, error)

func (*NoticeClientType) Matches added in v5.28.0

func (c *NoticeClientType) Matches(other NoticeClientType) bool

type NoticeInstanceType added in v5.28.0

type NoticeInstanceType string

Instance type. Defaults to "both"

const (
	NoticeInstanceType_Both   NoticeInstanceType = "both"
	NoticeInstanceType_Cloud  NoticeInstanceType = "cloud"
	NoticeInstanceType_OnPrem NoticeInstanceType = "onprem"
)

func NewNoticeInstanceType added in v5.28.0

func NewNoticeInstanceType(n NoticeInstanceType) *NoticeInstanceType

func (*NoticeInstanceType) Matches added in v5.28.0

func (t *NoticeInstanceType) Matches(isCloud bool) bool

type NoticeMessage added in v5.28.0

type NoticeMessage struct {
	NoticeMessageInternal
	ID            string `json:"id"`
	SysAdminOnly  bool   `json:"sysAdminOnly"`
	TeamAdminOnly bool   `json:"teamAdminOnly"`
}

type NoticeMessageInternal added in v5.28.0

type NoticeMessageInternal struct {
	Action      *NoticeAction `json:"action,omitempty"`      // Optional action to perform on action button click. (defaults to closing the notice)
	ActionParam *string       `json:"actionParam,omitempty"` // Optional action parameter.; Example: {"action": "url", actionParam: "/console/some-page"}
	ActionText  *string       `json:"actionText,omitempty"`  // Optional override for the action button text (defaults to OK)
	Description string        `json:"description"`           // Notice content. Use {{Mattermost}} instead of plain text to support white-labeling. Text; supports Markdown.
	Image       *string       `json:"image,omitempty"`
	Title       string        `json:"title"` // Notice title. Use {{Mattermost}} instead of plain text to support white-labeling. Text; supports Markdown.
}

type NoticeMessages added in v5.28.0

type NoticeMessages []NoticeMessage

func UnmarshalProductNoticeMessages added in v5.28.0

func UnmarshalProductNoticeMessages(data io.Reader) (NoticeMessages, error)

func (*NoticeMessages) Marshal added in v5.28.0

func (r *NoticeMessages) Marshal() ([]byte, error)

type NoticeSKU added in v5.28.0

type NoticeSKU string

SKU. Defaults to "all"

const (
	NoticeSKU_E0   NoticeSKU = "e0"
	NoticeSKU_E10  NoticeSKU = "e10"
	NoticeSKU_E20  NoticeSKU = "e20"
	NoticeSKU_All  NoticeSKU = "all"
	NoticeSKU_Team NoticeSKU = "team"
)

func NewNoticeSKU added in v5.28.0

func NewNoticeSKU(s NoticeSKU) *NoticeSKU

func (*NoticeSKU) Matches added in v5.28.0

func (c *NoticeSKU) Matches(s string) bool

type NotificationLogSettings

type NotificationLogSettings struct {
	EnableConsole         *bool   `access:"write_restrictable"`
	ConsoleLevel          *string `access:"write_restrictable"`
	ConsoleJson           *bool   `access:"write_restrictable"`
	EnableFile            *bool   `access:"write_restrictable"`
	FileLevel             *string `access:"write_restrictable"`
	FileJson              *bool   `access:"write_restrictable"`
	FileLocation          *string `access:"write_restrictable"`
	AdvancedLoggingConfig *string `access:"write_restrictable"`
}

func (*NotificationLogSettings) SetDefaults

func (s *NotificationLogSettings) SetDefaults()

type OAuthApp

type OAuthApp struct {
	Id           string      `json:"id"`
	CreatorId    string      `json:"creator_id"`
	CreateAt     int64       `json:"create_at"`
	UpdateAt     int64       `json:"update_at"`
	ClientSecret string      `json:"client_secret"`
	Name         string      `json:"name"`
	Description  string      `json:"description"`
	IconURL      string      `json:"icon_url"`
	CallbackUrls StringArray `json:"callback_urls"`
	Homepage     string      `json:"homepage"`
	IsTrusted    bool        `json:"is_trusted"`
}

func OAuthAppFromJson

func OAuthAppFromJson(data io.Reader) *OAuthApp

func OAuthAppListFromJson

func OAuthAppListFromJson(data io.Reader) []*OAuthApp

func (*OAuthApp) Etag

func (a *OAuthApp) Etag() string

Generate a valid strong etag so the browser can cache the results

func (*OAuthApp) IsValid

func (a *OAuthApp) IsValid() *AppError

IsValid validates the app and returns an error if it isn't configured correctly.

func (*OAuthApp) IsValidRedirectURL

func (a *OAuthApp) IsValidRedirectURL(url string) bool

func (*OAuthApp) PreSave

func (a *OAuthApp) PreSave()

PreSave will set the Id and ClientSecret if missing. It will also fill in the CreateAt, UpdateAt times. It should be run before saving the app to the db.

func (*OAuthApp) PreUpdate

func (a *OAuthApp) PreUpdate()

PreUpdate should be run before updating the app in the db.

func (*OAuthApp) Sanitize

func (a *OAuthApp) Sanitize()

Remove any private data from the app object

func (*OAuthApp) ToJson

func (a *OAuthApp) ToJson() string

type Office365Settings added in v5.22.0

type Office365Settings struct {
	Enable          *bool   `access:"authentication"`
	Secret          *string `access:"authentication"`
	Id              *string `access:"authentication"`
	Scope           *string `access:"authentication"`
	AuthEndpoint    *string `access:"authentication"`
	TokenEndpoint   *string `access:"authentication"`
	UserApiEndpoint *string `access:"authentication"`
	DirectoryId     *string `access:"authentication"`
}

func (*Office365Settings) SSOSettings added in v5.22.0

func (s *Office365Settings) SSOSettings() *SSOSettings

type OpenDialogRequest

type OpenDialogRequest struct {
	TriggerId string `json:"trigger_id"`
	URL       string `json:"url"`
	Dialog    Dialog `json:"dialog"`
}

func (*OpenDialogRequest) DecodeAndVerifyTriggerId

func (r *OpenDialogRequest) DecodeAndVerifyTriggerId(s *ecdsa.PrivateKey) (string, string, *AppError)

type OrderedSidebarCategories added in v5.26.0

type OrderedSidebarCategories struct {
	Categories SidebarCategoriesWithChannels `json:"categories"`
	Order      SidebarCategoryOrder          `json:"order"`
}

OrderedSidebarCategories combines categories, their channel IDs and an array of Category IDs, sorted

func OrderedSidebarCategoriesFromJson added in v5.26.0

func OrderedSidebarCategoriesFromJson(data io.Reader) (*OrderedSidebarCategories, error)

func (OrderedSidebarCategories) ToJson added in v5.26.0

func (o OrderedSidebarCategories) ToJson() []byte

type Organization added in v5.20.0

type Organization struct {
	XMLName                  xml.Name
	OrganizationNames        []LocalizedName `xml:"OrganizationName"`
	OrganizationDisplayNames []LocalizedName `xml:"OrganizationDisplayName"`
	OrganizationURLs         []LocalizedURI  `xml:"OrganizationURL"`
}

type OrphanedRecord added in v5.28.0

type OrphanedRecord struct {
	ParentId *string `json:"parent_id"`
	ChildId  *string `json:"child_id"`
}

type OutgoingWebhook

type OutgoingWebhook struct {
	Id           string      `json:"id"`
	Token        string      `json:"token"`
	CreateAt     int64       `json:"create_at"`
	UpdateAt     int64       `json:"update_at"`
	DeleteAt     int64       `json:"delete_at"`
	CreatorId    string      `json:"creator_id"`
	ChannelId    string      `json:"channel_id"`
	TeamId       string      `json:"team_id"`
	TriggerWords StringArray `json:"trigger_words"`
	TriggerWhen  int         `json:"trigger_when"`
	CallbackURLs StringArray `json:"callback_urls"`
	DisplayName  string      `json:"display_name"`
	Description  string      `json:"description"`
	ContentType  string      `json:"content_type"`
	Username     string      `json:"username"`
	IconURL      string      `json:"icon_url"`
}

func OutgoingWebhookFromJson

func OutgoingWebhookFromJson(data io.Reader) *OutgoingWebhook

func OutgoingWebhookListFromJson

func OutgoingWebhookListFromJson(data io.Reader) []*OutgoingWebhook

func (*OutgoingWebhook) GetTriggerWord

func (o *OutgoingWebhook) GetTriggerWord(word string, isExactMatch bool) (triggerWord string)

func (*OutgoingWebhook) IsValid

func (o *OutgoingWebhook) IsValid() *AppError

func (*OutgoingWebhook) PreSave

func (o *OutgoingWebhook) PreSave()

func (*OutgoingWebhook) PreUpdate

func (o *OutgoingWebhook) PreUpdate()

func (*OutgoingWebhook) ToJson

func (o *OutgoingWebhook) ToJson() string

func (*OutgoingWebhook) TriggerWordExactMatch

func (o *OutgoingWebhook) TriggerWordExactMatch(word string) bool

func (*OutgoingWebhook) TriggerWordStartsWith

func (o *OutgoingWebhook) TriggerWordStartsWith(word string) bool

type OutgoingWebhookPayload

type OutgoingWebhookPayload struct {
	Token       string `json:"token"`
	TeamId      string `json:"team_id"`
	TeamDomain  string `json:"team_domain"`
	ChannelId   string `json:"channel_id"`
	ChannelName string `json:"channel_name"`
	Timestamp   int64  `json:"timestamp"`
	UserId      string `json:"user_id"`
	UserName    string `json:"user_name"`
	PostId      string `json:"post_id"`
	Text        string `json:"text"`
	TriggerWord string `json:"trigger_word"`
	FileIds     string `json:"file_ids"`
}

func (*OutgoingWebhookPayload) ToFormValues

func (o *OutgoingWebhookPayload) ToFormValues() string

func (*OutgoingWebhookPayload) ToJSON

func (o *OutgoingWebhookPayload) ToJSON() string

type OutgoingWebhookResponse

type OutgoingWebhookResponse struct {
	Text         *string            `json:"text"`
	Username     string             `json:"username"`
	IconURL      string             `json:"icon_url"`
	Props        StringInterface    `json:"props"`
	Attachments  []*SlackAttachment `json:"attachments"`
	Type         string             `json:"type"`
	ResponseType string             `json:"response_type"`
}

func OutgoingWebhookResponseFromJson

func OutgoingWebhookResponseFromJson(data io.Reader) (*OutgoingWebhookResponse, error)

func (*OutgoingWebhookResponse) ToJson

func (o *OutgoingWebhookResponse) ToJson() string

type PageOpts

type PageOpts struct {
	Page    int
	PerPage int
}

type PasswordSettings

type PasswordSettings struct {
	MinimumLength *int  `access:"authentication"`
	Lowercase     *bool `access:"authentication"`
	Number        *bool `access:"authentication"`
	Uppercase     *bool `access:"authentication"`
	Symbol        *bool `access:"authentication"`
}

func (*PasswordSettings) SetDefaults

func (s *PasswordSettings) SetDefaults()

type Permission

type Permission struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Scope       string `json:"scope"`
}
var PERMISSION_ADD_REACTION *Permission
var PERMISSION_ADD_USER_TO_TEAM *Permission
var PERMISSION_ASSIGN_BOT *Permission
var PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE *Permission
var PERMISSION_CONVERT_PRIVATE_CHANNEL_TO_PUBLIC *Permission
var PERMISSION_CONVERT_PUBLIC_CHANNEL_TO_PRIVATE *Permission
var PERMISSION_CREATE_BOT *Permission
var PERMISSION_CREATE_DIRECT_CHANNEL *Permission
var PERMISSION_CREATE_EMOJIS *Permission
var PERMISSION_CREATE_GROUP_CHANNEL *Permission
var PERMISSION_CREATE_POST *Permission
var PERMISSION_CREATE_POST_EPHEMERAL *Permission
var PERMISSION_CREATE_POST_PUBLIC *Permission
var PERMISSION_CREATE_PRIVATE_CHANNEL *Permission
var PERMISSION_CREATE_PUBLIC_CHANNEL *Permission
var PERMISSION_CREATE_TEAM *Permission
var PERMISSION_CREATE_USER_ACCESS_TOKEN *Permission
var PERMISSION_DELETE_EMOJIS *Permission
var PERMISSION_DELETE_OTHERS_EMOJIS *Permission
var PERMISSION_DELETE_OTHERS_POSTS *Permission
var PERMISSION_DELETE_POST *Permission
var PERMISSION_DELETE_PRIVATE_CHANNEL *Permission
var PERMISSION_DELETE_PUBLIC_CHANNEL *Permission
var PERMISSION_DEMOTE_TO_GUEST *Permission
var PERMISSION_EDIT_BRAND *Permission
var PERMISSION_EDIT_OTHERS_POSTS *Permission
var PERMISSION_EDIT_OTHER_USERS *Permission
var PERMISSION_EDIT_POST *Permission
var PERMISSION_GET_PUBLIC_LINK *Permission
var PERMISSION_IMPORT_TEAM *Permission
var PERMISSION_INVITE_GUEST *Permission
var PERMISSION_INVITE_USER *Permission
var PERMISSION_JOIN_PRIVATE_TEAMS *Permission
var PERMISSION_JOIN_PUBLIC_CHANNELS *Permission
var PERMISSION_JOIN_PUBLIC_TEAMS *Permission
var PERMISSION_LIST_PRIVATE_TEAMS *Permission
var PERMISSION_LIST_PUBLIC_TEAMS *Permission
var PERMISSION_LIST_TEAM_CHANNELS *Permission
var PERMISSION_LIST_USERS_WITHOUT_TEAM *Permission
var PERMISSION_MANAGE_BOTS *Permission
var PERMISSION_MANAGE_CHANNEL_ROLES *Permission
var PERMISSION_MANAGE_EMOJIS *Permission
var PERMISSION_MANAGE_INCOMING_WEBHOOKS *Permission
var PERMISSION_MANAGE_JOBS *Permission
var PERMISSION_MANAGE_OAUTH *Permission
var PERMISSION_MANAGE_OTHERS_BOTS *Permission
var PERMISSION_MANAGE_OTHERS_EMOJIS *Permission
var PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS *Permission
var PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS *Permission
var PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS *Permission
var PERMISSION_MANAGE_OTHERS_WEBHOOKS *Permission
var PERMISSION_MANAGE_OUTGOING_WEBHOOKS *Permission
var PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS *Permission
var PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES *Permission
var PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS *Permission
var PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES *Permission
var PERMISSION_MANAGE_ROLES *Permission
var PERMISSION_MANAGE_SLASH_COMMANDS *Permission
var PERMISSION_MANAGE_SYSTEM *Permission

General permission that encompasses all system admin functions in the future this could be broken up to allow access to some admin functions but not others

var PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH *Permission
var PERMISSION_MANAGE_TEAM *Permission
var PERMISSION_MANAGE_TEAM_ROLES *Permission
var PERMISSION_MANAGE_WEBHOOKS *Permission
var PERMISSION_PERMANENT_DELETE_USER *Permission
var PERMISSION_PROMOTE_GUEST *Permission
var PERMISSION_READ_BOTS *Permission
var PERMISSION_READ_CHANNEL *Permission
var PERMISSION_READ_JOBS *Permission
var PERMISSION_READ_OTHERS_BOTS *Permission
var PERMISSION_READ_OTHER_USERS_TEAMS *Permission
var PERMISSION_READ_PRIVATE_CHANNEL_GROUPS *Permission
var PERMISSION_READ_PUBLIC_CHANNEL *Permission
var PERMISSION_READ_PUBLIC_CHANNEL_GROUPS *Permission
var PERMISSION_READ_USER_ACCESS_TOKEN *Permission
var PERMISSION_REMOVE_OTHERS_REACTIONS *Permission
var PERMISSION_REMOVE_REACTION *Permission
var PERMISSION_REMOVE_USER_FROM_TEAM *Permission
var PERMISSION_REVOKE_USER_ACCESS_TOKEN *Permission
var PERMISSION_SYSCONSOLE_READ_ABOUT *Permission
var PERMISSION_SYSCONSOLE_READ_AUTHENTICATION *Permission
var PERMISSION_SYSCONSOLE_READ_COMPLIANCE *Permission
var PERMISSION_SYSCONSOLE_READ_ENVIRONMENT *Permission
var PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL *Permission
var PERMISSION_SYSCONSOLE_READ_INTEGRATIONS *Permission
var PERMISSION_SYSCONSOLE_READ_PLUGINS *Permission
var PERMISSION_SYSCONSOLE_READ_REPORTING *Permission
var PERMISSION_SYSCONSOLE_READ_SITE *Permission
var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_CHANNELS *Permission
var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_GROUPS *Permission
var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_PERMISSIONS *Permission
var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_TEAMS *Permission
var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_USERS *Permission
var PERMISSION_SYSCONSOLE_WRITE_ABOUT *Permission
var PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION *Permission
var PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE *Permission
var PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT *Permission
var PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL *Permission
var PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS *Permission
var PERMISSION_SYSCONSOLE_WRITE_PLUGINS *Permission
var PERMISSION_SYSCONSOLE_WRITE_REPORTING *Permission
var PERMISSION_SYSCONSOLE_WRITE_SITE *Permission
var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_CHANNELS *Permission
var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_GROUPS *Permission
var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_PERMISSIONS *Permission
var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_TEAMS *Permission
var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_USERS *Permission
var PERMISSION_UPLOAD_FILE *Permission
var PERMISSION_USE_CHANNEL_MENTIONS *Permission
var PERMISSION_USE_GROUP_MENTIONS *Permission
var PERMISSION_USE_SLASH_COMMANDS *Permission
var PERMISSION_VIEW_MEMBERS *Permission
var PERMISSION_VIEW_TEAM *Permission

type PluginEventData

type PluginEventData struct {
	Id string `json:"id"`
}

PluginEventData used to notify peers about plugin changes.

func PluginEventDataFromJson

func PluginEventDataFromJson(data io.Reader) PluginEventData

func (*PluginEventData) ToJson

func (p *PluginEventData) ToJson() string

type PluginInfo

type PluginInfo struct {
	Manifest
}

type PluginKVSetOptions

type PluginKVSetOptions struct {
	Atomic          bool   // Only store the value if the current value matches the oldValue
	OldValue        []byte // The value to compare with the current value. Only used when Atomic is true
	ExpireInSeconds int64  // Set an expire counter
}

PluginKVSetOptions contains information on how to store a value in the plugin KV store.

func (*PluginKVSetOptions) IsValid

func (opt *PluginKVSetOptions) IsValid() *AppError

IsValid returns nil if the chosen options are valid.

type PluginKeyValue

type PluginKeyValue struct {
	PluginId string `json:"plugin_id"`
	Key      string `json:"key" db:"PKey"`
	Value    []byte `json:"value" db:"PValue"`
	ExpireAt int64  `json:"expire_at"`
}

func (*PluginKeyValue) IsValid

func (kv *PluginKeyValue) IsValid() *AppError

type PluginOption

type PluginOption struct {
	// The display name for the option.
	DisplayName string `json:"display_name" yaml:"display_name"`

	// The string value for the option.
	Value string `json:"value" yaml:"value"`
}

type PluginSetting

type PluginSetting struct {
	// The key that the setting will be assigned to in the configuration file.
	Key string `json:"key" yaml:"key"`

	// The display name for the setting.
	DisplayName string `json:"display_name" yaml:"display_name"`

	// The type of the setting.
	//
	// "bool" will result in a boolean true or false setting.
	//
	// "dropdown" will result in a string setting that allows the user to select from a list of
	// pre-defined options.
	//
	// "generated" will result in a string setting that is set to a random, cryptographically secure
	// string.
	//
	// "radio" will result in a string setting that allows the user to select from a short selection
	// of pre-defined options.
	//
	// "text" will result in a string setting that can be typed in manually.
	//
	// "longtext" will result in a multi line string that can be typed in manually.
	//
	// "number" will result in in integer setting that can be typed in manually.
	//
	// "username" will result in a text setting that will autocomplete to a username.
	//
	// "custom" will result in a custom defined setting and will load the custom component registered for the Web App System Console.
	Type string `json:"type" yaml:"type"`

	// The help text to display to the user. Supports Markdown formatting.
	HelpText string `json:"help_text" yaml:"help_text"`

	// The help text to display alongside the "Regenerate" button for settings of the "generated" type.
	RegenerateHelpText string `json:"regenerate_help_text,omitempty" yaml:"regenerate_help_text,omitempty"`

	// The placeholder to display for "generated", "text", "longtext", "number" and "username" types when blank.
	Placeholder string `json:"placeholder" yaml:"placeholder"`

	// The default value of the setting.
	Default interface{} `json:"default" yaml:"default"`

	// For "radio" or "dropdown" settings, this is the list of pre-defined options that the user can choose
	// from.
	Options []*PluginOption `json:"options,omitempty" yaml:"options,omitempty"`
}

type PluginSettingType added in v5.22.0

type PluginSettingType int
const (
	Bool PluginSettingType = iota
	Dropdown
	Generated
	Radio
	Text
	LongText
	Number
	Username
	Custom
)

type PluginSettings

type PluginSettings struct {
	Enable                      *bool                             `access:"plugins"`
	EnableUploads               *bool                             `access:"plugins,write_restrictable"`
	AllowInsecureDownloadUrl    *bool                             `access:"plugins,write_restrictable"`
	EnableHealthCheck           *bool                             `access:"plugins,write_restrictable"`
	Directory                   *string                           `access:"plugins,write_restrictable"`
	ClientDirectory             *string                           `access:"plugins,write_restrictable"`
	Plugins                     map[string]map[string]interface{} `access:"plugins"`
	PluginStates                map[string]*PluginState           `access:"plugins"`
	EnableMarketplace           *bool                             `access:"plugins"`
	EnableRemoteMarketplace     *bool                             `access:"plugins"`
	AutomaticPrepackagedPlugins *bool                             `access:"plugins"`
	RequirePluginSignature      *bool                             `access:"plugins"`
	MarketplaceUrl              *string                           `access:"plugins"`
	SignaturePublicKeyFiles     []string                          `access:"plugins"`
}

func (*PluginSettings) SetDefaults

func (s *PluginSettings) SetDefaults(ls LogSettings)

type PluginSettingsSchema

type PluginSettingsSchema struct {
	// Optional text to display above the settings. Supports Markdown formatting.
	Header string `json:"header" yaml:"header"`

	// Optional text to display below the settings. Supports Markdown formatting.
	Footer string `json:"footer" yaml:"footer"`

	// A list of setting definitions.
	Settings []*PluginSetting `json:"settings" yaml:"settings"`
}

type PluginState

type PluginState struct {
	Enable bool
}

type PluginStatus

type PluginStatus struct {
	PluginId    string `json:"plugin_id"`
	ClusterId   string `json:"cluster_id"`
	PluginPath  string `json:"plugin_path"`
	State       int    `json:"state"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
}

PluginStatus provides a cluster-aware view of installed plugins.

type PluginStatuses

type PluginStatuses []*PluginStatus

func PluginStatusesFromJson

func PluginStatusesFromJson(data io.Reader) PluginStatuses

func (*PluginStatuses) ToJson

func (m *PluginStatuses) ToJson() string

type PluginsResponse

type PluginsResponse struct {
	Active   []*PluginInfo `json:"active"`
	Inactive []*PluginInfo `json:"inactive"`
}

func PluginsResponseFromJson

func PluginsResponseFromJson(data io.Reader) *PluginsResponse

func (*PluginsResponse) ToJson

func (m *PluginsResponse) ToJson() string

type Post

type Post struct {
	Id         string `json:"id"`
	CreateAt   int64  `json:"create_at"`
	UpdateAt   int64  `json:"update_at"`
	EditAt     int64  `json:"edit_at"`
	DeleteAt   int64  `json:"delete_at"`
	IsPinned   bool   `json:"is_pinned"`
	UserId     string `json:"user_id"`
	ChannelId  string `json:"channel_id"`
	RootId     string `json:"root_id"`
	ParentId   string `json:"parent_id"`
	OriginalId string `json:"original_id"`

	Message string `json:"message"`
	// MessageSource will contain the message as submitted by the user if Message has been modified
	// by Mattermost for presentation (e.g if an image proxy is being used). It should be used to
	// populate edit boxes if present.
	MessageSource string `json:"message_source,omitempty" db:"-"`

	Type string `json:"type"`

	Props         StringInterface `json:"props"` // Deprecated: use GetProps()
	Hashtags      string          `json:"hashtags"`
	Filenames     StringArray     `json:"filenames,omitempty"` // Deprecated, do not use this field any more
	FileIds       StringArray     `json:"file_ids,omitempty"`
	PendingPostId string          `json:"pending_post_id" db:"-"`
	HasReactions  bool            `json:"has_reactions,omitempty"`

	// Transient data populated before sending a post to the client
	ReplyCount int64         `json:"reply_count" db:"-"`
	Metadata   *PostMetadata `json:"metadata,omitempty" db:"-"`
	// contains filtered or unexported fields
}

func AddPostActionCookies

func AddPostActionCookies(o *Post, secret []byte) *Post

func PostFromJson

func PostFromJson(data io.Reader) *Post

func (*Post) AddProp

func (o *Post) AddProp(key string, value interface{})

func (*Post) Attachments

func (o *Post) Attachments() []*SlackAttachment

func (*Post) AttachmentsEqual

func (o *Post) AttachmentsEqual(input *Post) bool

func (*Post) ChannelMentions

func (o *Post) ChannelMentions() []string

func (*Post) Clone

func (o *Post) Clone() *Post

Clone shallowly copies the post and returns the copy.

func (*Post) DelProp added in v5.19.2

func (o *Post) DelProp(key string)

func (*Post) DisableMentionHighlights added in v5.22.0

func (o *Post) DisableMentionHighlights() string

DisableMentionHighlights disables a posts mention highlighting and returns the first channel mention that was present in the message.

func (*Post) Etag

func (o *Post) Etag() string

func (*Post) GenerateActionIds

func (o *Post) GenerateActionIds()

func (*Post) GetAction

func (o *Post) GetAction(id string) *PostAction

func (*Post) GetProp added in v5.19.2

func (o *Post) GetProp(key string) interface{}

func (*Post) GetProps added in v5.19.2

func (o *Post) GetProps() StringInterface

func (*Post) IsJoinLeaveMessage

func (o *Post) IsJoinLeaveMessage() bool

func (*Post) IsSystemMessage

func (o *Post) IsSystemMessage() bool

func (*Post) IsValid

func (o *Post) IsValid(maxPostSize int) *AppError

func (*Post) MakeNonNil

func (o *Post) MakeNonNil()

func (*Post) Patch

func (o *Post) Patch(patch *PostPatch)

func (*Post) PreCommit

func (o *Post) PreCommit()

func (*Post) PreSave

func (o *Post) PreSave()

func (*Post) SanitizeProps

func (o *Post) SanitizeProps()

func (*Post) SetProps added in v5.19.2

func (o *Post) SetProps(props StringInterface)

func (*Post) ShallowCopy added in v5.19.2

func (o *Post) ShallowCopy(dst *Post) error

ShallowCopy is an utility function to shallow copy a Post to the given destination without touching the internal RWMutex.

func (*Post) StripActionIntegrations

func (o *Post) StripActionIntegrations()

func (*Post) ToJson

func (o *Post) ToJson() string

func (*Post) ToUnsanitizedJson

func (o *Post) ToUnsanitizedJson() string

func (*Post) WithRewrittenImageURLs

func (o *Post) WithRewrittenImageURLs(f func(string) string) *Post

WithRewrittenImageURLs returns a new shallow copy of the post where the message has been rewritten via RewriteImageURLs.

type PostAction

type PostAction struct {
	// A unique Action ID. If not set, generated automatically.
	Id string `json:"id,omitempty"`

	// The type of the interactive element. Currently supported are
	// "select" and "button".
	Type string `json:"type,omitempty"`

	// The text on the button, or in the select placeholder.
	Name string `json:"name,omitempty"`

	// If the action is disabled.
	Disabled bool `json:"disabled,omitempty"`

	// Style defines a text and border style.
	// Supported values are "default", "primary", "success", "good", "warning", "danger"
	// and any hex color.
	Style string `json:"style,omitempty"`

	// DataSource indicates the data source for the select action. If left
	// empty, the select is populated from Options. Other supported values
	// are "users" and "channels".
	DataSource string `json:"data_source,omitempty"`

	// Options contains the values listed in a select dropdown on the post.
	Options []*PostActionOptions `json:"options,omitempty"`

	// DefaultOption contains the option, if any, that will appear as the
	// default selection in a select box. It has no effect when used with
	// other types of actions.
	DefaultOption string `json:"default_option,omitempty"`

	// Defines the interaction with the backend upon a user action.
	// Integration contains Context, which is private plugin data;
	// Integrations are stripped from Posts when they are sent to the
	// client, or are encrypted in a Cookie.
	Integration *PostActionIntegration `json:"integration,omitempty"`
	Cookie      string                 `json:"cookie,omitempty" db:"-"`
}

func (*PostAction) Equals

func (p *PostAction) Equals(input *PostAction) bool

type PostActionAPIResponse

type PostActionAPIResponse struct {
	Status    string `json:"status"` // needed to maintain backwards compatibility
	TriggerId string `json:"trigger_id"`
}

type PostActionCookie

type PostActionCookie struct {
	Type        string                 `json:"type,omitempty"`
	PostId      string                 `json:"post_id,omitempty"`
	RootPostId  string                 `json:"root_post_id,omitempty"`
	ChannelId   string                 `json:"channel_id,omitempty"`
	DataSource  string                 `json:"data_source,omitempty"`
	Integration *PostActionIntegration `json:"integration,omitempty"`
	RetainProps map[string]interface{} `json:"retain_props,omitempty"`
	RemoveProps []string               `json:"remove_props,omitempty"`
}

PostActionCookie is set by the server, serialized and encrypted into PostAction.Cookie. The clients should hold on to it, and include it with subsequent DoPostAction requests. This allows the server to access the action metadata even when it's not available in the database, for ephemeral posts.

type PostActionIntegration

type PostActionIntegration struct {
	URL     string                 `json:"url,omitempty"`
	Context map[string]interface{} `json:"context,omitempty"`
}

type PostActionIntegrationRequest

type PostActionIntegrationRequest struct {
	UserId      string                 `json:"user_id"`
	UserName    string                 `json:"user_name"`
	ChannelId   string                 `json:"channel_id"`
	ChannelName string                 `json:"channel_name"`
	TeamId      string                 `json:"team_id"`
	TeamName    string                 `json:"team_domain"`
	PostId      string                 `json:"post_id"`
	TriggerId   string                 `json:"trigger_id"`
	Type        string                 `json:"type"`
	DataSource  string                 `json:"data_source"`
	Context     map[string]interface{} `json:"context,omitempty"`
}

func PostActionIntegrationRequestFromJson

func PostActionIntegrationRequestFromJson(data io.Reader) *PostActionIntegrationRequest

func (*PostActionIntegrationRequest) GenerateTriggerId

func (r *PostActionIntegrationRequest) GenerateTriggerId(s crypto.Signer) (string, string, *AppError)

func (*PostActionIntegrationRequest) ToJson

func (r *PostActionIntegrationRequest) ToJson() []byte

type PostActionIntegrationResponse

type PostActionIntegrationResponse struct {
	Update           *Post  `json:"update"`
	EphemeralText    string `json:"ephemeral_text"`
	SkipSlackParsing bool   `json:"skip_slack_parsing"` // Set to `true` to skip the Slack-compatibility handling of Text.
}

func PostActionIntegrationResponseFromJson

func PostActionIntegrationResponseFromJson(data io.Reader) *PostActionIntegrationResponse

func (*PostActionIntegrationResponse) ToJson

func (r *PostActionIntegrationResponse) ToJson() []byte

type PostActionOptions

type PostActionOptions struct {
	Text  string `json:"text"`
	Value string `json:"value"`
}

type PostEmbed

type PostEmbed struct {
	Type PostEmbedType `json:"type"`

	// The URL of the embedded content. Used for image and OpenGraph embeds.
	URL string `json:"url,omitempty"`

	// Any additional data for the embedded content. Only used for OpenGraph embeds.
	Data interface{} `json:"data,omitempty"`
}

type PostEmbedType

type PostEmbedType string
const (
	POST_EMBED_IMAGE              PostEmbedType = "image"
	POST_EMBED_MESSAGE_ATTACHMENT PostEmbedType = "message_attachment"
	POST_EMBED_OPENGRAPH          PostEmbedType = "opengraph"
	POST_EMBED_LINK               PostEmbedType = "link"
)

type PostEphemeral

type PostEphemeral struct {
	UserID string `json:"user_id"`
	Post   *Post  `json:"post"`
}

func (*PostEphemeral) ToUnsanitizedJson

func (o *PostEphemeral) ToUnsanitizedJson() string

type PostForExport

type PostForExport struct {
	Post
	TeamName    string
	ChannelName string
	Username    string
	ReplyCount  int
}

type PostForIndexing

type PostForIndexing struct {
	Post
	TeamId         string `json:"team_id"`
	ParentCreateAt *int64 `json:"parent_create_at"`
}

type PostImage

type PostImage struct {
	Width  int `json:"width"`
	Height int `json:"height"`

	// Format is the name of the image format as used by image/go such as "png", "gif", or "jpeg".
	Format string `json:"format"`

	// FrameCount stores the number of frames in this image, if it is an animated gif. It will be 0 for other formats.
	FrameCount int `json:"frame_count"`
}

func (*PostImage) ToJson

func (o *PostImage) ToJson() string

type PostList

type PostList struct {
	Order      []string         `json:"order"`
	Posts      map[string]*Post `json:"posts"`
	NextPostId string           `json:"next_post_id"`
	PrevPostId string           `json:"prev_post_id"`
}

func NewPostList

func NewPostList() *PostList

func PostListFromJson

func PostListFromJson(data io.Reader) *PostList

func (*PostList) AddOrder

func (o *PostList) AddOrder(id string)

func (*PostList) AddPost

func (o *PostList) AddPost(post *Post)

func (*PostList) Etag

func (o *PostList) Etag() string

func (*PostList) Extend

func (o *PostList) Extend(other *PostList)

func (*PostList) IsChannelId

func (o *PostList) IsChannelId(channelId string) bool

func (*PostList) MakeNonNil

func (o *PostList) MakeNonNil()

func (*PostList) SortByCreateAt

func (o *PostList) SortByCreateAt()

func (*PostList) StripActionIntegrations

func (o *PostList) StripActionIntegrations()

func (*PostList) ToJson

func (o *PostList) ToJson() string

func (*PostList) ToSlice

func (o *PostList) ToSlice() []*Post

func (*PostList) UniqueOrder

func (o *PostList) UniqueOrder()

func (*PostList) WithRewrittenImageURLs

func (o *PostList) WithRewrittenImageURLs(f func(string) string) *PostList

type PostMetadata

type PostMetadata struct {
	// Embeds holds information required to render content embedded in the post. This includes the OpenGraph metadata
	// for links in the post.
	Embeds []*PostEmbed `json:"embeds,omitempty"`

	// Emojis holds all custom emojis used in the post or used in reaction to the post.
	Emojis []*Emoji `json:"emojis,omitempty"`

	// Files holds information about the file attachments on the post.
	Files []*FileInfo `json:"files,omitempty"`

	// Images holds the dimensions of all external images in the post as a map of the image URL to its diemsnions.
	// This includes image embeds (when the message contains a plaintext link to an image), Markdown images, images
	// contained in the OpenGraph metadata, and images contained in message attachments. It does not contain
	// the dimensions of any file attachments as those are stored in FileInfos.
	Images map[string]*PostImage `json:"images,omitempty"`

	// Reactions holds reactions made to the post.
	Reactions []*Reaction `json:"reactions,omitempty"`
}

type PostPatch

type PostPatch struct {
	IsPinned     *bool            `json:"is_pinned"`
	Message      *string          `json:"message"`
	Props        *StringInterface `json:"props"`
	FileIds      *StringArray     `json:"file_ids"`
	HasReactions *bool            `json:"has_reactions"`
}

func PostPatchFromJson

func PostPatchFromJson(data io.Reader) *PostPatch

func (*PostPatch) DisableMentionHighlights added in v5.22.0

func (o *PostPatch) DisableMentionHighlights()

DisableMentionHighlights disables mention highlighting for a post patch if required.

func (*PostPatch) ToJson

func (o *PostPatch) ToJson() string

func (*PostPatch) WithRewrittenImageURLs

func (o *PostPatch) WithRewrittenImageURLs(f func(string) string) *PostPatch

type PostSearchMatches

type PostSearchMatches map[string][]string

type PostSearchResults

type PostSearchResults struct {
	*PostList
	Matches PostSearchMatches `json:"matches"`
}

func MakePostSearchResults

func MakePostSearchResults(posts *PostList, matches PostSearchMatches) *PostSearchResults

func PostSearchResultsFromJson

func PostSearchResultsFromJson(data io.Reader) *PostSearchResults

func (*PostSearchResults) ToJson

func (o *PostSearchResults) ToJson() string

type Preference

type Preference struct {
	UserId   string `json:"user_id"`
	Category string `json:"category"`
	Name     string `json:"name"`
	Value    string `json:"value"`
}

func PreferenceFromJson

func PreferenceFromJson(data io.Reader) *Preference

func (*Preference) IsValid

func (o *Preference) IsValid() *AppError

func (*Preference) PreUpdate

func (o *Preference) PreUpdate()

func (*Preference) ToJson

func (o *Preference) ToJson() string

type Preferences

type Preferences []Preference

func PreferencesFromJson

func PreferencesFromJson(data io.Reader) (Preferences, error)

func (*Preferences) ToJson

func (o *Preferences) ToJson() string

type PrivacySettings

type PrivacySettings struct {
	ShowEmailAddress *bool `access:"site"`
	ShowFullName     *bool `access:"site"`
}

type ProductNotice added in v5.28.0

type ProductNotice struct {
	Conditions        Conditions                       `json:"conditions"`
	ID                string                           `json:"id"`                   // Unique identifier for this notice. Can be a running number. Used for storing 'viewed'; state on the server.
	LocalizedMessages map[string]NoticeMessageInternal `json:"localizedMessages"`    // Notice message data, organized by locale.; Example:; "localizedMessages": {; "en": { "title": "English", description: "English description"},; "frFR": { "title": "Frances", description: "French description"}; }
	Repeatable        *bool                            `json:"repeatable,omitempty"` // Configurable flag if the notice should reappear after it’s seen and dismissed
}

List of product notices. Order is important and is used to resolve priorities. Each notice will only be show if conditions are met.

func (*ProductNotice) SysAdminOnly added in v5.28.0

func (n *ProductNotice) SysAdminOnly() bool

func (*ProductNotice) TeamAdminOnly added in v5.28.0

func (n *ProductNotice) TeamAdminOnly() bool

type ProductNoticeViewState added in v5.28.0

type ProductNoticeViewState struct {
	UserId    string
	NoticeId  string
	Viewed    int32
	Timestamp int64
}

Definition of the table keeping the 'viewed' state of each in-product notice per user

type ProductNotices added in v5.28.0

type ProductNotices []ProductNotice

func UnmarshalProductNotices added in v5.28.0

func UnmarshalProductNotices(data []byte) (ProductNotices, error)

func (*ProductNotices) Marshal added in v5.28.0

func (r *ProductNotices) Marshal() ([]byte, error)

type PushNotification

type PushNotification struct {
	AckId            string `json:"ack_id"`
	Platform         string `json:"platform"`
	ServerId         string `json:"server_id"`
	DeviceId         string `json:"device_id"`
	PostId           string `json:"post_id"`
	Category         string `json:"category,omitempty"`
	Sound            string `json:"sound,omitempty"`
	Message          string `json:"message,omitempty"`
	Badge            int    `json:"badge,omitempty"`
	ContentAvailable int    `json:"cont_ava,omitempty"`
	TeamId           string `json:"team_id,omitempty"`
	ChannelId        string `json:"channel_id,omitempty"`
	RootId           string `json:"root_id,omitempty"`
	ChannelName      string `json:"channel_name,omitempty"`
	Type             string `json:"type,omitempty"`
	SenderId         string `json:"sender_id,omitempty"`
	SenderName       string `json:"sender_name,omitempty"`
	OverrideUsername string `json:"override_username,omitempty"`
	OverrideIconUrl  string `json:"override_icon_url,omitempty"`
	FromWebhook      string `json:"from_webhook,omitempty"`
	Version          string `json:"version,omitempty"`
	IsIdLoaded       bool   `json:"is_id_loaded"`
}

func PushNotificationFromJson

func PushNotificationFromJson(data io.Reader) (*PushNotification, error)

func (*PushNotification) DeepCopy added in v5.24.0

func (me *PushNotification) DeepCopy() *PushNotification

func (*PushNotification) SetDeviceIdAndPlatform

func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string)

func (*PushNotification) ToJson

func (me *PushNotification) ToJson() string

type PushNotificationAck

type PushNotificationAck struct {
	Id               string `json:"id"`
	ClientReceivedAt int64  `json:"received_at"`
	ClientPlatform   string `json:"platform"`
	NotificationType string `json:"type"`
	PostId           string `json:"post_id,omitempty"`
	IsIdLoaded       bool   `json:"is_id_loaded"`
}

func PushNotificationAckFromJson

func PushNotificationAckFromJson(data io.Reader) (*PushNotificationAck, error)

func (*PushNotificationAck) ToJson

func (ack *PushNotificationAck) ToJson() string

type PushResponse

type PushResponse map[string]string

func NewErrorPushResponse

func NewErrorPushResponse(message string) PushResponse

func NewOkPushResponse

func NewOkPushResponse() PushResponse

func NewRemovePushResponse

func NewRemovePushResponse() PushResponse

func PushResponseFromJson

func PushResponseFromJson(data io.Reader) PushResponse

func (*PushResponse) ToJson

func (me *PushResponse) ToJson() string

type RateLimitSettings

type RateLimitSettings struct {
	Enable           *bool  `access:"environment,write_restrictable"`
	PerSec           *int   `access:"environment,write_restrictable"`
	MaxBurst         *int   `access:"environment,write_restrictable"`
	MemoryStoreSize  *int   `access:"environment,write_restrictable"`
	VaryByRemoteAddr *bool  `access:"environment,write_restrictable"`
	VaryByUser       *bool  `access:"environment,write_restrictable"`
	VaryByHeader     string `access:"environment,write_restrictable"`
}

func (*RateLimitSettings) SetDefaults

func (s *RateLimitSettings) SetDefaults()

type Reaction

type Reaction struct {
	UserId    string `json:"user_id"`
	PostId    string `json:"post_id"`
	EmojiName string `json:"emoji_name"`
	CreateAt  int64  `json:"create_at"`
}

func ReactionFromJson

func ReactionFromJson(data io.Reader) *Reaction

func ReactionsFromJson

func ReactionsFromJson(data io.Reader) []*Reaction

func (*Reaction) IsValid

func (o *Reaction) IsValid() *AppError

func (*Reaction) PreSave

func (o *Reaction) PreSave()

func (*Reaction) ToJson

func (o *Reaction) ToJson() string

type RelationalIntegrityCheckData added in v5.28.0

type RelationalIntegrityCheckData struct {
	ParentName   string           `json:"parent_name"`
	ChildName    string           `json:"child_name"`
	ParentIdAttr string           `json:"parent_id_attr"`
	ChildIdAttr  string           `json:"child_id_attr"`
	Records      []OrphanedRecord `json:"records"`
}

type ReplyForExport

type ReplyForExport struct {
	Post
	Username string
}

type Response

type Response struct {
	StatusCode    int
	Error         *AppError
	RequestId     string
	Etag          string
	ServerVersion string
	Header        http.Header
}

func BuildErrorResponse

func BuildErrorResponse(r *http.Response, err *AppError) *Response

func BuildResponse

func BuildResponse(r *http.Response) *Response

type Role

type Role struct {
	Id            string   `json:"id"`
	Name          string   `json:"name"`
	DisplayName   string   `json:"display_name"`
	Description   string   `json:"description"`
	CreateAt      int64    `json:"create_at"`
	UpdateAt      int64    `json:"update_at"`
	DeleteAt      int64    `json:"delete_at"`
	Permissions   []string `json:"permissions"`
	SchemeManaged bool     `json:"scheme_managed"`
	BuiltIn       bool     `json:"built_in"`
}

func RoleFromJson

func RoleFromJson(data io.Reader) *Role

func RoleListFromJson

func RoleListFromJson(data io.Reader) []*Role

func (*Role) GetChannelModeratedPermissions added in v5.22.0

func (r *Role) GetChannelModeratedPermissions(channelType string) map[string]bool

GetChannelModeratedPermissions returns a map of channel moderated permissions that the role has access to

func (*Role) IsValid

func (r *Role) IsValid() bool

func (*Role) IsValidWithoutId

func (r *Role) IsValidWithoutId() bool

func (*Role) MergeChannelHigherScopedPermissions added in v5.22.0

func (r *Role) MergeChannelHigherScopedPermissions(higherScopedPermissions *RolePermissions)

MergeChannelHigherScopedPermissions is meant to be invoked on a channel scheme's role and merges the higher-scoped channel role's permissions.

func (*Role) Patch

func (r *Role) Patch(patch *RolePatch)

func (*Role) RolePatchFromChannelModerationsPatch added in v5.22.0

func (r *Role) RolePatchFromChannelModerationsPatch(channelModerationsPatch []*ChannelModerationPatch, roleName string) *RolePatch

RolePatchFromChannelModerationsPatch Creates and returns a RolePatch based on a slice of ChannelModerationPatchs, roleName is expected to be either "members" or "guests".

func (*Role) ToJson

func (r *Role) ToJson() string

type RoleDescriptor added in v5.20.0

type RoleDescriptor struct {
	XMLName                    xml.Name
	ID                         string          `xml:",attr,omitempty"`
	ValidUntil                 time.Time       `xml:"validUntil,attr,omitempty"`
	CacheDuration              time.Duration   `xml:"cacheDuration,attr,omitempty"`
	ProtocolSupportEnumeration string          `xml:"protocolSupportEnumeration,attr"`
	ErrorURL                   string          `xml:"errorURL,attr,omitempty"`
	KeyDescriptors             []KeyDescriptor `xml:"KeyDescriptor,omitempty"`
	Organization               *Organization   `xml:"Organization,omitempty"`
	ContactPersons             []ContactPerson `xml:"ContactPerson,omitempty"`
}

type RolePatch

type RolePatch struct {
	Permissions *[]string `json:"permissions"`
}

func RolePatchFromJson

func RolePatchFromJson(data io.Reader) *RolePatch

func (*RolePatch) ToJson

func (r *RolePatch) ToJson() string

type RolePermissions added in v5.22.0

type RolePermissions struct {
	RoleID      string
	Permissions []string
}

type RoleScope added in v5.22.0

type RoleScope string

type RoleType added in v5.22.0

type RoleType string

type SSODescriptor added in v5.20.0

type SSODescriptor struct {
	XMLName xml.Name
	RoleDescriptor
	ArtifactResolutionServices []IndexedEndpoint `xml:"ArtifactResolutionService"`
	SingleLogoutServices       []Endpoint        `xml:"SingleLogoutService"`
	ManageNameIDServices       []Endpoint        `xml:"ManageNameIDService"`
	NameIDFormats              []NameIDFormat    `xml:"NameIDFormat"`
}

type SSOSettings

type SSOSettings struct {
	Enable          *bool   `access:"authentication"`
	Secret          *string `access:"authentication"`
	Id              *string `access:"authentication"`
	Scope           *string `access:"authentication"`
	AuthEndpoint    *string `access:"authentication"`
	TokenEndpoint   *string `access:"authentication"`
	UserApiEndpoint *string `access:"authentication"`
}

type SamlAuthRequest

type SamlAuthRequest struct {
	Base64AuthRequest string
	URL               string
	RelayState        string
}

type SamlCertificateStatus

type SamlCertificateStatus struct {
	IdpCertificateFile    bool `json:"idp_certificate_file"`
	PrivateKeyFile        bool `json:"private_key_file"`
	PublicCertificateFile bool `json:"public_certificate_file"`
}

func SamlCertificateStatusFromJson

func SamlCertificateStatusFromJson(data io.Reader) *SamlCertificateStatus

func (*SamlCertificateStatus) ToJson

func (s *SamlCertificateStatus) ToJson() string

type SamlMetadataResponse added in v5.20.0

type SamlMetadataResponse struct {
	IdpDescriptorUrl     string `json:"idp_descriptor_url"`
	IdpUrl               string `json:"idp_url"`
	IdpPublicCertificate string `json:"idp_public_certificate"`
}

func SamlMetadataResponseFromJson added in v5.20.0

func SamlMetadataResponseFromJson(data io.Reader) *SamlMetadataResponse

func (*SamlMetadataResponse) ToJson added in v5.20.0

func (s *SamlMetadataResponse) ToJson() string

type SamlSettings

type SamlSettings struct {
	// Basic
	Enable                        *bool `access:"authentication"`
	EnableSyncWithLdap            *bool `access:"authentication"`
	EnableSyncWithLdapIncludeAuth *bool `access:"authentication"`

	Verify      *bool `access:"authentication"`
	Encrypt     *bool `access:"authentication"`
	SignRequest *bool `access:"authentication"`

	IdpUrl                      *string `access:"authentication"`
	IdpDescriptorUrl            *string `access:"authentication"`
	IdpMetadataUrl              *string `access:"authentication"`
	ServiceProviderIdentifier   *string `access:"authentication"`
	AssertionConsumerServiceURL *string `access:"authentication"`

	SignatureAlgorithm *string `access:"authentication"`
	CanonicalAlgorithm *string `access:"authentication"`

	ScopingIDPProviderId *string `access:"authentication"`
	ScopingIDPName       *string `access:"authentication"`

	IdpCertificateFile    *string `access:"authentication"`
	PublicCertificateFile *string `access:"authentication"`
	PrivateKeyFile        *string `access:"authentication"`

	// User Mapping
	IdAttribute          *string `access:"authentication"`
	GuestAttribute       *string `access:"authentication"`
	EnableAdminAttribute *bool
	AdminAttribute       *string
	FirstNameAttribute   *string `access:"authentication"`
	LastNameAttribute    *string `access:"authentication"`
	EmailAttribute       *string `access:"authentication"`
	UsernameAttribute    *string `access:"authentication"`
	NicknameAttribute    *string `access:"authentication"`
	LocaleAttribute      *string `access:"authentication"`
	PositionAttribute    *string `access:"authentication"`

	LoginButtonText *string `access:"authentication"`

	LoginButtonColor       *string `access:"authentication"`
	LoginButtonBorderColor *string `access:"authentication"`
	LoginButtonTextColor   *string `access:"authentication"`
}

func (*SamlSettings) SetDefaults

func (s *SamlSettings) SetDefaults()

type ScheduledTask

type ScheduledTask struct {
	Name      string        `json:"name"`
	Interval  time.Duration `json:"interval"`
	Recurring bool          `json:"recurring"`
	// contains filtered or unexported fields
}

func CreateRecurringTask

func CreateRecurringTask(name string, function TaskFunc, interval time.Duration) *ScheduledTask

func CreateTask

func CreateTask(name string, function TaskFunc, timeToExecution time.Duration) *ScheduledTask

func (*ScheduledTask) Cancel

func (task *ScheduledTask) Cancel()

func (*ScheduledTask) String

func (task *ScheduledTask) String() string

type Scheduler

type Scheduler interface {
	Name() string
	JobType() string
	Enabled(cfg *Config) bool
	NextScheduleTime(cfg *Config, now time.Time, pendingJobs bool, lastSuccessfulJob *Job) *time.Time
	ScheduleJob(cfg *Config, pendingJobs bool, lastSuccessfulJob *Job) (*Job, *AppError)
}

type Scheme

type Scheme struct {
	Id                      string `json:"id"`
	Name                    string `json:"name"`
	DisplayName             string `json:"display_name"`
	Description             string `json:"description"`
	CreateAt                int64  `json:"create_at"`
	UpdateAt                int64  `json:"update_at"`
	DeleteAt                int64  `json:"delete_at"`
	Scope                   string `json:"scope"`
	DefaultTeamAdminRole    string `json:"default_team_admin_role"`
	DefaultTeamUserRole     string `json:"default_team_user_role"`
	DefaultChannelAdminRole string `json:"default_channel_admin_role"`
	DefaultChannelUserRole  string `json:"default_channel_user_role"`
	DefaultTeamGuestRole    string `json:"default_team_guest_role"`
	DefaultChannelGuestRole string `json:"default_channel_guest_role"`
}

func SchemeFromJson

func SchemeFromJson(data io.Reader) *Scheme

func SchemesFromJson

func SchemesFromJson(data io.Reader) []*Scheme

func (*Scheme) IsValid

func (scheme *Scheme) IsValid() bool

func (*Scheme) IsValidForCreate

func (scheme *Scheme) IsValidForCreate() bool

func (*Scheme) Patch

func (scheme *Scheme) Patch(patch *SchemePatch)

func (*Scheme) ToJson

func (scheme *Scheme) ToJson() string

type SchemeConveyor

type SchemeConveyor struct {
	Name         string  `json:"name"`
	DisplayName  string  `json:"display_name"`
	Description  string  `json:"description"`
	Scope        string  `json:"scope"`
	TeamAdmin    string  `json:"default_team_admin_role"`
	TeamUser     string  `json:"default_team_user_role"`
	TeamGuest    string  `json:"default_team_guest_role"`
	ChannelAdmin string  `json:"default_channel_admin_role"`
	ChannelUser  string  `json:"default_channel_user_role"`
	ChannelGuest string  `json:"default_channel_guest_role"`
	Roles        []*Role `json:"roles"`
}

SchemeConveyor is used for importing and exporting a Scheme and its associated Roles.

func (*SchemeConveyor) Scheme

func (sc *SchemeConveyor) Scheme() *Scheme

type SchemeIDPatch

type SchemeIDPatch struct {
	SchemeID *string `json:"scheme_id"`
}

func (*SchemeIDPatch) ToJson

func (p *SchemeIDPatch) ToJson() string

type SchemePatch

type SchemePatch struct {
	Name        *string `json:"name"`
	DisplayName *string `json:"display_name"`
	Description *string `json:"description"`
}

func SchemePatchFromJson

func SchemePatchFromJson(data io.Reader) *SchemePatch

func (*SchemePatch) ToJson

func (patch *SchemePatch) ToJson() string

type SchemeRoles

type SchemeRoles struct {
	SchemeAdmin bool `json:"scheme_admin"`
	SchemeUser  bool `json:"scheme_user"`
	SchemeGuest bool `json:"scheme_guest"`
}

func SchemeRolesFromJson

func SchemeRolesFromJson(data io.Reader) *SchemeRoles

func (*SchemeRoles) ToJson

func (schemeRoles *SchemeRoles) ToJson() string

type SearchParameter

type SearchParameter struct {
	Terms                  *string `json:"terms"`
	IsOrSearch             *bool   `json:"is_or_search"`
	TimeZoneOffset         *int    `json:"time_zone_offset"`
	Page                   *int    `json:"page"`
	PerPage                *int    `json:"per_page"`
	IncludeDeletedChannels *bool   `json:"include_deleted_channels"`
}

func SearchParameterFromJson

func SearchParameterFromJson(data io.Reader) (*SearchParameter, error)

func (*SearchParameter) SearchParameterToJson

func (o *SearchParameter) SearchParameterToJson() string

type SearchParams

type SearchParams struct {
	Terms                  string
	ExcludedTerms          string
	IsHashtag              bool
	InChannels             []string
	ExcludedChannels       []string
	FromUsers              []string
	ExcludedUsers          []string
	AfterDate              string
	ExcludedAfterDate      string
	BeforeDate             string
	ExcludedBeforeDate     string
	OnDate                 string
	ExcludedDate           string
	OrTerms                bool
	IncludeDeletedChannels bool
	TimeZoneOffset         int
	// True if this search doesn't originate from a "current user".
	SearchWithoutUserId bool
}

func ParseSearchParams

func ParseSearchParams(text string, timeZoneOffset int) []*SearchParams

func (*SearchParams) GetAfterDateMillis

func (p *SearchParams) GetAfterDateMillis() int64

Returns the epoch timestamp of the start of the day specified by SearchParams.AfterDate

func (*SearchParams) GetBeforeDateMillis

func (p *SearchParams) GetBeforeDateMillis() int64

Returns the epoch timestamp of the end of the day specified by SearchParams.BeforeDate

func (*SearchParams) GetExcludedAfterDateMillis

func (p *SearchParams) GetExcludedAfterDateMillis() int64

Returns the epoch timestamp of the start of the day specified by SearchParams.ExcludedAfterDate

func (*SearchParams) GetExcludedBeforeDateMillis

func (p *SearchParams) GetExcludedBeforeDateMillis() int64

Returns the epoch timestamp of the end of the day specified by SearchParams.ExcludedBeforeDate

func (*SearchParams) GetExcludedDateMillis

func (p *SearchParams) GetExcludedDateMillis() (int64, int64)

Returns the epoch timestamps of the start and end of the day specified by SearchParams.ExcludedDate

func (*SearchParams) GetOnDateMillis

func (p *SearchParams) GetOnDateMillis() (int64, int64)

Returns the epoch timestamps of the start and end of the day specified by SearchParams.OnDate

type SecurityBulletin

type SecurityBulletin struct {
	Id               string `json:"id"`
	AppliesToVersion string `json:"applies_to_version"`
}

func SecurityBulletinFromJson

func SecurityBulletinFromJson(data io.Reader) *SecurityBulletin

func (*SecurityBulletin) ToJson

func (me *SecurityBulletin) ToJson() string

type SecurityBulletins

type SecurityBulletins []SecurityBulletin

func SecurityBulletinsFromJson

func SecurityBulletinsFromJson(data io.Reader) SecurityBulletins

func (SecurityBulletins) ToJson

func (me SecurityBulletins) ToJson() string

type SendWarnMetricAck added in v5.26.0

type SendWarnMetricAck struct {
	ForceAck bool `json:"forceAck"`
}

func SendWarnMetricAckFromJson added in v5.26.0

func SendWarnMetricAckFromJson(r io.Reader) *SendWarnMetricAck

func (*SendWarnMetricAck) ToJson added in v5.26.0

func (swma *SendWarnMetricAck) ToJson() string

type ServerBusyState added in v5.20.0

type ServerBusyState struct {
	Busy       bool   `json:"busy"`
	Expires    int64  `json:"expires"`
	Expires_ts string `json:"expires_ts,omitempty"`
}

ServerBusyState provides serialization for app.Busy.

func ServerBusyStateFromJson added in v5.20.0

func ServerBusyStateFromJson(r io.Reader) *ServerBusyState

func (*ServerBusyState) ToJson added in v5.20.0

func (sbs *ServerBusyState) ToJson() string

type ServiceSettings

type ServiceSettings struct {
	SiteURL                                           *string  `access:"environment,authentication,write_restrictable"`
	WebsocketURL                                      *string  `access:"write_restrictable"`
	LicenseFileLocation                               *string  `access:"write_restrictable"`
	ListenAddress                                     *string  `access:"environment,write_restrictable"`
	ConnectionSecurity                                *string  `access:"environment,write_restrictable"`
	TLSCertFile                                       *string  `access:"environment,write_restrictable"`
	TLSKeyFile                                        *string  `access:"environment,write_restrictable"`
	TLSMinVer                                         *string  `access:"write_restrictable"`
	TLSStrictTransport                                *bool    `access:"write_restrictable"`
	TLSStrictTransportMaxAge                          *int64   `access:"write_restrictable"`
	TLSOverwriteCiphers                               []string `access:"write_restrictable"`
	UseLetsEncrypt                                    *bool    `access:"environment,write_restrictable"`
	LetsEncryptCertificateCacheFile                   *string  `access:"environment,write_restrictable"`
	Forward80To443                                    *bool    `access:"environment,write_restrictable"`
	TrustedProxyIPHeader                              []string `access:"write_restrictable"`
	ReadTimeout                                       *int     `access:"environment,write_restrictable"`
	WriteTimeout                                      *int     `access:"environment,write_restrictable"`
	IdleTimeout                                       *int     `access:"write_restrictable"`
	MaximumLoginAttempts                              *int     `access:"authentication,write_restrictable"`
	GoroutineHealthThreshold                          *int     `access:"write_restrictable"`
	GoogleDeveloperKey                                *string  `access:"site,write_restrictable"`
	EnableOAuthServiceProvider                        *bool    `access:"integrations"`
	EnableIncomingWebhooks                            *bool    `access:"integrations"`
	EnableOutgoingWebhooks                            *bool    `access:"integrations"`
	EnableCommands                                    *bool    `access:"integrations"`
	DEPRECATED_DO_NOT_USE_EnableOnlyAdminIntegrations *bool    `json:"EnableOnlyAdminIntegrations" mapstructure:"EnableOnlyAdminIntegrations"` // This field is deprecated and must not be used.
	EnablePostUsernameOverride                        *bool    `access:"integrations"`
	EnablePostIconOverride                            *bool    `access:"integrations"`
	EnableLinkPreviews                                *bool    `access:"site"`
	EnableTesting                                     *bool    `access:"environment,write_restrictable"`
	EnableDeveloper                                   *bool    `access:"environment,write_restrictable"`
	EnableOpenTracing                                 *bool    `access:"write_restrictable"`
	EnableSecurityFixAlert                            *bool    `access:"environment,write_restrictable"`
	EnableInsecureOutgoingConnections                 *bool    `access:"environment,write_restrictable"`
	AllowedUntrustedInternalConnections               *string  `access:"environment,write_restrictable"`
	EnableMultifactorAuthentication                   *bool    `access:"authentication"`
	EnforceMultifactorAuthentication                  *bool    `access:"authentication"`
	EnableUserAccessTokens                            *bool    `access:"integrations"`
	AllowCorsFrom                                     *string  `access:"integrations,write_restrictable"`
	CorsExposedHeaders                                *string  `access:"integrations,write_restrictable"`
	CorsAllowCredentials                              *bool    `access:"integrations,write_restrictable"`
	CorsDebug                                         *bool    `access:"integrations,write_restrictable"`
	AllowCookiesForSubdomains                         *bool    `access:"write_restrictable"`
	ExtendSessionLengthWithActivity                   *bool    `access:"environment,write_restrictable"`
	SessionLengthWebInDays                            *int     `access:"environment,write_restrictable"`
	SessionLengthMobileInDays                         *int     `access:"environment,write_restrictable"`
	SessionLengthSSOInDays                            *int     `access:"environment,write_restrictable"`
	SessionCacheInMinutes                             *int     `access:"environment,write_restrictable"`
	SessionIdleTimeoutInMinutes                       *int     `access:"environment,write_restrictable"`
	WebsocketSecurePort                               *int     `access:"write_restrictable"`
	WebsocketPort                                     *int     `access:"write_restrictable"`
	WebserverMode                                     *string  `access:"environment,write_restrictable"`
	EnableCustomEmoji                                 *bool    `access:"site"`
	EnableEmojiPicker                                 *bool    `access:"site"`
	EnableGifPicker                                   *bool    `access:"integrations"`
	GfycatApiKey                                      *string  `access:"integrations"`
	GfycatApiSecret                                   *string  `access:"integrations"`
	DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation *string  `json:"RestrictCustomEmojiCreation" mapstructure:"RestrictCustomEmojiCreation"` // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPostDelete          *string  `json:"RestrictPostDelete" mapstructure:"RestrictPostDelete"`                   // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_AllowEditPost               *string  `json:"AllowEditPost" mapstructure:"AllowEditPost"`                             // This field is deprecated and must not be used.
	PostEditTimeLimit                                 *int     `access:"user_management_permissions"`
	TimeBetweenUserTypingUpdatesMilliseconds          *int64   `access:"experimental,write_restrictable"`
	EnablePostSearch                                  *bool    `access:"write_restrictable"`
	MinimumHashtagLength                              *int     `access:"environment,write_restrictable"`
	EnableUserTypingMessages                          *bool    `access:"experimental,write_restrictable"`
	EnableChannelViewedMessages                       *bool    `access:"experimental,write_restrictable"`
	EnableUserStatuses                                *bool    `access:"write_restrictable"`
	ExperimentalEnableAuthenticationTransfer          *bool    `access:"experimental,write_restrictable"`
	ClusterLogTimeoutMilliseconds                     *int     `access:"write_restrictable"`
	CloseUnusedDirectMessages                         *bool    `access:"experimental"`
	EnablePreviewFeatures                             *bool    `access:"experimental"`
	EnableTutorial                                    *bool    `access:"experimental"`
	ExperimentalEnableDefaultChannelLeaveJoinMessages *bool    `access:"experimental"`
	ExperimentalGroupUnreadChannels                   *string  `access:"experimental"`
	ExperimentalChannelOrganization                   *bool    `access:"experimental"`
	ExperimentalChannelSidebarOrganization            *string  `access:"experimental"`
	ExperimentalDataPrefetch                          *bool    `access:"experimental"`
	DEPRECATED_DO_NOT_USE_ImageProxyType              *string  `json:"ImageProxyType" mapstructure:"ImageProxyType"`       // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_ImageProxyURL               *string  `json:"ImageProxyURL" mapstructure:"ImageProxyURL"`         // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_ImageProxyOptions           *string  `json:"ImageProxyOptions" mapstructure:"ImageProxyOptions"` // This field is deprecated and must not be used.
	EnableAPITeamDeletion                             *bool
	EnableAPIUserDeletion                             *bool
	ExperimentalEnableHardenedMode                    *bool `access:"experimental"`
	DisableLegacyMFA                                  *bool `access:"write_restrictable"`
	ExperimentalStrictCSRFEnforcement                 *bool `access:"experimental,write_restrictable"`
	EnableEmailInvitations                            *bool `access:"authentication"`
	DisableBotsWhenOwnerIsDeactivated                 *bool `access:"integrations,write_restrictable"`
	EnableBotAccountCreation                          *bool `access:"integrations"`
	EnableSVGs                                        *bool `access:"site"`
	EnableLatex                                       *bool `access:"site"`
	EnableAPIChannelDeletion                          *bool
	EnableLocalMode                                   *bool
	LocalModeSocketLocation                           *string
	EnableAWSMetering                                 *bool
	ThreadAutoFollow                                  *bool   `access:"experimental"`
	ManagedResourcePaths                              *string `access:"environment,write_restrictable,cloud_restrictable"`
}

func (*ServiceSettings) SetDefaults

func (s *ServiceSettings) SetDefaults(isUpdate bool)

type Session

type Session struct {
	Id             string        `json:"id"`
	Token          string        `json:"token"`
	CreateAt       int64         `json:"create_at"`
	ExpiresAt      int64         `json:"expires_at"`
	LastActivityAt int64         `json:"last_activity_at"`
	UserId         string        `json:"user_id"`
	DeviceId       string        `json:"device_id"`
	Roles          string        `json:"roles"`
	IsOAuth        bool          `json:"is_oauth"`
	ExpiredNotify  bool          `json:"expired_notify"`
	Props          StringMap     `json:"props"`
	TeamMembers    []*TeamMember `json:"team_members" db:"-"`
	Local          bool          `json:"local" db:"-"`
}

Session contains the user session details. This struct's serializer methods are auto-generated. If a new field is added/removed, please run make gen-serialized.

func SessionFromJson

func SessionFromJson(data io.Reader) *Session

func SessionsFromJson

func SessionsFromJson(data io.Reader) []*Session

func (*Session) AddProp

func (me *Session) AddProp(key string, value string)

func (*Session) DecodeMsg added in v5.28.0

func (z *Session) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Session) DeepCopy

func (me *Session) DeepCopy() *Session

func (*Session) EncodeMsg added in v5.28.0

func (z *Session) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Session) GenerateCSRF

func (me *Session) GenerateCSRF() string

func (*Session) GetCSRF

func (me *Session) GetCSRF() string

func (*Session) GetTeamByTeamId

func (me *Session) GetTeamByTeamId(teamId string) *TeamMember

func (*Session) GetUserRoles

func (me *Session) GetUserRoles() []string

func (*Session) IsExpired

func (me *Session) IsExpired() bool

func (*Session) IsMobile added in v5.25.0

func (me *Session) IsMobile() bool

func (*Session) IsMobileApp

func (me *Session) IsMobileApp() bool

func (*Session) IsOAuthUser added in v5.25.3

func (me *Session) IsOAuthUser() bool

func (*Session) IsSSOLogin added in v5.25.0

func (me *Session) IsSSOLogin() bool

func (*Session) IsSaml added in v5.25.0

func (me *Session) IsSaml() bool

func (*Session) IsUnrestricted added in v5.24.0

func (me *Session) IsUnrestricted() bool

Returns true if the session is unrestricted, which should grant it with all permissions. This is used for local mode sessions

func (*Session) MarshalMsg added in v5.28.0

func (z *Session) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Session) Msgsize added in v5.28.0

func (z *Session) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Session) PreSave

func (me *Session) PreSave()

func (*Session) Sanitize

func (me *Session) Sanitize()

func (*Session) SetExpireInDays deprecated

func (me *Session) SetExpireInDays(days int)

Deprecated: SetExpireInDays is deprecated and should not be used.

            Use (*App).SetSessionExpireInDays instead which handles the
			   cases where the new ExpiresAt is not relative to CreateAt.

func (*Session) ToJson

func (me *Session) ToJson() string

func (*Session) UnmarshalMsg added in v5.28.0

func (z *Session) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SidebarCategoriesWithChannels added in v5.26.0

type SidebarCategoriesWithChannels []*SidebarCategoryWithChannels

type SidebarCategory added in v5.26.0

type SidebarCategory struct {
	Id          string                 `json:"id"`
	UserId      string                 `json:"user_id"`
	TeamId      string                 `json:"team_id"`
	SortOrder   int64                  `json:"-"`
	Sorting     SidebarCategorySorting `json:"sorting"`
	Type        SidebarCategoryType    `json:"type"`
	DisplayName string                 `json:"display_name"`
}

SidebarCategory represents the corresponding DB table SortOrder is never returned to the user and only used for queries

type SidebarCategoryOrder added in v5.26.0

type SidebarCategoryOrder []string

type SidebarCategorySorting added in v5.26.0

type SidebarCategorySorting string

type SidebarCategoryType added in v5.26.0

type SidebarCategoryType string

type SidebarCategoryWithChannels added in v5.26.0

type SidebarCategoryWithChannels struct {
	SidebarCategory
	Channels []string `json:"channel_ids"`
}

SidebarCategoryWithChannels combines data from SidebarCategory table with the Channel IDs that belong to that category

func SidebarCategoriesFromJson added in v5.26.0

func SidebarCategoriesFromJson(data io.Reader) ([]*SidebarCategoryWithChannels, error)

func SidebarCategoryFromJson added in v5.26.0

func SidebarCategoryFromJson(data io.Reader) (*SidebarCategoryWithChannels, error)

func (SidebarCategoryWithChannels) ToJson added in v5.26.0

func (o SidebarCategoryWithChannels) ToJson() []byte

type SidebarChannel added in v5.26.0

type SidebarChannel struct {
	ChannelId  string `json:"channel_id"`
	UserId     string `json:"user_id"`
	CategoryId string `json:"category_id"`
	SortOrder  int64  `json:"-"`
}

type SidebarChannels added in v5.26.0

type SidebarChannels []*SidebarChannel

type SlackAttachment

type SlackAttachment struct {
	Id         int64                   `json:"id"`
	Fallback   string                  `json:"fallback"`
	Color      string                  `json:"color"`
	Pretext    string                  `json:"pretext"`
	AuthorName string                  `json:"author_name"`
	AuthorLink string                  `json:"author_link"`
	AuthorIcon string                  `json:"author_icon"`
	Title      string                  `json:"title"`
	TitleLink  string                  `json:"title_link"`
	Text       string                  `json:"text"`
	Fields     []*SlackAttachmentField `json:"fields"`
	ImageURL   string                  `json:"image_url"`
	ThumbURL   string                  `json:"thumb_url"`
	Footer     string                  `json:"footer"`
	FooterIcon string                  `json:"footer_icon"`
	Timestamp  interface{}             `json:"ts"` // This is either a string or an int64
	Actions    []*PostAction           `json:"actions,omitempty"`
}

func StringifySlackFieldValue

func StringifySlackFieldValue(a []*SlackAttachment) []*SlackAttachment

func (*SlackAttachment) Equals

func (s *SlackAttachment) Equals(input *SlackAttachment) bool

type SlackAttachmentField

type SlackAttachmentField struct {
	Title string              `json:"title"`
	Value interface{}         `json:"value"`
	Short SlackCompatibleBool `json:"short"`
}

func (*SlackAttachmentField) Equals

type SlackCompatibleBool

type SlackCompatibleBool bool

SlackCompatibleBool is an alias for bool that implements json.Unmarshaler

func (*SlackCompatibleBool) UnmarshalJSON

func (b *SlackCompatibleBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

Slack allows bool values to be represented as strings ("true"/"false") or literals (true/false). To maintain compatibility, we define an Unmarshaler that supports both.

type SqlSettings

type SqlSettings struct {
	DriverName                  *string  `access:"environment,write_restrictable"`
	DataSource                  *string  `access:"environment,write_restrictable"`
	DataSourceReplicas          []string `access:"environment,write_restrictable"`
	DataSourceSearchReplicas    []string `access:"environment,write_restrictable"`
	MaxIdleConns                *int     `access:"environment,write_restrictable"`
	ConnMaxLifetimeMilliseconds *int     `access:"environment,write_restrictable"`
	MaxOpenConns                *int     `access:"environment,write_restrictable"`
	Trace                       *bool    `access:"environment,write_restrictable"`
	AtRestEncryptKey            *string  `access:"environment,write_restrictable"`
	QueryTimeout                *int     `access:"environment,write_restrictable"`
	DisableDatabaseSearch       *bool    `access:"environment,write_restrictable"`
}

func (*SqlSettings) SetDefaults

func (s *SqlSettings) SetDefaults(isUpdate bool)

type Status

type Status struct {
	UserId         string `json:"user_id"`
	Status         string `json:"status"`
	Manual         bool   `json:"manual"`
	LastActivityAt int64  `json:"last_activity_at"`
	ActiveChannel  string `json:"active_channel,omitempty" db:"-"`
}

func StatusFromJson

func StatusFromJson(data io.Reader) *Status

func StatusListFromJson

func StatusListFromJson(data io.Reader) []*Status

func (*Status) ToClusterJson

func (o *Status) ToClusterJson() string

func (*Status) ToJson

func (o *Status) ToJson() string

type StringArray

type StringArray []string

func (StringArray) Contains added in v5.29.0

func (sa StringArray) Contains(input string) bool

func (StringArray) Equals

func (sa StringArray) Equals(input StringArray) bool

func (StringArray) Remove added in v5.29.0

func (sa StringArray) Remove(input string) StringArray

type StringInterface

type StringInterface map[string]interface{}

type StringMap

type StringMap map[string]string

func GetDefaultChannelNotifyProps

func GetDefaultChannelNotifyProps() StringMap

func (*StringMap) DecodeMsg added in v5.28.0

func (z *StringMap) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (StringMap) EncodeMsg added in v5.28.0

func (z StringMap) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (StringMap) MarshalMsg added in v5.28.0

func (z StringMap) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (StringMap) Msgsize added in v5.28.0

func (z StringMap) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*StringMap) UnmarshalMsg added in v5.28.0

func (z *StringMap) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SubmitDialogRequest

type SubmitDialogRequest struct {
	Type       string                 `json:"type"`
	URL        string                 `json:"url,omitempty"`
	CallbackId string                 `json:"callback_id"`
	State      string                 `json:"state"`
	UserId     string                 `json:"user_id"`
	ChannelId  string                 `json:"channel_id"`
	TeamId     string                 `json:"team_id"`
	Submission map[string]interface{} `json:"submission"`
	Cancelled  bool                   `json:"cancelled"`
}

func SubmitDialogRequestFromJson

func SubmitDialogRequestFromJson(data io.Reader) *SubmitDialogRequest

func (*SubmitDialogRequest) ToJson

func (r *SubmitDialogRequest) ToJson() []byte

type SubmitDialogResponse

type SubmitDialogResponse struct {
	Error  string            `json:"error,omitempty"`
	Errors map[string]string `json:"errors,omitempty"`
}

func SubmitDialogResponseFromJson

func SubmitDialogResponseFromJson(data io.Reader) *SubmitDialogResponse

func (*SubmitDialogResponse) ToJson

func (r *SubmitDialogResponse) ToJson() []byte

type SuggestCommand

type SuggestCommand struct {
	Suggestion  string `json:"suggestion"`
	Description string `json:"description"`
}

func SuggestCommandFromJson

func SuggestCommandFromJson(data io.Reader) *SuggestCommand

func (*SuggestCommand) ToJson

func (o *SuggestCommand) ToJson() string

type SupportSettings

type SupportSettings struct {
	TermsOfServiceLink                     *string `access:"site,write_restrictable"`
	PrivacyPolicyLink                      *string `access:"site,write_restrictable"`
	AboutLink                              *string `access:"site,write_restrictable"`
	HelpLink                               *string `access:"site,write_restrictable"`
	ReportAProblemLink                     *string `access:"site,write_restrictable"`
	SupportEmail                           *string `access:"site"`
	CustomTermsOfServiceEnabled            *bool   `access:"compliance"`
	CustomTermsOfServiceReAcceptancePeriod *int    `access:"compliance"`
	EnableAskCommunityLink                 *bool   `access:"site"`
}

func (*SupportSettings) SetDefaults

func (s *SupportSettings) SetDefaults()

type SwitchRequest

type SwitchRequest struct {
	CurrentService string `json:"current_service"`
	NewService     string `json:"new_service"`
	Email          string `json:"email"`
	Password       string `json:"password"`
	NewPassword    string `json:"new_password"`
	MfaCode        string `json:"mfa_code"`
	LdapLoginId    string `json:"ldap_id"`
}

func SwitchRequestFromJson

func SwitchRequestFromJson(data io.Reader) *SwitchRequest

func (*SwitchRequest) EmailToLdap

func (o *SwitchRequest) EmailToLdap() bool

func (*SwitchRequest) EmailToOAuth

func (o *SwitchRequest) EmailToOAuth() bool

func (*SwitchRequest) LdapToEmail

func (o *SwitchRequest) LdapToEmail() bool

func (*SwitchRequest) OAuthToEmail

func (o *SwitchRequest) OAuthToEmail() bool

func (*SwitchRequest) ToJson

func (o *SwitchRequest) ToJson() string

type System

type System struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

func SystemFromJson

func SystemFromJson(data io.Reader) *System

func (*System) ToJson

func (o *System) ToJson() string

type SystemAsymmetricSigningKey

type SystemAsymmetricSigningKey struct {
	ECDSAKey *SystemECDSAKey `json:"ecdsa_key,omitempty"`
}

type SystemECDSAKey

type SystemECDSAKey struct {
	Curve string   `json:"curve"`
	X     *big.Int `json:"x"`
	Y     *big.Int `json:"y"`
	D     *big.Int `json:"d,omitempty"`
}

type SystemPostActionCookieSecret

type SystemPostActionCookieSecret struct {
	Secret []byte `json:"key,omitempty"`
}

type TaskFunc

type TaskFunc func()

type Team

type Team struct {
	Id                 string  `json:"id"`
	CreateAt           int64   `json:"create_at"`
	UpdateAt           int64   `json:"update_at"`
	DeleteAt           int64   `json:"delete_at"`
	DisplayName        string  `json:"display_name"`
	Name               string  `json:"name"`
	Description        string  `json:"description"`
	Email              string  `json:"email"`
	Type               string  `json:"type"`
	CompanyName        string  `json:"company_name"`
	AllowedDomains     string  `json:"allowed_domains"`
	InviteId           string  `json:"invite_id"`
	AllowOpenInvite    bool    `json:"allow_open_invite"`
	LastTeamIconUpdate int64   `json:"last_team_icon_update,omitempty"`
	SchemeId           *string `json:"scheme_id"`
	GroupConstrained   *bool   `json:"group_constrained"`
}

func TeamFromJson

func TeamFromJson(data io.Reader) *Team

func TeamListFromJson

func TeamListFromJson(data io.Reader) []*Team

func (*Team) Etag

func (o *Team) Etag() string

func (*Team) IsGroupConstrained

func (o *Team) IsGroupConstrained() bool

func (*Team) IsValid

func (o *Team) IsValid() *AppError

func (*Team) Patch

func (o *Team) Patch(patch *TeamPatch)

func (*Team) PreSave

func (o *Team) PreSave()

func (*Team) PreUpdate

func (o *Team) PreUpdate()

func (*Team) Sanitize

func (o *Team) Sanitize()

func (*Team) ToJson

func (o *Team) ToJson() string

type TeamForExport

type TeamForExport struct {
	Team
	SchemeName *string
}

type TeamMember

type TeamMember struct {
	TeamId        string `json:"team_id"`
	UserId        string `json:"user_id"`
	Roles         string `json:"roles"`
	DeleteAt      int64  `json:"delete_at"`
	SchemeGuest   bool   `json:"scheme_guest"`
	SchemeUser    bool   `json:"scheme_user"`
	SchemeAdmin   bool   `json:"scheme_admin"`
	ExplicitRoles string `json:"explicit_roles"`
}

func TeamMemberFromJson

func TeamMemberFromJson(data io.Reader) *TeamMember

func TeamMembersFromJson

func TeamMembersFromJson(data io.Reader) []*TeamMember

func TeamMembersWithErrorToTeamMembers added in v5.20.0

func TeamMembersWithErrorToTeamMembers(o []*TeamMemberWithError) []*TeamMember

func (*TeamMember) DecodeMsg added in v5.28.0

func (z *TeamMember) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TeamMember) EncodeMsg added in v5.28.0

func (z *TeamMember) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TeamMember) GetRoles

func (o *TeamMember) GetRoles() []string

func (*TeamMember) IsValid

func (o *TeamMember) IsValid() *AppError

func (*TeamMember) MarshalMsg added in v5.28.0

func (z *TeamMember) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TeamMember) Msgsize added in v5.28.0

func (z *TeamMember) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TeamMember) PreUpdate

func (o *TeamMember) PreUpdate()

func (*TeamMember) ToJson

func (o *TeamMember) ToJson() string

func (*TeamMember) UnmarshalMsg added in v5.28.0

func (z *TeamMember) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TeamMemberForExport

type TeamMemberForExport struct {
	TeamMember
	TeamName string
}

type TeamMemberWithError added in v5.20.0

type TeamMemberWithError struct {
	UserId string      `json:"user_id"`
	Member *TeamMember `json:"member"`
	Error  *AppError   `json:"error"`
}

func TeamMembersWithErrorFromJson added in v5.20.0

func TeamMembersWithErrorFromJson(data io.Reader) []*TeamMemberWithError

type TeamMembersGetOptions added in v5.24.0

type TeamMembersGetOptions struct {
	// Sort the team members. Accepts "Username", but defaults to "Id".
	Sort string

	// If true, exclude team members whose corresponding user is deleted.
	ExcludeDeletedUsers bool

	// Restrict to search in a list of teams and channels
	ViewRestrictions *ViewUsersRestrictions
}

type TeamPatch

type TeamPatch struct {
	DisplayName      *string `json:"display_name"`
	Description      *string `json:"description"`
	CompanyName      *string `json:"company_name"`
	AllowedDomains   *string `json:"allowed_domains"`
	AllowOpenInvite  *bool   `json:"allow_open_invite"`
	GroupConstrained *bool   `json:"group_constrained"`
}

func TeamPatchFromJson

func TeamPatchFromJson(data io.Reader) *TeamPatch

func (*TeamPatch) ToJson

func (t *TeamPatch) ToJson() string

type TeamSearch

type TeamSearch struct {
	Term                    string `json:"term"`
	Page                    *int   `json:"page,omitempty"`
	PerPage                 *int   `json:"per_page,omitempty"`
	AllowOpenInvite         *bool  `json:"allow_open_invite,omitempty"`
	GroupConstrained        *bool  `json:"group_constrained,omitempty"`
	IncludeGroupConstrained *bool  `json:"include_group_constrained,omitempty"`
}

func TeamSearchFromJson

func TeamSearchFromJson(data io.Reader) *TeamSearch

TeamSearchFromJson decodes the input and returns a TeamSearch

func (*TeamSearch) IsPaginated

func (t *TeamSearch) IsPaginated() bool

func (*TeamSearch) ToJson

func (t *TeamSearch) ToJson() string

ToJson convert a TeamSearch to json string

type TeamSettings

type TeamSettings struct {
	SiteName                                                  *string  `access:"site"`
	MaxUsersPerTeam                                           *int     `access:"site"`
	DEPRECATED_DO_NOT_USE_EnableTeamCreation                  *bool    `json:"EnableTeamCreation" mapstructure:"EnableTeamCreation"` // This field is deprecated and must not be used.
	EnableUserCreation                                        *bool    `access:"authentication"`
	EnableOpenServer                                          *bool    `access:"authentication"`
	EnableUserDeactivation                                    *bool    `access:"experimental"`
	RestrictCreationToDomains                                 *string  `access:"authentication"`
	EnableCustomBrand                                         *bool    `access:"site"`
	CustomBrandText                                           *string  `access:"site"`
	CustomDescriptionText                                     *string  `access:"site"`
	RestrictDirectMessage                                     *string  `access:"site"`
	DEPRECATED_DO_NOT_USE_RestrictTeamInvite                  *string  `json:"RestrictTeamInvite" mapstructure:"RestrictTeamInvite"`                                   // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement     *string  `json:"RestrictPublicChannelManagement" mapstructure:"RestrictPublicChannelManagement"`         // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement    *string  `json:"RestrictPrivateChannelManagement" mapstructure:"RestrictPrivateChannelManagement"`       // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation       *string  `json:"RestrictPublicChannelCreation" mapstructure:"RestrictPublicChannelCreation"`             // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation      *string  `json:"RestrictPrivateChannelCreation" mapstructure:"RestrictPrivateChannelCreation"`           // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPublicChannelDeletion       *string  `json:"RestrictPublicChannelDeletion" mapstructure:"RestrictPublicChannelDeletion"`             // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPrivateChannelDeletion      *string  `json:"RestrictPrivateChannelDeletion" mapstructure:"RestrictPrivateChannelDeletion"`           // This field is deprecated and must not be used.
	DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManageMembers *string  `json:"RestrictPrivateChannelManageMembers" mapstructure:"RestrictPrivateChannelManageMembers"` // This field is deprecated and must not be used.
	EnableXToLeaveChannelsFromLHS                             *bool    `access:"experimental"`
	UserStatusAwayTimeout                                     *int64   `access:"experimental"`
	MaxChannelsPerTeam                                        *int64   `access:"site"`
	MaxNotificationsPerChannel                                *int64   `access:"environment"`
	EnableConfirmNotificationsToChannel                       *bool    `access:"site"`
	TeammateNameDisplay                                       *string  `access:"site"`
	ExperimentalViewArchivedChannels                          *bool    `access:"experimental,site"`
	ExperimentalEnableAutomaticReplies                        *bool    `access:"experimental"`
	ExperimentalHideTownSquareinLHS                           *bool    `access:"experimental"`
	ExperimentalTownSquareIsReadOnly                          *bool    `access:"experimental"`
	LockTeammateNameDisplay                                   *bool    `access:"site"`
	ExperimentalPrimaryTeam                                   *string  `access:"experimental"`
	ExperimentalDefaultChannels                               []string `access:"experimental"`
}

func (*TeamSettings) SetDefaults

func (s *TeamSettings) SetDefaults()

type TeamStats

type TeamStats struct {
	TeamId            string `json:"team_id"`
	TotalMemberCount  int64  `json:"total_member_count"`
	ActiveMemberCount int64  `json:"active_member_count"`
}

func TeamStatsFromJson

func TeamStatsFromJson(data io.Reader) *TeamStats

func (*TeamStats) ToJson

func (o *TeamStats) ToJson() string

type TeamUnread

type TeamUnread struct {
	TeamId       string `json:"team_id"`
	MsgCount     int64  `json:"msg_count"`
	MentionCount int64  `json:"mention_count"`
}

func TeamUnreadFromJson

func TeamUnreadFromJson(data io.Reader) *TeamUnread

func TeamsUnreadFromJson

func TeamsUnreadFromJson(data io.Reader) []*TeamUnread

func (*TeamUnread) ToJson

func (o *TeamUnread) ToJson() string

type TeamsWithCount

type TeamsWithCount struct {
	Teams      []*Team `json:"teams"`
	TotalCount int64   `json:"total_count"`
}

func TeamsWithCountFromJson

func TeamsWithCountFromJson(data io.Reader) *TeamsWithCount

type TermsOfService

type TermsOfService struct {
	Id       string `json:"id"`
	CreateAt int64  `json:"create_at"`
	UserId   string `json:"user_id"`
	Text     string `json:"text"`
}

func TermsOfServiceFromJson

func TermsOfServiceFromJson(data io.Reader) *TermsOfService

func (*TermsOfService) IsValid

func (t *TermsOfService) IsValid() *AppError

func (*TermsOfService) PreSave

func (t *TermsOfService) PreSave()

func (*TermsOfService) ToJson

func (t *TermsOfService) ToJson() string

type ThemeSettings

type ThemeSettings struct {
	EnableThemeSelection *bool   `access:"experimental"`
	DefaultTheme         *string `access:"experimental"`
	AllowCustomThemes    *bool   `access:"experimental"`
	AllowedThemes        []string
}

func (*ThemeSettings) SetDefaults

func (s *ThemeSettings) SetDefaults()

type Thread added in v5.29.0

type Thread struct {
	PostId       string      `json:"id"`
	ChannelId    string      `json:"channel_id"`
	ReplyCount   int64       `json:"reply_count"`
	LastReplyAt  int64       `json:"last_reply_at"`
	Participants StringArray `json:"participants"`
}

func (*Thread) Etag added in v5.29.0

func (o *Thread) Etag() string

func (*Thread) ToJson added in v5.29.0

func (o *Thread) ToJson() string

type ThreadMembership added in v5.29.0

type ThreadMembership struct {
	PostId         string `json:"post_id"`
	UserId         string `json:"user_id"`
	Following      bool   `json:"following"`
	LastViewed     int64  `json:"last_view_at"`
	LastUpdated    int64  `json:"last_update_at"`
	UnreadMentions int64  `json:"unread_mentions"`
}

func (*ThreadMembership) ToJson added in v5.29.0

func (o *ThreadMembership) ToJson() string

type Token

type Token struct {
	Token    string
	CreateAt int64
	Type     string
	Extra    string
}

func NewToken

func NewToken(tokentype, extra string) *Token

func (*Token) IsValid

func (t *Token) IsValid() *AppError

type TrialLicenseRequest added in v5.25.0

type TrialLicenseRequest struct {
	ServerID              string `json:"server_id"`
	Email                 string `json:"email"`
	Name                  string `json:"name"`
	SiteURL               string `json:"site_url"`
	SiteName              string `json:"site_name"`
	Users                 int    `json:"users"`
	TermsAccepted         bool   `json:"terms_accepted"`
	ReceiveEmailsAccepted bool   `json:"receive_emails_accepted"`
}

func (*TrialLicenseRequest) ToJson added in v5.25.0

func (tlr *TrialLicenseRequest) ToJson() string

type TypingRequest added in v5.26.0

type TypingRequest struct {
	ChannelId string `json:"channel_id"`
	ParentId  string `json:"parent_id"`
}

func TypingRequestFromJson added in v5.26.0

func TypingRequestFromJson(data io.Reader) *TypingRequest

func (*TypingRequest) ToJson added in v5.26.0

func (o *TypingRequest) ToJson() string

type UploadSession added in v5.28.0

type UploadSession struct {
	// The unique identifier for the session.
	Id string `json:"id"`
	// The type of the upload.
	Type UploadType `json:"type"`
	// The timestamp of creation.
	CreateAt int64 `json:"create_at"`
	// The id of the user performing the upload.
	UserId string `json:"user_id"`
	// The id of the channel to upload to.
	ChannelId string `json:"channel_id"`
	// The name of the file to upload.
	Filename string `json:"filename"`
	// The path where the file is stored.
	Path string `json:"-"`
	// The size of the file to upload.
	FileSize int64 `json:"file_size"`
	// The amount of received data in bytes. If equal to FileSize it means the
	// upload has finished.
	FileOffset int64 `json:"file_offset"`
}

UploadSession contains information used to keep track of a file upload.

func UploadSessionFromJson added in v5.28.0

func UploadSessionFromJson(data io.Reader) *UploadSession

UploadSessionFromJson deserializes the UploadSession from JSON data.

func UploadSessionsFromJson added in v5.28.0

func UploadSessionsFromJson(data io.Reader) []*UploadSession

UploadSessionsFromJson deserializes a list of UploadSession from JSON data.

func (*UploadSession) IsValid added in v5.28.0

func (us *UploadSession) IsValid() *AppError

IsValid validates an UploadSession. It returns an error in case of failure.

func (*UploadSession) PreSave added in v5.28.0

func (us *UploadSession) PreSave()

PreSave is a utility function used to fill required information.

func (*UploadSession) ToJson added in v5.28.0

func (us *UploadSession) ToJson() string

ToJson serializes the UploadSession into JSON and returns it as string.

type UploadType added in v5.28.0

type UploadType string

UploadType defines the type of an upload.

const (
	UploadTypeAttachment UploadType = "attachment"
	UploadTypeImport     UploadType = "import"
)

func (UploadType) IsValid added in v5.28.0

func (t UploadType) IsValid() error

IsValid validates an UploadType. It returns an error in case of failure.

type User

type User struct {
	Id                     string    `json:"id"`
	CreateAt               int64     `json:"create_at,omitempty"`
	UpdateAt               int64     `json:"update_at,omitempty"`
	DeleteAt               int64     `json:"delete_at"`
	Username               string    `json:"username"`
	Password               string    `json:"password,omitempty"`
	AuthData               *string   `json:"auth_data,omitempty"`
	AuthService            string    `json:"auth_service"`
	Email                  string    `json:"email"`
	EmailVerified          bool      `json:"email_verified,omitempty"`
	Nickname               string    `json:"nickname"`
	FirstName              string    `json:"first_name"`
	LastName               string    `json:"last_name"`
	Position               string    `json:"position"`
	Roles                  string    `json:"roles"`
	AllowMarketing         bool      `json:"allow_marketing,omitempty"`
	Props                  StringMap `json:"props,omitempty"`
	NotifyProps            StringMap `json:"notify_props,omitempty"`
	LastPasswordUpdate     int64     `json:"last_password_update,omitempty"`
	LastPictureUpdate      int64     `json:"last_picture_update,omitempty"`
	FailedAttempts         int       `json:"failed_attempts,omitempty"`
	Locale                 string    `json:"locale"`
	Timezone               StringMap `json:"timezone"`
	MfaActive              bool      `json:"mfa_active,omitempty"`
	MfaSecret              string    `json:"mfa_secret,omitempty"`
	LastActivityAt         int64     `db:"-" json:"last_activity_at,omitempty"`
	IsBot                  bool      `db:"-" json:"is_bot,omitempty"`
	BotDescription         string    `db:"-" json:"bot_description,omitempty"`
	BotLastIconUpdate      int64     `db:"-" json:"bot_last_icon_update,omitempty"`
	TermsOfServiceId       string    `db:"-" json:"terms_of_service_id,omitempty"`
	TermsOfServiceCreateAt int64     `db:"-" json:"terms_of_service_create_at,omitempty"`
}

User contains the details about the user. This struct's serializer methods are auto-generated. If a new field is added/removed, please run make gen-serialized.

func UserFromBot

func UserFromBot(b *Bot) *User

UserFromBot returns a user model describing the bot fields stored in the User store.

func UserFromJson

func UserFromJson(data io.Reader) *User

UserFromJson will decode the input and return a User

func UserListFromJson

func UserListFromJson(data io.Reader) []*User

func (*User) AddNotifyProp

func (u *User) AddNotifyProp(key string, value string)

func (*User) ClearNonProfileFields

func (u *User) ClearNonProfileFields()

func (*User) DecodeMsg added in v5.28.0

func (z *User) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*User) DeepCopy

func (u *User) DeepCopy() *User

func (*User) EncodeMsg added in v5.28.0

func (z *User) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*User) Etag

func (u *User) Etag(showFullName, showEmail bool) string

Generate a valid strong etag so the browser can cache the results

func (*User) GetDisplayName

func (u *User) GetDisplayName(nameFormat string) string

func (*User) GetDisplayNameWithPrefix

func (u *User) GetDisplayNameWithPrefix(nameFormat, prefix string) string

func (*User) GetFullName

func (u *User) GetFullName() string

func (*User) GetMentionKeys

func (u *User) GetMentionKeys() []string

func (*User) GetPreferredTimezone

func (u *User) GetPreferredTimezone() string

func (*User) GetRawRoles

func (u *User) GetRawRoles() string

func (*User) GetRoles

func (u *User) GetRoles() []string

func (*User) IsGuest

func (u *User) IsGuest() bool

Make sure you acually want to use this function. In context.go there are functions to check permissions This function should not be used to check permissions.

func (*User) IsInRole

func (u *User) IsInRole(inRole string) bool

Make sure you acually want to use this function. In context.go there are functions to check permissions This function should not be used to check permissions.

func (*User) IsLDAPUser

func (u *User) IsLDAPUser() bool

func (*User) IsOAuthUser

func (u *User) IsOAuthUser() bool

func (*User) IsSAMLUser

func (u *User) IsSAMLUser() bool

func (*User) IsSSOUser

func (u *User) IsSSOUser() bool

func (*User) IsSystemAdmin added in v5.20.0

func (u *User) IsSystemAdmin() bool

func (*User) IsValid

func (u *User) IsValid() *AppError

IsValid validates the user and returns an error if it isn't configured correctly.

func (*User) MakeNonNil

func (u *User) MakeNonNil()

func (*User) MarshalMsg added in v5.28.0

func (z *User) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*User) Msgsize added in v5.28.0

func (z *User) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*User) Patch

func (u *User) Patch(patch *UserPatch)

func (*User) PreSave

func (u *User) PreSave()

PreSave will set the Id and Username if missing. It will also fill in the CreateAt, UpdateAt times. It will also hash the password. It should be run before saving the user to the db.

func (*User) PreUpdate

func (u *User) PreUpdate()

PreUpdate should be run before updating the user in the db.

func (*User) Sanitize

func (u *User) Sanitize(options map[string]bool)

Remove any private data from the user object

func (*User) SanitizeInput

func (u *User) SanitizeInput(isAdmin bool)

Remove any input data from the user object that is not user controlled

func (*User) SanitizeProfile

func (u *User) SanitizeProfile(options map[string]bool)

func (*User) SetDefaultNotifications

func (u *User) SetDefaultNotifications()

func (*User) ToJson

func (u *User) ToJson() string

ToJson convert a User to a json string

func (*User) UnmarshalMsg added in v5.28.0

func (z *User) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*User) UpdateMentionKeysFromUsername

func (u *User) UpdateMentionKeysFromUsername(oldUsername string)

type UserAccessToken

type UserAccessToken struct {
	Id          string `json:"id"`
	Token       string `json:"token,omitempty"`
	UserId      string `json:"user_id"`
	Description string `json:"description"`
	IsActive    bool   `json:"is_active"`
}

func UserAccessTokenFromJson

func UserAccessTokenFromJson(data io.Reader) *UserAccessToken

func UserAccessTokenListFromJson

func UserAccessTokenListFromJson(data io.Reader) []*UserAccessToken

func (*UserAccessToken) IsValid

func (t *UserAccessToken) IsValid() *AppError

func (*UserAccessToken) PreSave

func (t *UserAccessToken) PreSave()

func (*UserAccessToken) ToJson

func (t *UserAccessToken) ToJson() string

type UserAccessTokenSearch

type UserAccessTokenSearch struct {
	Term string `json:"term"`
}

func UserAccessTokenSearchFromJson

func UserAccessTokenSearchFromJson(data io.Reader) *UserAccessTokenSearch

UserAccessTokenSearchJson decodes the input and returns a UserAccessTokenSearch

func (*UserAccessTokenSearch) ToJson

func (c *UserAccessTokenSearch) ToJson() string

ToJson convert a UserAccessTokenSearch to json string

type UserAuth

type UserAuth struct {
	Password    string  `json:"password,omitempty"`
	AuthData    *string `json:"auth_data,omitempty"`
	AuthService string  `json:"auth_service,omitempty"`
}

func UserAuthFromJson

func UserAuthFromJson(data io.Reader) *UserAuth

func (*UserAuth) ToJson

func (u *UserAuth) ToJson() string

type UserAutocomplete

type UserAutocomplete struct {
	Users        []*User `json:"users"`
	OutOfChannel []*User `json:"out_of_channel,omitempty"`
}

func UserAutocompleteFromJson

func UserAutocompleteFromJson(data io.Reader) *UserAutocomplete

func (*UserAutocomplete) ToJson

func (o *UserAutocomplete) ToJson() string

type UserAutocompleteInChannel

type UserAutocompleteInChannel struct {
	InChannel    []*User `json:"in_channel"`
	OutOfChannel []*User `json:"out_of_channel"`
}

func UserAutocompleteInChannelFromJson

func UserAutocompleteInChannelFromJson(data io.Reader) *UserAutocompleteInChannel

func (*UserAutocompleteInChannel) ToJson

func (o *UserAutocompleteInChannel) ToJson() string

type UserAutocompleteInTeam

type UserAutocompleteInTeam struct {
	InTeam []*User `json:"in_team"`
}

func UserAutocompleteInTeamFromJson

func UserAutocompleteInTeamFromJson(data io.Reader) *UserAutocompleteInTeam

func (*UserAutocompleteInTeam) ToJson

func (o *UserAutocompleteInTeam) ToJson() string

type UserChannelIDPair

type UserChannelIDPair struct {
	UserID    string
	ChannelID string
}

type UserCountOptions

type UserCountOptions struct {
	// Should include users that are bots
	IncludeBotAccounts bool
	// Should include deleted users (of any type)
	IncludeDeleted bool
	// Exclude regular users
	ExcludeRegularUsers bool
	// Only include users on a specific team. "" for any team.
	TeamId string
	// Only include users on a specific channel. "" for any channel.
	ChannelId string
	// Restrict to search in a list of teams and channels
	ViewRestrictions *ViewUsersRestrictions
	// Only include users matching any of the given system wide roles.
	Roles []string
	// Only include users matching any of the given channel roles, must be used with ChannelId.
	ChannelRoles []string
	// Only include users matching any of the given team roles, must be used with TeamId.
	TeamRoles []string
}

Options for counting users

type UserForIndexing

type UserForIndexing struct {
	Id          string   `json:"id"`
	Username    string   `json:"username"`
	Nickname    string   `json:"nickname"`
	FirstName   string   `json:"first_name"`
	LastName    string   `json:"last_name"`
	Roles       string   `json:"roles"`
	CreateAt    int64    `json:"create_at"`
	DeleteAt    int64    `json:"delete_at"`
	TeamsIds    []string `json:"team_id"`
	ChannelsIds []string `json:"channel_id"`
}

type UserGetByIdsOptions

type UserGetByIdsOptions struct {
	// Since filters the users based on their UpdateAt timestamp.
	Since int64
}

type UserGetOptions

type UserGetOptions struct {
	// Filters the users in the team
	InTeamId string
	// Filters the users not in the team
	NotInTeamId string
	// Filters the users in the channel
	InChannelId string
	// Filters the users not in the channel
	NotInChannelId string
	// Filters the users in the group
	InGroupId string
	// Filters the users group constrained
	GroupConstrained bool
	// Filters the users without a team
	WithoutTeam bool
	// Filters the inactive users
	Inactive bool
	// Filters the active users
	Active bool
	// Filters for the given role
	Role string
	// Filters for users matching any of the given system wide roles
	Roles []string
	// Filters for users matching any of the given channel roles, must be used with InChannelId
	ChannelRoles []string
	// Filters for users matching any of the given team roles, must be used with InTeamId
	TeamRoles []string
	// Sorting option
	Sort string
	// Restrict to search in a list of teams and channels
	ViewRestrictions *ViewUsersRestrictions
	// Page
	Page int
	// Page size
	PerPage int
}

type UserMentionMap added in v5.22.0

type UserMentionMap map[string]string

func UserMentionMapFromURLValues added in v5.22.0

func UserMentionMapFromURLValues(values url.Values) (UserMentionMap, error)

func (UserMentionMap) ToURLValues added in v5.22.0

func (m UserMentionMap) ToURLValues() url.Values

type UserPatch

type UserPatch struct {
	Username    *string   `json:"username"`
	Password    *string   `json:"password,omitempty"`
	Nickname    *string   `json:"nickname"`
	FirstName   *string   `json:"first_name"`
	LastName    *string   `json:"last_name"`
	Position    *string   `json:"position"`
	Email       *string   `json:"email"`
	Props       StringMap `json:"props,omitempty"`
	NotifyProps StringMap `json:"notify_props,omitempty"`
	Locale      *string   `json:"locale"`
	Timezone    StringMap `json:"timezone"`
}

func UserPatchFromJson

func UserPatchFromJson(data io.Reader) *UserPatch

func (*UserPatch) ToJson

func (u *UserPatch) ToJson() string

type UserSearch

type UserSearch struct {
	Term             string   `json:"term"`
	TeamId           string   `json:"team_id"`
	NotInTeamId      string   `json:"not_in_team_id"`
	InChannelId      string   `json:"in_channel_id"`
	NotInChannelId   string   `json:"not_in_channel_id"`
	InGroupId        string   `json:"in_group_id"`
	GroupConstrained bool     `json:"group_constrained"`
	AllowInactive    bool     `json:"allow_inactive"`
	WithoutTeam      bool     `json:"without_team"`
	Limit            int      `json:"limit"`
	Role             string   `json:"role"`
	Roles            []string `json:"roles"`
	ChannelRoles     []string `json:"channel_roles"`
	TeamRoles        []string `json:"team_roles"`
}

UserSearch captures the parameters provided by a client for initiating a user search.

func UserSearchFromJson

func UserSearchFromJson(data io.Reader) *UserSearch

UserSearchFromJson will decode the input and return a User

func (*UserSearch) ToJson

func (u *UserSearch) ToJson() []byte

ToJson convert a User to a json string

type UserSearchOptions

type UserSearchOptions struct {
	// IsAdmin tracks whether or not the search is being conducted by an administrator.
	IsAdmin bool
	// AllowEmails allows search to examine the emails of users.
	AllowEmails bool
	// AllowFullNames allows search to examine the full names of users, vs. just usernames and nicknames.
	AllowFullNames bool
	// AllowInactive configures whether or not to return inactive users in the search results.
	AllowInactive bool
	// Narrows the search to the group constrained users
	GroupConstrained bool
	// Limit limits the total number of results returned.
	Limit int
	// Filters for the given role
	Role string
	// Filters for users that have any of the given system roles
	Roles []string
	// Filters for users that have the given channel roles to be used when searching in a channel
	ChannelRoles []string
	// Filters for users that have the given team roles to be used when searching in a team
	TeamRoles []string
	// Restrict to search in a list of teams and channels
	ViewRestrictions *ViewUsersRestrictions
	// List of allowed channels
	ListOfAllowedChannels []string
}

UserSearchOptions captures internal parameters derived from the user's permissions and a UserSearch request.

type UserSlice

type UserSlice []*User

func (UserSlice) FilterByActive

func (u UserSlice) FilterByActive(active bool) UserSlice

func (UserSlice) FilterByID

func (u UserSlice) FilterByID(ids []string) UserSlice

func (UserSlice) FilterWithoutBots

func (u UserSlice) FilterWithoutBots() UserSlice

func (UserSlice) FilterWithoutID

func (u UserSlice) FilterWithoutID(ids []string) UserSlice

func (UserSlice) IDs

func (u UserSlice) IDs() []string

func (UserSlice) Usernames

func (u UserSlice) Usernames() []string

type UserTeamIDPair

type UserTeamIDPair struct {
	UserID string
	TeamID string
}

type UserTermsOfService

type UserTermsOfService struct {
	UserId           string `json:"user_id"`
	TermsOfServiceId string `json:"terms_of_service_id"`
	CreateAt         int64  `json:"create_at"`
}

func UserTermsOfServiceFromJson

func UserTermsOfServiceFromJson(data io.Reader) *UserTermsOfService

func (*UserTermsOfService) IsValid

func (ut *UserTermsOfService) IsValid() *AppError

func (*UserTermsOfService) PreSave

func (ut *UserTermsOfService) PreSave()

func (*UserTermsOfService) ToJson

func (ut *UserTermsOfService) ToJson() string

type UserUpdate

type UserUpdate struct {
	Old *User
	New *User
}

type UserWithGroups

type UserWithGroups struct {
	User
	GroupIDs    *string  `json:"-"`
	Groups      []*Group `json:"groups"`
	SchemeGuest bool     `json:"scheme_guest"`
	SchemeUser  bool     `json:"scheme_user"`
	SchemeAdmin bool     `json:"scheme_admin"`
}

func (*UserWithGroups) GetGroupIDs

func (u *UserWithGroups) GetGroupIDs() []string

type UsersStats

type UsersStats struct {
	TotalUsersCount int64 `json:"total_users_count"`
}

func UsersStatsFromJson

func UsersStatsFromJson(data io.Reader) *UsersStats

func (*UsersStats) ToJson

func (o *UsersStats) ToJson() string

type UsersWithGroupsAndCount

type UsersWithGroupsAndCount struct {
	Users []*UserWithGroups `json:"users"`
	Count int64             `json:"total_count"`
}

func UsersWithGroupsAndCountFromJson

func UsersWithGroupsAndCountFromJson(data io.Reader) *UsersWithGroupsAndCount

type ViewUsersRestrictions

type ViewUsersRestrictions struct {
	Teams    []string
	Channels []string
}

func (*ViewUsersRestrictions) Hash

func (r *ViewUsersRestrictions) Hash() string

type WarnMetric added in v5.26.0

type WarnMetric struct {
	Id        string
	Limit     int64
	IsBotOnly bool
	IsRunOnce bool
}

type WarnMetricDisplayTexts added in v5.26.0

type WarnMetricDisplayTexts struct {
	BotTitle          string
	BotMessageBody    string
	BotSuccessMessage string
	EmailBody         string
}

type WarnMetricStatus added in v5.26.0

type WarnMetricStatus struct {
	Id          string `json:"id"`
	Limit       int64  `json:"limit"`
	Acked       bool   `json:"acked"`
	StoreStatus string `json:"store_status,omitempty"`
}

func WarnMetricStatusFromJson added in v5.26.0

func WarnMetricStatusFromJson(data io.Reader) *WarnMetricStatus

func (*WarnMetricStatus) ToJson added in v5.26.0

func (wms *WarnMetricStatus) ToJson() string

type WebSocketClient

type WebSocketClient struct {
	Url                string                  // The location of the server like "ws://localhost:8065"
	ApiUrl             string                  // The API location of the server like "ws://localhost:8065/api/v3"
	ConnectUrl         string                  // The WebSocket URL to connect to like "ws://localhost:8065/api/v3/path/to/websocket"
	Conn               *websocket.Conn         // The WebSocket connection
	AuthToken          string                  // The token used to open the WebSocket connection
	Sequence           int64                   // The ever-incrementing sequence attached to each WebSocket action
	PingTimeoutChannel chan bool               // The channel used to signal ping timeouts
	EventChannel       chan *WebSocketEvent    // The channel used to receive various events pushed from the server. For example: typing, posted
	ResponseChannel    chan *WebSocketResponse // The channel used to receive responses for requests made to the server
	ListenError        *AppError               // A field that is set if there was an abnormal closure of the WebSocket connection
	// contains filtered or unexported fields
}

WebSocketClient stores the necessary information required to communicate with a WebSocket endpoint. A client must read from PingTimeoutChannel, EventChannel and ResponseChannel to prevent deadlocks from occuring in the program.

func (*WebSocketClient) Close

func (wsc *WebSocketClient) Close()

Close closes the websocket client. It is recommended that a closed client should not be reused again. Rather a new client should be created anew.

func (*WebSocketClient) Connect

func (wsc *WebSocketClient) Connect() *AppError

Connect creates a websocket connection with the given ConnectUrl. This is racy and error-prone should not be used. Use any of the New* functions to create a websocket.

func (*WebSocketClient) ConnectWithDialer

func (wsc *WebSocketClient) ConnectWithDialer(dialer *websocket.Dialer) *AppError

ConnectWithDialer creates a websocket connection with the given ConnectUrl using the dialer. This is racy and error-prone and should not be used. Use any of the New* functions to create a websocket.

func (*WebSocketClient) GetStatuses

func (wsc *WebSocketClient) GetStatuses()

GetStatuses will return a map of string statuses using user id as the key

func (*WebSocketClient) GetStatusesByIds

func (wsc *WebSocketClient) GetStatusesByIds(userIds []string)

GetStatusesByIds will fetch certain user statuses based on ids and return a map of string statuses using user id as the key

func (*WebSocketClient) Listen

func (wsc *WebSocketClient) Listen()

Listen starts the read loop of the websocket client.

func (*WebSocketClient) SendMessage

func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{})

func (*WebSocketClient) UserTyping

func (wsc *WebSocketClient) UserTyping(channelId, parentId string)

UserTyping will push a user_typing event out to all connected users who are in the specified channel

type WebSocketEvent

type WebSocketEvent struct {
	Event     string                 // Deprecated: use EventType()
	Data      map[string]interface{} // Deprecated: use GetData()
	Broadcast *WebsocketBroadcast    // Deprecated: use GetBroadcast()
	Sequence  int64                  // Deprecated: use GetSequence()
	// contains filtered or unexported fields
}

**NOTE**: Direct access to WebSocketEvent fields is deprecated. They will be made unexported in next major version release. Provided getter functions should be used instead.

func NewWebSocketEvent

func NewWebSocketEvent(event, teamId, channelId, userId string, omitUsers map[string]bool) *WebSocketEvent

func WebSocketEventFromJson

func WebSocketEventFromJson(data io.Reader) *WebSocketEvent

func (*WebSocketEvent) Add

func (ev *WebSocketEvent) Add(key string, value interface{})

func (*WebSocketEvent) Copy added in v5.20.0

func (ev *WebSocketEvent) Copy() *WebSocketEvent

func (*WebSocketEvent) EventType

func (ev *WebSocketEvent) EventType() string

func (*WebSocketEvent) GetBroadcast added in v5.20.0

func (ev *WebSocketEvent) GetBroadcast() *WebsocketBroadcast

func (*WebSocketEvent) GetData added in v5.20.0

func (ev *WebSocketEvent) GetData() map[string]interface{}

func (*WebSocketEvent) GetSequence added in v5.20.0

func (ev *WebSocketEvent) GetSequence() int64

func (*WebSocketEvent) IsValid

func (ev *WebSocketEvent) IsValid() bool

func (*WebSocketEvent) PrecomputeJSON

func (ev *WebSocketEvent) PrecomputeJSON() *WebSocketEvent

PrecomputeJSON precomputes and stores the serialized JSON for all fields other than Sequence. This makes ToJson much more efficient when sending the same event to multiple connections.

func (*WebSocketEvent) SetBroadcast added in v5.20.0

func (ev *WebSocketEvent) SetBroadcast(broadcast *WebsocketBroadcast) *WebSocketEvent

func (*WebSocketEvent) SetData added in v5.20.0

func (ev *WebSocketEvent) SetData(data map[string]interface{}) *WebSocketEvent

func (*WebSocketEvent) SetEvent added in v5.20.0

func (ev *WebSocketEvent) SetEvent(event string) *WebSocketEvent

func (*WebSocketEvent) SetSequence added in v5.20.0

func (ev *WebSocketEvent) SetSequence(seq int64) *WebSocketEvent

func (*WebSocketEvent) ToJson

func (ev *WebSocketEvent) ToJson() string

type WebSocketMessage

type WebSocketMessage interface {
	ToJson() string
	IsValid() bool
	EventType() string
}

type WebSocketRequest

type WebSocketRequest struct {
	// Client-provided fields
	Seq    int64                  `json:"seq"`    // A counter which is incremented for every request made.
	Action string                 `json:"action"` // The action to perform for a request. For example: get_statuses, user_typing.
	Data   map[string]interface{} `json:"data"`   // The metadata for an action.

	// Server-provided fields
	Session Session              `json:"-"`
	T       goi18n.TranslateFunc `json:"-"`
	Locale  string               `json:"-"`
}

WebSocketRequest represents a request made to the server through a websocket.

func WebSocketRequestFromJson

func WebSocketRequestFromJson(data io.Reader) *WebSocketRequest

func (*WebSocketRequest) ToJson

func (o *WebSocketRequest) ToJson() string

type WebSocketResponse

type WebSocketResponse struct {
	Status   string                 `json:"status"`              // The status of the response. For example: OK, FAIL.
	SeqReply int64                  `json:"seq_reply,omitempty"` // A counter which is incremented for every response sent.
	Data     map[string]interface{} `json:"data,omitempty"`      // The data contained in the response.
	Error    *AppError              `json:"error,omitempty"`     // A field that is set if any error has occurred.
}

WebSocketResponse represents a response received through the WebSocket for a request made to the server. This is available through the ResponseChannel channel in WebSocketClient.

func NewWebSocketError

func NewWebSocketError(seqReply int64, err *AppError) *WebSocketResponse

func NewWebSocketResponse

func NewWebSocketResponse(status string, seqReply int64, data map[string]interface{}) *WebSocketResponse

func WebSocketResponseFromJson

func WebSocketResponseFromJson(data io.Reader) *WebSocketResponse

func (*WebSocketResponse) Add

func (m *WebSocketResponse) Add(key string, value interface{})

func (*WebSocketResponse) EventType

func (m *WebSocketResponse) EventType() string

func (*WebSocketResponse) IsValid

func (m *WebSocketResponse) IsValid() bool

func (*WebSocketResponse) ToJson

func (m *WebSocketResponse) ToJson() string

type WebsocketBroadcast

type WebsocketBroadcast struct {
	OmitUsers             map[string]bool `json:"omit_users"` // broadcast is omitted for users listed here
	UserId                string          `json:"user_id"`    // broadcast only occurs for this user
	ChannelId             string          `json:"channel_id"` // broadcast only occurs for users in this channel
	TeamId                string          `json:"team_id"`    // broadcast only occurs for users in this team
	ContainsSanitizedData bool            `json:"-"`
	ContainsSensitiveData bool            `json:"-"`
}

type Worker

type Worker interface {
	Run()
	Stop()
	JobChannel() chan<- Job
}

type X509Certificate added in v5.20.0

type X509Certificate struct {
	XMLName xml.Name
	Cert    string `xml:",innerxml"`
}

type X509Data added in v5.20.0

type X509Data struct {
	XMLName         xml.Name
	X509Certificate X509Certificate `xml:"X509Certificate"`
}

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL