mattermost-server: Index | Files | Directories

package model

import ""


Package Files

access.go analytics_row.go at_mentions.go audit.go auditconv.go audits.go authorize.go bot.go bot_default_image.go builtin.go bundle_info.go channel.go channel_count.go channel_data.go channel_list.go channel_member.go channel_member_history.go channel_member_history_result.go channel_mentions.go channel_search.go channel_sidebar.go channel_stats.go channel_view.go client4.go cluster_discovery.go cluster_info.go cluster_message.go cluster_stats.go command.go command_args.go command_autocomplete.go command_request.go command_response.go command_webhook.go compliance.go compliance_post.go config.go data_retention_policy.go emoji.go emoji_data.go emoji_search.go file.go file_info.go gitlab.go group.go group_member.go group_syncable.go guest_invite.go incoming_webhook.go initial_load.go integration_action.go integrity.go job.go ldap.go license.go link_metadata.go manifest.go marketplace_plugin.go mention_map.go message_export.go mfa_secret.go migration.go oauth.go outgoing_webhook.go permission.go plugin_event_data.go plugin_key_value.go plugin_kvset_options.go plugin_status.go plugin_valid.go plugins_response.go post.go post_embed.go post_list.go post_metadata.go post_search_results.go preference.go preferences.go push_notification.go push_response.go reaction.go role.go saml.go scheduled_task.go scheme.go search_params.go security_bulletin.go serialized_gen.go session.go slack_attachment.go slack_compatibility.go status.go suggest_command.go switch_request.go system.go team.go team_member.go team_search.go team_stats.go terms_of_service.go token.go typing_request.go user.go user_access_token.go user_access_token_search.go user_autocomplete.go user_count.go user_get.go user_search.go user_terms_of_service.go users_stats.go utils.go version.go websocket_client.go websocket_message.go websocket_request.go


const (
    ACCESS_TOKEN_GRANT_TYPE  = "authorization_code"
    ACCESS_TOKEN_TYPE        = "bearer"
    REFRESH_TOKEN_GRANT_TYPE = "refresh_token"
const (
    AUTHCODE_EXPIRE_TIME   = 60 * 10 // 10 minutes
    DEFAULT_SCOPE          = "user"
const (
    BOT_WARN_METRIC_BOT_USERNAME = "mattermost-advisor"
const (
    CHANNEL_OPEN                   = "O"
    CHANNEL_PRIVATE                = "P"
    CHANNEL_DIRECT                 = "D"
    CHANNEL_GROUP                  = "G"
    DEFAULT_CHANNEL                = "town-square"
    CHANNEL_CACHE_SIZE             = 25000

    CHANNEL_SORT_BY_STATUS   = "status"
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_ON          = "on"
    IGNORE_CHANNEL_MENTIONS_NOTIFY_PROP = "ignore_channel_mentions"
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"
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"
    STATUS                    = "status"
    STATUS_OK                 = "OK"
    STATUS_FAIL               = "FAIL"
    STATUS_REMOVE             = "REMOVE"

    CLIENT_DIR = "client"

    API_URL_SUFFIX_V1 = "/api/v1"
    API_URL_SUFFIX_V4 = "/api/v4"
const (
    CDS_OFFLINE_AFTER_MILLIS = 1000 * 60 * 30 // 30 minutes
    CDS_TYPE_APP             = "mattermost_app"
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              = "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_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"
const (
const (
const (

const (

    IMAGE_DRIVER_LOCAL = "local"
    IMAGE_DRIVER_S3    = "amazons3"

    DATABASE_DRIVER_SQLITE   = "sqlite3"
    DATABASE_DRIVER_MYSQL    = "mysql"

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


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

    GENERIC_NO_CHANNEL_NOTIFICATION = "generic_no_channel"
    GENERIC_NOTIFICATION            = "generic"
    MM_SUPPORT_ADDRESS              = ""
    FULL_NOTIFICATION               = "full"
    ID_LOADED_NOTIFICATION          = "id_loaded"


    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"

    PERMISSIONS_DELETE_POST_ALL          = "all"

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





    SERVICE_SETTINGS_DEFAULT_SITE_URL           = "http://localhost:8065"

    TEAM_SETTINGS_DEFAULT_SITE_NAME                = "Mattermost"

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













    ELASTICSEARCH_SETTINGS_DEFAULT_CONNECTION_URL                    = "http://localhost:9200"
    ELASTICSEARCH_SETTINGS_DEFAULT_USERNAME                          = "elastic"
    ELASTICSEARCH_SETTINGS_DEFAULT_PASSWORD                          = "changeme"

    BLEVE_SETTINGS_DEFAULT_INDEX_DIR                         = ""


    PLUGIN_SETTINGS_DEFAULT_DIRECTORY          = "./plugins"

    COMPLIANCE_EXPORT_TYPE_CSV             = "csv"
    GLOBALRELAY_CUSTOMER_TYPE_A10          = "A10"


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

    GOOGLE_SETTINGS_DEFAULT_SCOPE             = "profile email"
    GOOGLE_SETTINGS_DEFAULT_USER_API_ENDPOINT = ",emailAddresses,nicknames,metadata"

    OFFICE365_SETTINGS_DEFAULT_SCOPE             = "User.Read"

    LOCAL_MODE_SOCKET_PATH = "/var/tmp/mattermost_local.socket"
const (
    EMOJI_SORT_BY_NAME    = "name"
const (
const (
    GroupSourceLdap GroupSource = "ldap"

    GroupNameMaxLength        = 64
    GroupSourceMaxLength      = 64
    GroupDisplayNameMaxLength = 128
    GroupDescriptionMaxLength = 1024
    GroupRemoteIDMaxLength    = 48
const (
    POST_ACTION_TYPE_BUTTON                         = "button"
    POST_ACTION_TYPE_SELECT                         = "select"
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_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"
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
const (
    LINK_METADATA_TYPE_IMAGE     LinkMetadataType = "image"
    LINK_METADATA_TYPE_NONE      LinkMetadataType = "none"
    LINK_METADATA_TYPE_OPENGRAPH LinkMetadataType = "opengraph"
    MAX_IMAGES                   int              = 5
const (
    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"
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"
const (
    PERMISSION_SCOPE_SYSTEM  = "system_scope"
    PERMISSION_SCOPE_TEAM    = "team_scope"
    PERMISSION_SCOPE_CHANNEL = "channel_scope"
const (
    KEY_VALUE_KEY_MAX_RUNES       = 50
const (
    PluginStateNotRunning          = 0
    PluginStateStarting            = 1 // unused by server
    PluginStateRunning             = 2
    PluginStateFailedToStart       = 3
    PluginStateFailedToStayRunning = 4
    PluginStateStopping            = 5 // unused by server
const (
    MinIdLength  = 3
    MaxIdLength  = 190
    ValidIdRegex = `^[a-zA-Z0-9-_\.]+$`
const (
    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_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"
const (
    PREFERENCE_CATEGORY_FLAGGED_POST        = "flagged_post"

    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_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_FIFTEEN             = "fifteen"
    PREFERENCE_EMAIL_INTERVAL_HOUR                = "hour"
const (
    PUSH_NOTIFY_APPLE                = "apple"
    PUSH_NOTIFY_ANDROID              = "android"

    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

    MHPNS = ""

    PUSH_SEND_PREPARE = "Prepared to send"
    PUSH_SEND_SUCCESS = "Successful"
    PUSH_NOT_SENT     = "Not Sent due to preferences"
    PUSH_RECEIVED     = "Received by device"
const (
    PUSH_STATUS           = "status"
    PUSH_STATUS_OK        = "OK"
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"

    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

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

    RoleTypeGuest RoleType = "Guest"
    RoleTypeUser  RoleType = "User"
    RoleTypeAdmin RoleType = "Admin"
const (
    USER_AUTH_SERVICE_SAML      = "saml"
const (
    SCHEME_NAME_MAX_LENGTH         = 64
    SCHEME_SCOPE_TEAM              = "team"
    SCHEME_SCOPE_CHANNEL           = "channel"
const (
    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_PROP_IS_GUEST             = "is_guest"
    SESSION_ACTIVITY_TIMEOUT          = 1000 * 60 * 5 // 5 minutes
    SESSION_USER_ACCESS_TOKEN_EXPIRY  = 100 * 365     // 100 years
const (
    STATUS_OUT_OF_OFFICE   = "ooo"
    STATUS_OFFLINE         = "offline"
    STATUS_AWAY            = "away"
    STATUS_DND             = "dnd"
    STATUS_ONLINE          = "online"
    STATUS_CHANNEL_TIMEOUT = 20000  // 20 seconds
    STATUS_MIN_UPDATE_TIME = 120000 // 2 minutes
const (
    SYSTEM_DIAGNOSTIC_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_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_200 = "warn_metric_number_of_active_users_200"
    SYSTEM_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_400 = "warn_metric_number_of_active_users_400"
    SYSTEM_WARN_METRIC_NUMBER_OF_ACTIVE_USERS_500 = "warn_metric_number_of_active_users_500"
const (
    WARN_METRIC_STATUS_RUNONCE       = "runonce"
    WARN_METRIC_STATUS_ACK           = "ack"
const (
    TEAM_OPEN                       = "O"
    TEAM_INVITE                     = "I"
    TEAM_EMAIL_MAX_LENGTH           = 128
    TEAM_NAME_MAX_LENGTH            = 64
    TEAM_NAME_MIN_LENGTH            = 2
const (
    TOKEN_SIZE            = 64
    MAX_TOKEN_EXIPRY_TIME = 1000 * 60 * 60 * 48 // 48 hour
    TOKEN_TYPE_OAUTH      = "oauth"
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_NAME_MAX_LENGTH      = 64
const (
    LOWERCASE_LETTERS = "abcdefghijklmnopqrstuvwxyz"
    NUMBERS           = "0123456789"
    SYMBOLS           = " !\"\\#$%&'()*+,-./:;<=>?@[]^_`|~"
const (
    SOCKET_MAX_MESSAGE_SIZE_KB  = 8 * 1024 // 8KB
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"
const (
    COMMAND_WEBHOOK_LIFETIME = 1000 * 60 * 30
const (
const (
    MaxImageSize = int64(6048 * 4032) // 24 megapixels, roughly 36MB as a raw image
const (
    USERNAME = "Username"
const (
const (


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"}
var ALL_PERMISSIONS []*Permission
var AT_MENTION_PATTEN = regexp.MustCompile(`\B@`)
var BotDefaultImage = []byte{ /* 3372 elements not displayed */

var BuildDate string
var BuildEnterpriseReady string
var BuildHash string
var BuildHashEnterprise string
var BuildNumber string
var BuiltInSchemeManagedRoleIDs []string
var CurrentVersion string = versions[0]
var EMOJI_PATTERN = regexp.MustCompile(`:[a-zA-Z0-9_-]+:`)
var PostActionRetainPropKeys = []string{"from_webhook", "override_username", "override_icon_url"}
var ServerTLSSupportedCiphers = map[string]uint16{
    "TLS_RSA_WITH_RC4_128_SHA":                tls.TLS_RSA_WITH_RC4_128_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_RSA_WITH_RC4_128_SHA":          tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
var SystemEmojis = map[string]string{ /* 2383 elements not displayed */ }
var WarnMetricsTable = map[string]WarnMetric{
        Limit:     200,
        IsBotOnly: true,
        IsRunOnce: true,
        Limit:     400,
        IsBotOnly: true,
        IsRunOnce: true,
        Limit:     500,
        IsBotOnly: false,
        IsRunOnce: false,

func AppErrorInit Uses

func AppErrorInit(t goi18n.TranslateFunc)

func ArrayFromInterface Uses

func ArrayFromInterface(data interface{}) []string

func ArrayFromJson Uses

func ArrayFromJson(data io.Reader) []string

func ArrayToJson Uses

func ArrayToJson(objmap []string) string

func AsStringBoolMap Uses

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

func AuditModelTypeConv Uses

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

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

func AutocompleteStaticListItemsToJSON Uses

func AutocompleteStaticListItemsToJSON(items []AutocompleteListItem) []byte

AutocompleteStaticListItemsToJSON returns json for a list of AutocompleteStaticListItem objects

func AutocompleteSuggestionsToJSON Uses

func AutocompleteSuggestionsToJSON(suggestions []AutocompleteSuggestion) []byte

AutocompleteSuggestionsToJSON returns json for a list of AutocompleteSuggestion objects

func ChannelMentions Uses

func ChannelMentions(message string) []string

func ChannelModeratedPermissionsChangedByPatch Uses

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

func CheckStatusOK Uses

func CheckStatusOK(r *http.Response) bool

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

func CleanRoleNames Uses

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

func CleanTeamName Uses

func CleanTeamName(s string) string

func CleanUsername Uses

func CleanUsername(s string) string

func ClearMentionTags Uses

func ClearMentionTags(post string) string

func ClusterInfosToJson Uses

func ClusterInfosToJson(objmap []*ClusterInfo) string

func CommandListToJson Uses

func CommandListToJson(l []*Command) string

func ComparePassword Uses

func ComparePassword(hash string, password string) bool

ComparePassword compares the hash

func CompliancePostHeader Uses

func CompliancePostHeader() []string

func CopyStringMap Uses

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

func DecryptPostActionCookie Uses

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

func EmailInviteWithErrorToEmails Uses

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

func EmailInviteWithErrorToJson Uses

func EmailInviteWithErrorToJson(o []*EmailInviteWithError) string

func EmailInviteWithErrorToString Uses

func EmailInviteWithErrorToString(o *EmailInviteWithError) string

func EmojiListToJson Uses

func EmojiListToJson(emojiList []*Emoji) string

func Etag Uses

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

func FileInfosToJson Uses

func FileInfosToJson(infos []*FileInfo) string

func FloorToNearestHour Uses

func FloorToNearestHour(ms int64) int64

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

func GenerateLinkMetadataHash Uses

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 Uses

func GeneratePassword(minimumLength int) string

func GetDMNameFromIds Uses

func GetDMNameFromIds(userId1, userId2 string) string

func GetEndOfDayMillis Uses

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 Uses

func GetEtagForFileInfos(infos []*FileInfo) string

func GetGroupDisplayNameFromUsers Uses

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

func GetGroupNameFromUserIds Uses

func GetGroupNameFromUserIds(userIds []string) string

func GetImageMimeType Uses

func GetImageMimeType(ext string) string

func GetInfoForBytes Uses

func GetInfoForBytes(name string, data []byte) (*FileInfo, *AppError)

func GetMillis Uses

func GetMillis() int64

GetMillis is a convenience method to get milliseconds since epoch.

func GetMillisForTime Uses

func GetMillisForTime(thisTime time.Time) int64

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

func GetPreferredTimezone Uses

func GetPreferredTimezone(timezone StringMap) string

func GetPreviousVersion Uses

func GetPreviousVersion(version string) string

func GetServerIpAddress Uses

func GetServerIpAddress(iface string) string

func GetStartOfDayMillis Uses

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 Uses

func GetSystemEmojiId(emojiName string) (string, bool)

func HashPassword Uses

func HashPassword(password string) string

HashPassword generates a hash using the bcrypt.GenerateFromPassword

func IncomingWebhookListToJson Uses

func IncomingWebhookListToJson(l []*IncomingWebhook) string

func IncomingWebhookRequestFromJson Uses

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

func IsBotDMChannel Uses

func IsBotDMChannel(channel *Channel, botUserID string) bool

func IsChannelMarkUnreadLevelValid Uses

func IsChannelMarkUnreadLevelValid(markUnreadLevel string) bool

func IsChannelNotifyLevelValid Uses

func IsChannelNotifyLevelValid(notifyLevel string) bool

func IsCurrentVersion Uses

func IsCurrentVersion(versionToCheck string) bool

func IsDomainName Uses

func IsDomainName(s string) bool

Copied from

func IsFileExtImage Uses

func IsFileExtImage(ext string) bool

func IsIgnoreChannelMentionsValid Uses

func IsIgnoreChannelMentionsValid(ignoreChannelMentions string) bool

func IsInRole Uses

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 Uses

func IsLower(s string) bool

func IsPreviousVersionsSupported Uses

func IsPreviousVersionsSupported(versionToCheck string) bool

func IsReservedTeamName Uses

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

func IsSamlFile Uses

func IsSamlFile(saml *SamlSettings, filename string) bool

IsSamlFile checks if filename is a SAML file.

func IsSendEmailValid Uses

func IsSendEmailValid(sendEmail string) bool

func IsValidAlphaNum Uses

func IsValidAlphaNum(s string) bool

func IsValidAlphaNumHyphenUnderscore Uses

func IsValidAlphaNumHyphenUnderscore(s string, withFormat bool) bool

func IsValidChannelIdentifier Uses

func IsValidChannelIdentifier(s string) bool

func IsValidCommentsNotifyLevel Uses

func IsValidCommentsNotifyLevel(notifyLevel string) bool

func IsValidEmail Uses

func IsValidEmail(email string) bool

func IsValidEmailBatchingInterval Uses

func IsValidEmailBatchingInterval(emailInterval string) bool

func IsValidHttpUrl Uses

func IsValidHttpUrl(rawUrl string) bool

func IsValidId Uses

func IsValidId(value string) bool

func IsValidLocale Uses

func IsValidLocale(locale string) bool

func IsValidNumberString Uses

func IsValidNumberString(value string) bool

func IsValidPluginId Uses

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 Uses

func IsValidPushStatusNotifyLevel(notifyLevel string) bool

func IsValidRoleName Uses

func IsValidRoleName(roleName string) bool

func IsValidSchemeName Uses

func IsValidSchemeName(name string) bool

func IsValidTeamName Uses

func IsValidTeamName(s string) bool

func IsValidTrueOrFalseString Uses

func IsValidTrueOrFalseString(value string) bool

func IsValidTurnOrStunServer Uses

func IsValidTurnOrStunServer(rawUri string) bool

func IsValidUserNotifyLevel Uses

func IsValidUserNotifyLevel(notifyLevel string) bool

func IsValidUserRoles Uses

func IsValidUserRoles(userRoles string) bool

func IsValidUsername Uses

func IsValidUsername(s string) bool

func IsValidWebsocketUrl Uses

func IsValidWebsocketUrl(rawUrl string) bool

func JobsToJson Uses

func JobsToJson(jobs []*Job) string

func MakeDefaultRoles Uses

func MakeDefaultRoles() map[string]*Role

func ManifestListToJson Uses

func ManifestListToJson(m []*Manifest) string

func MapBoolFromJson Uses

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

MapFromJson will decode the key/value pair map

func MapBoolToJson Uses

func MapBoolToJson(objmap map[string]bool) string

MapBoolToJson converts a map to a json string

func MapFromJson Uses

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

MapFromJson will decode the key/value pair map

func MapPostIdToReactionsFromJson Uses

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

func MapPostIdToReactionsToJson Uses

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

func MapToJson Uses

func MapToJson(objmap map[string]string) string

MapToJson converts a map to a json string

func MapWarnMetricStatusToJson Uses

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

func NewBool Uses

func NewBool(b bool) *bool

func NewId Uses

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 Uses

func NewInt(n int) *int

func NewInt64 Uses

func NewInt64(n int64) *int64

func NewPluginKeyValueFromOptions Uses

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 Uses

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 Uses

func NewRandomString(length int) string

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

func NewRandomTeamName Uses

func NewRandomTeamName() string

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

func NewString Uses

func NewString(s string) *string

func NewWebSocketClient Uses

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

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

func NewWebSocketClient4 Uses

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 Uses

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 Uses

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 Uses

func NormalizeEmail(email string) string

func NormalizeUsername Uses

func NormalizeUsername(username string) string

func OAuthAppListToJson Uses

func OAuthAppListToJson(l []*OAuthApp) string

func OutgoingWebhookListToJson Uses

func OutgoingWebhookListToJson(l []*OutgoingWebhook) string

func PadDateStringZeros Uses

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 Uses

func ParseHashtags(text string) (string, string)

func ParseSlackAttachment Uses

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 Uses

func ParseSlackLinksToMarkdown(text string) string

func PermissionsChangedByPatch Uses

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 Uses

func PossibleAtMentions(message string) []string

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

func ReactionsToJson Uses

func ReactionsToJson(o []*Reaction) string

func RemoveDuplicateStrings Uses

func RemoveDuplicateStrings(in []string) []string

func RewriteImageURLs Uses

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 Uses

func RoleListToJson(r []*Role) string

func SanitizeUnicode Uses

func SanitizeUnicode(s string) string

SanitizeUnicode will remove undesirable Unicode characters from a string.

func SchemeIDFromJson Uses

func SchemeIDFromJson(data io.Reader) *string

func SchemesToJson Uses

func SchemesToJson(schemes []*Scheme) string

func SessionsToJson Uses

func SessionsToJson(o []*Session) string

func SidebarCategoriesWithChannelsToJson Uses

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

func SplitVersion Uses

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

func StatusListToJson Uses

func StatusListToJson(u []*Status) string

func StatusMapToInterfaceMap Uses

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

func StringFromJson Uses

func StringFromJson(data io.Reader) string

func StringInterfaceFromJson Uses

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

func StringInterfaceToJson Uses

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

func StringToJson Uses

func StringToJson(s string) string

func TeamListToJson Uses

func TeamListToJson(t []*Team) string

func TeamMapFromJson Uses

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

func TeamMapToJson Uses

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

func TeamMemberWithErrorToString Uses

func TeamMemberWithErrorToString(o *TeamMemberWithError) string

func TeamMembersToJson Uses

func TeamMembersToJson(o []*TeamMember) string

func TeamMembersWithErrorToJson Uses

func TeamMembersWithErrorToJson(o []*TeamMemberWithError) string

func TeamsUnreadToJson Uses

func TeamsUnreadToJson(o []*TeamUnread) string

func TeamsWithCountToJson Uses

func TeamsWithCountToJson(tlc *TeamsWithCount) []byte

func TrimUsernameSpecialChar Uses

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 Uses

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 UserAccessTokenListToJson Uses

func UserAccessTokenListToJson(t []*UserAccessToken) string

func UserListToJson Uses

func UserListToJson(u []*User) string

func UserMapFromJson Uses

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

func UserMapToJson Uses

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

type AccessData Uses

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 Uses

func AccessDataFromJson(data io.Reader) *AccessData

func (*AccessData) IsExpired Uses

func (ad *AccessData) IsExpired() bool

func (*AccessData) IsValid Uses

func (ad *AccessData) IsValid() *AppError

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

func (*AccessData) ToJson Uses

func (ad *AccessData) ToJson() string

type AccessResponse Uses

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 Uses

func AccessResponseFromJson(data io.Reader) *AccessResponse

func (*AccessResponse) ToJson Uses

func (ar *AccessResponse) ToJson() string

type AnalyticsPostCountsOptions Uses

type AnalyticsPostCountsOptions struct {
    TeamId        string
    BotsOnly      bool
    YesterdayOnly bool

type AnalyticsRow Uses

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

func AnalyticsRowFromJson Uses

func AnalyticsRowFromJson(data io.Reader) *AnalyticsRow

func (*AnalyticsRow) ToJson Uses

func (me *AnalyticsRow) ToJson() string

type AnalyticsRows Uses

type AnalyticsRows []*AnalyticsRow

func AnalyticsRowsFromJson Uses

func AnalyticsRowsFromJson(data io.Reader) AnalyticsRows

func (AnalyticsRows) ToJson Uses

func (me AnalyticsRows) ToJson() string

type AnalyticsSettings Uses

type AnalyticsSettings struct {
    MaxUsersForStatistics *int `restricted:"true"`

func (*AnalyticsSettings) SetDefaults Uses

func (s *AnalyticsSettings) SetDefaults()

type AnnouncementSettings Uses

type AnnouncementSettings struct {
    EnableBanner         *bool
    BannerText           *string
    BannerColor          *string
    BannerTextColor      *string
    AllowBannerDismissal *bool

func (*AnnouncementSettings) SetDefaults Uses

func (s *AnnouncementSettings) SetDefaults()

type AppError Uses

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 Uses

func AppErrorFromJson(data io.Reader) *AppError

AppErrorFromJson will decode the input and return an AppError

func DecodeAndVerifyTriggerId Uses

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

func GenerateTriggerId Uses

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

func InvalidTermsOfServiceError Uses

func InvalidTermsOfServiceError(fieldName string, termsOfServiceId string) *AppError

func InvalidUserError Uses

func InvalidUserError(fieldName string, userId string) *AppError

func InvalidUserTermsOfServiceError Uses

func InvalidUserTermsOfServiceError(fieldName string, userTermsOfServiceId string) *AppError

func IsValidEmojiName Uses

func IsValidEmojiName(name string) *AppError

func MakeBotNotFoundError Uses

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 Uses

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

func (*AppError) Error Uses

func (er *AppError) Error() string

func (*AppError) SystemMessage Uses

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

func (*AppError) ToJson Uses

func (er *AppError) ToJson() string

func (*AppError) Translate Uses

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

type Attribute Uses

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

type AttributeValue Uses

type AttributeValue struct {
    Type   string `xml:" type,attr"`
    Value  string `xml:",chardata"`
    NameID *NameID

type Audit Uses

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 Uses

func AuditFromJson(data io.Reader) *Audit

func (*Audit) ToJson Uses

func (o *Audit) ToJson() string

type Audits Uses

type Audits []Audit

func AuditsFromJson Uses

func AuditsFromJson(data io.Reader) Audits

func (Audits) Etag Uses

func (o Audits) Etag() string

func (Audits) ToJson Uses

func (o Audits) ToJson() string

type AuthData Uses

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 Uses

func AuthDataFromJson(data io.Reader) *AuthData

func (*AuthData) IsExpired Uses

func (ad *AuthData) IsExpired() bool

func (*AuthData) IsValid Uses

func (ad *AuthData) IsValid() *AppError

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

func (*AuthData) PreSave Uses

func (ad *AuthData) PreSave()

func (*AuthData) ToJson Uses

func (ad *AuthData) ToJson() string

type AuthorizeRequest Uses

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 Uses

func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest

func (*AuthorizeRequest) IsValid Uses

func (ar *AuthorizeRequest) IsValid() *AppError

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

func (*AuthorizeRequest) ToJson Uses

func (ar *AuthorizeRequest) ToJson() string

type AutocompleteArg Uses

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 Uses

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

Equals method checks if argument is the same.

func (*AutocompleteArg) UnmarshalJSON Uses

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

UnmarshalJSON will unmarshal argument

type AutocompleteArgType Uses

type AutocompleteArgType string

AutocompleteArgType describes autocomplete argument type

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

Argument types

type AutocompleteData Uses

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 Uses

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

AutocompleteDataFromJSON decodes AutocompleteData struct from the json

func NewAutocompleteData Uses

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

NewAutocompleteData returns new Autocomplete data.

func (*AutocompleteData) AddCommand Uses

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

AddCommand adds a subcommand to the autocomplete data.

func (*AutocompleteData) AddDynamicListArgument Uses

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

AddDynamicListArgument adds positional AutocompleteArgTypeDynamicList argument to the command.

func (*AutocompleteData) AddNamedDynamicListArgument Uses

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

AddNamedDynamicListArgument adds named AutocompleteArgTypeDynamicList argument to the command.

func (*AutocompleteData) AddNamedStaticListArgument Uses

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

AddNamedStaticListArgument adds named AutocompleteArgTypeStaticList argument to the command.

func (*AutocompleteData) AddNamedTextArgument Uses

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

AddNamedTextArgument adds named AutocompleteArgTypeText argument to the command.

func (*AutocompleteData) AddStaticListArgument Uses

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

AddStaticListArgument adds positional AutocompleteArgTypeStaticList argument to the command.

func (*AutocompleteData) AddTextArgument Uses

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

AddTextArgument adds positional AutocompleteArgTypeText argument to the command.

func (*AutocompleteData) Equals Uses

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

Equals method checks if command is the same.

func (*AutocompleteData) IsValid Uses

func (ad *AutocompleteData) IsValid() error

IsValid method checks if autocomplete data is valid.

func (*AutocompleteData) ToJSON Uses

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

ToJSON encodes AutocompleteData struct to the json

func (*AutocompleteData) UpdateRelativeURLsForPluginCommands Uses

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

UpdateRelativeURLsForPluginCommands method updates relative urls for plugin commands

type AutocompleteDynamicListArg Uses

type AutocompleteDynamicListArg struct {
    FetchURL string

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

type AutocompleteListItem Uses

type AutocompleteListItem struct {
    Item     string
    Hint     string
    HelpText string

AutocompleteListItem describes an item in the AutocompleteStaticListArg.

func AutocompleteStaticListItemsFromJSON Uses

func AutocompleteStaticListItemsFromJSON(data io.Reader) []AutocompleteListItem

AutocompleteStaticListItemsFromJSON returns list of AutocompleteStaticListItem from json.

type AutocompleteStaticListArg Uses

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 Uses

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 Uses

func AutocompleteSuggestionsFromJSON(data io.Reader) []AutocompleteSuggestion

AutocompleteSuggestionsFromJSON returns list of AutocompleteSuggestions from json.

type AutocompleteTextArg Uses

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 Uses

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 Uses

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

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

func (*BaseMarketplacePlugin) DecodeSignature Uses

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

DecodeSignature Decodes signature and returns ReadSeeker.

type BleveSettings Uses

type BleveSettings struct {
    IndexDir                      *string
    EnableIndexing                *bool
    EnableSearching               *bool
    EnableAutocomplete            *bool
    BulkIndexingTimeWindowSeconds *int

func (*BleveSettings) SetDefaults Uses

func (bs *BleveSettings) SetDefaults()

type Bot Uses

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 Uses

func BotFromJson(data io.Reader) *Bot

BotFromJson deserializes a bot from json.

func BotFromUser Uses

func BotFromUser(u *User) *Bot

BotFromUser returns a bot model given a user model

func (*Bot) Clone Uses

func (b *Bot) Clone() *Bot

Clone returns a shallow copy of the bot.

func (*Bot) Etag Uses

func (b *Bot) Etag() string

Etag generates an etag for caching.

func (*Bot) IsValid Uses

func (b *Bot) IsValid() *AppError

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

func (*Bot) Patch Uses

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

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

func (*Bot) PreSave Uses

func (b *Bot) PreSave()

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

func (*Bot) PreUpdate Uses

func (b *Bot) PreUpdate()

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

func (*Bot) ToJson Uses

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

ToJson serializes the bot to json.

func (*Bot) Trace Uses

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

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

type BotGetOptions Uses

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 Uses

type BotList []*Bot

BotList is a list of bots.

func BotListFromJson Uses

func BotListFromJson(data io.Reader) BotList

BotListFromJson deserializes a list of bots from json.

func (*BotList) Etag Uses

func (l *BotList) Etag() string

Etag computes the etag for a list of bots.

func (*BotList) ToJson Uses

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

ToJson serializes a list of bots to json.

type BotPatch Uses

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 Uses

func BotPatchFromJson(data io.Reader) *BotPatch

BotPatchFromJson deserializes a bot patch from json.

func (*BotPatch) ToJson Uses

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

ToJson serializes the bot patch to json.

type BundleInfo Uses

type BundleInfo struct {
    Path string

    Manifest      *Manifest
    ManifestPath  string
    ManifestError error

func BundleInfoForPath Uses

func BundleInfoForPath(path string) *BundleInfo

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

func (*BundleInfo) WrapLogger Uses

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

type Channel Uses

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 Uses

func ChannelFromJson(data io.Reader) *Channel

func ChannelSliceFromJson Uses

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

func (*Channel) AddProp Uses

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

func (*Channel) DeepCopy Uses

func (o *Channel) DeepCopy() *Channel

func (*Channel) Etag Uses

func (o *Channel) Etag() string

func (*Channel) GetOtherUserIdForDM Uses

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

func (*Channel) IsGroupConstrained Uses

func (o *Channel) IsGroupConstrained() bool

func (*Channel) IsGroupOrDirect Uses

func (o *Channel) IsGroupOrDirect() bool

func (*Channel) IsOpen Uses

func (o *Channel) IsOpen() bool

func (*Channel) IsValid Uses

func (o *Channel) IsValid() *AppError

func (*Channel) MakeNonNil Uses

func (o *Channel) MakeNonNil()

func (*Channel) Patch Uses

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

func (*Channel) PreSave Uses

func (o *Channel) PreSave()

func (*Channel) PreUpdate Uses

func (o *Channel) PreUpdate()

func (*Channel) ToJson Uses

func (o *Channel) ToJson() string

type ChannelCounts Uses

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

func ChannelCountsFromJson Uses

func ChannelCountsFromJson(data io.Reader) *ChannelCounts

func (*ChannelCounts) Etag Uses

func (o *ChannelCounts) Etag() string

func (*ChannelCounts) ToJson Uses

func (o *ChannelCounts) ToJson() string

type ChannelData Uses

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

func ChannelDataFromJson Uses

func ChannelDataFromJson(data io.Reader) *ChannelData

func (*ChannelData) Etag Uses

func (o *ChannelData) Etag() string

func (*ChannelData) ToJson Uses

func (o *ChannelData) ToJson() string

type ChannelForExport Uses

type ChannelForExport struct {
    TeamName   string
    SchemeName *string

type ChannelList Uses

type ChannelList []*Channel

func ChannelListFromJson Uses

func ChannelListFromJson(data io.Reader) *ChannelList

func (*ChannelList) Etag Uses

func (o *ChannelList) Etag() string

func (*ChannelList) ToJson Uses

func (o *ChannelList) ToJson() string

type ChannelListWithTeamData Uses

type ChannelListWithTeamData []*ChannelWithTeamData

func ChannelListWithTeamDataFromJson Uses

func ChannelListWithTeamDataFromJson(data io.Reader) *ChannelListWithTeamData

func (*ChannelListWithTeamData) Etag Uses

func (o *ChannelListWithTeamData) Etag() string

func (*ChannelListWithTeamData) ToJson Uses

func (o *ChannelListWithTeamData) ToJson() string

type ChannelMember Uses

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 Uses

func ChannelMemberFromJson(data io.Reader) *ChannelMember

func (*ChannelMember) GetRoles Uses

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

func (*ChannelMember) IsValid Uses

func (o *ChannelMember) IsValid() *AppError

func (*ChannelMember) PreSave Uses

func (o *ChannelMember) PreSave()

func (*ChannelMember) PreUpdate Uses

func (o *ChannelMember) PreUpdate()

func (*ChannelMember) ToJson Uses

func (o *ChannelMember) ToJson() string

type ChannelMemberCountByGroup Uses

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 Uses

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

type ChannelMemberForExport Uses

type ChannelMemberForExport struct {
    ChannelName string
    Username    string

type ChannelMemberHistory Uses

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

type ChannelMemberHistoryResult Uses

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 Uses

type ChannelMembers []ChannelMember

func ChannelMembersFromJson Uses

func ChannelMembersFromJson(data io.Reader) *ChannelMembers

func (*ChannelMembers) ToJson Uses

func (o *ChannelMembers) ToJson() string

type ChannelMentionMap Uses

type ChannelMentionMap map[string]string

func ChannelMentionMapFromURLValues Uses

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

func (ChannelMentionMap) ToURLValues Uses

func (m ChannelMentionMap) ToURLValues() url.Values

type ChannelModeratedRole Uses

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

type ChannelModeratedRoles Uses

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

type ChannelModeratedRolesPatch Uses

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

type ChannelModeration Uses

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

func ChannelModerationsFromJson Uses

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

type ChannelModerationPatch Uses

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

func ChannelModerationsPatchFromJson Uses

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

type ChannelPatch Uses

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 Uses

func ChannelPatchFromJson(data io.Reader) *ChannelPatch

func (*ChannelPatch) ToJson Uses

func (o *ChannelPatch) ToJson() string

type ChannelSearch Uses

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 Uses

func ChannelSearchFromJson(data io.Reader) *ChannelSearch

ChannelSearchFromJson will decode the input and return a Channel

func (*ChannelSearch) ToJson Uses

func (c *ChannelSearch) ToJson() string

ToJson convert a Channel to a json string

type ChannelSearchOpts Uses

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 Uses

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 Uses

func ChannelStatsFromJson(data io.Reader) *ChannelStats

func (*ChannelStats) ToJson Uses

func (o *ChannelStats) ToJson() string

type ChannelUnread Uses

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 Uses

func ChannelUnreadFromJson(data io.Reader) *ChannelUnread

func (*ChannelUnread) ToJson Uses

func (o *ChannelUnread) ToJson() string

type ChannelUnreadAt Uses

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 Uses

func ChannelUnreadAtFromJson(data io.Reader) *ChannelUnreadAt

func (*ChannelUnreadAt) ToJson Uses

func (o *ChannelUnreadAt) ToJson() string

type ChannelView Uses

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

func ChannelViewFromJson Uses

func ChannelViewFromJson(data io.Reader) *ChannelView

func (*ChannelView) ToJson Uses

func (o *ChannelView) ToJson() string

type ChannelViewResponse Uses

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

func ChannelViewResponseFromJson Uses

func ChannelViewResponseFromJson(data io.Reader) *ChannelViewResponse

func (*ChannelViewResponse) ToJson Uses

func (o *ChannelViewResponse) ToJson() string

type ChannelWithTeamData Uses

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

type ChannelsWithCount Uses

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

func ChannelsWithCountFromJson Uses

func ChannelsWithCountFromJson(data io.Reader) *ChannelsWithCount

func (*ChannelsWithCount) ToJson Uses

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

type Client4 Uses

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 Uses

func NewAPIv4Client(url string) *Client4

func NewAPIv4SocketClient Uses

func NewAPIv4SocketClient(socketPath string) *Client4

func (*Client4) AddChannelMember Uses

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

AddChannelMember adds user to channel and return a channel member.

func (*Client4) AddChannelMemberWithRootId Uses

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 Uses

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

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

func (*Client4) AddTeamMemberFromInvite Uses

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 Uses

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 Uses

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 Uses

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

AssignBot assigns the given bot to the given user

func (*Client4) AttachDeviceId Uses

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

AttachDeviceId attaches a mobile device ID to the current session.

func (*Client4) AuthorizeOAuthApp Uses

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 Uses

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

AutocompleteChannelsForTeam will return an ordered list of channels autocomplete suggestions.

func (*Client4) AutocompleteChannelsForTeamForSearch Uses

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

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

func (*Client4) AutocompleteEmoji Uses

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

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

func (*Client4) AutocompleteUsers Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Client4) ChannelMembersMinusGroupMembers Uses

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

func (*Client4) CheckIntegrity Uses

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

CheckIntegrity performs a database integrity check.

func (*Client4) CheckUserMfa Uses

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 Uses

func (c *Client4) ClearOAuthToken()

func (*Client4) ClearServerBusy Uses

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

ClearServerBusy will mark the server as not busy.

func (*Client4) ConvertBotToUser Uses

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

ConvertBotToUser converts a bot user to a user.

func (*Client4) ConvertChannelToPrivate Uses

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

ConvertChannelToPrivate converts public to private channel.

func (*Client4) ConvertUserToBot Uses

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

ConvertUserToBot converts a user to a bot user.

func (*Client4) CreateBot Uses

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

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

func (*Client4) CreateChannel Uses

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

CreateChannel creates a channel based on the provided channel struct.

func (*Client4) CreateCommand Uses

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

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

func (*Client4) CreateComplianceReport Uses

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

CreateComplianceReport creates an incoming webhook for a channel.

func (*Client4) CreateDirectChannel Uses

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 Uses

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 Uses

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

CreateGroupChannel creates a group message channel based on userIds provided.

func (*Client4) CreateIncomingWebhook Uses

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

CreateIncomingWebhook creates an incoming webhook for a channel.

func (*Client4) CreateJob Uses

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

CreateJob creates a job based on the provided job struct.

func (*Client4) CreateOAuthApp Uses

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 Uses

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

CreateOutgoingWebhook creates an outgoing webhook for a team or channel.

func (*Client4) CreatePost Uses

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

CreatePost creates a post based on the provided post struct.

func (*Client4) CreatePostEphemeral Uses

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 Uses

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

CreateScheme creates a new Scheme.

func (*Client4) CreateSidebarCategoryForTeamForUser Uses

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

func (*Client4) CreateTeam Uses

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

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

func (*Client4) CreateTermsOfService Uses

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

CreateTermsOfService creates new terms of service.

func (*Client4) CreateUser Uses

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

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

func (*Client4) CreateUserAccessToken Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Client4) DeauthorizeOAuthApp Uses

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 Uses

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

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

func (*Client4) DeleteBrandImage Uses

func (c *Client4) DeleteBrandImage() *Response

DeleteBrandImage deletes the brand image for the system.

func (*Client4) DeleteChannel Uses

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

DeleteChannel deletes channel based on the provided channel id string.

func (*Client4) DeleteCommand Uses

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

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

func (*Client4) DeleteEmoji Uses

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

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

func (*Client4) DeleteIncomingWebhook Uses

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

DeleteIncomingWebhook deletes and Incoming Webhook given the hook ID.

func (*Client4) DeleteOAuthApp Uses

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

DeleteOAuthApp deletes a registered OAuth 2.0 client application.

func (*Client4) DeleteOutgoingWebhook Uses

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

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

func (*Client4) DeletePost Uses

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

DeletePost deletes a post from the provided post id string.

func (*Client4) DeletePreferences Uses

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

DeletePreferences deletes the user's preferences.

func (*Client4) DeleteReaction Uses

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

DeleteReaction deletes reaction of a user in a post.

func (*Client4) DeleteSamlIdpCertificate Uses

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 Uses

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 Uses

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 Uses

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

DeleteScheme deletes a single scheme by ID.

func (*Client4) DeleteUser Uses

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 Uses

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

DemoteUserToGuest convert a regular user into a guest

func (*Client4) DisableBot Uses

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

DisableBot disables the given bot in the system.

func (*Client4) DisablePlugin Uses

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


func (*Client4) DisableUserAccessToken Uses

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 Uses

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

func (*Client4) DoApiGet Uses

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

func (*Client4) DoApiPost Uses

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

func (*Client4) DoApiPut Uses

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

func (*Client4) DoApiRequest Uses

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

func (*Client4) DoEmojiUploadFile Uses

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

func (*Client4) DoPostAction Uses

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

DoPostAction performs a post action.

func (*Client4) DoPostActionWithCookie Uses

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

DoPostActionWithCookie performs a post action with extra arguments

func (*Client4) DoUploadFile Uses

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

func (*Client4) DoUploadImportTeam Uses

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

func (*Client4) DownloadComplianceReport Uses

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

DownloadComplianceReport returns a full compliance report as a file.

func (*Client4) DownloadFile Uses

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 Uses

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

DownloadFilePreview gets the bytes for a file by id.

func (*Client4) DownloadFileThumbnail Uses

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 Uses

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

DownloadJob downloads the results of the job

func (*Client4) EnableBot Uses

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

EnableBot disables the given bot in the system.

func (*Client4) EnablePlugin Uses

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


func (*Client4) EnableUserAccessToken Uses

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 Uses

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

ExecuteCommand executes a given slash command.

func (*Client4) ExecuteCommandWithTeam Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

GetAllTeams returns all teams based on permissions.

func (*Client4) GetAllTeamsWithTotalCount Uses

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

GetAllTeamsWithTotalCount returns all teams based on permissions.

func (*Client4) GetAnalyticsOld Uses

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 Uses

func (c *Client4) GetAnalyticsRoute() string

func (*Client4) GetAudits Uses

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 Uses

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 Uses

func (c *Client4) GetBleveRoute() string

func (*Client4) GetBot Uses

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

GetBot fetches the given, undeleted bot.

func (*Client4) GetBotIconImage Uses

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

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

func (*Client4) GetBotIncludeDeleted Uses

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

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

func (*Client4) GetBotRoute Uses

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

func (*Client4) GetBots Uses

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

GetBots fetches the given page of bots, excluding deleted.

func (*Client4) GetBotsIncludeDeleted Uses

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

GetBotsIncludeDeleted fetches the given page of bots, including deleted.

func (*Client4) GetBotsOrphaned Uses

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 Uses

func (c *Client4) GetBotsRoute() string

func (*Client4) GetBrandImage Uses

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

GetBrandImage retrieves the previously uploaded brand image.

func (*Client4) GetBrandRoute Uses

func (c *Client4) GetBrandRoute() string

func (*Client4) GetBulkReactions Uses

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

FetchBulkReactions returns a map of postIds and corresponding reactions

func (*Client4) GetCacheRoute Uses

func (c *Client4) GetCacheRoute() string

func (*Client4) GetChannel Uses

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

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

func (*Client4) GetChannelByName Uses

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 Uses

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 Uses

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 Uses

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

func (*Client4) GetChannelByNameIncludeDeleted Uses

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 Uses

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

func (*Client4) GetChannelMember Uses

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

GetChannelMember gets a channel member.

func (*Client4) GetChannelMemberCountsByGroup Uses

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

func (*Client4) GetChannelMemberRoute Uses

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

func (*Client4) GetChannelMembers Uses

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

GetChannelMembers gets a page of channel members.

func (*Client4) GetChannelMembersByIds Uses

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 Uses

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 Uses

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

func (*Client4) GetChannelMembersTimezones Uses

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

GetChannelMembersTimezones gets a list of timezones for a channel.

func (*Client4) GetChannelModerations Uses

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

func (*Client4) GetChannelRoute Uses

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

func (*Client4) GetChannelSchemeRoute Uses

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

func (*Client4) GetChannelStats Uses

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

GetChannelStats returns statistics for a channel.

func (*Client4) GetChannelUnread Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

func (*Client4) GetChannelsForTeamRoute Uses

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

func (*Client4) GetChannelsRoute Uses

func (c *Client4) GetChannelsRoute() string

func (*Client4) GetClusterRoute Uses

func (c *Client4) GetClusterRoute() string

func (*Client4) GetClusterStatus Uses

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

GetClusterStatus returns the status of all the configured cluster nodes.

func (*Client4) GetCommandById Uses

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

GetCommandById will retrieve a command by id.

func (*Client4) GetCommandMoveRoute Uses

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

func (*Client4) GetCommandRoute Uses

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

func (*Client4) GetCommandsRoute Uses

func (c *Client4) GetCommandsRoute() string

func (*Client4) GetComplianceReport Uses

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

GetComplianceReport returns a compliance report.

func (*Client4) GetComplianceReportRoute Uses

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

func (*Client4) GetComplianceReports Uses

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

GetComplianceReports returns list of compliance reports.

func (*Client4) GetComplianceReportsRoute Uses

func (c *Client4) GetComplianceReportsRoute() string

func (*Client4) GetConfig Uses

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

GetConfig will retrieve the server config with some sanitized items.

func (*Client4) GetConfigRoute Uses

func (c *Client4) GetConfigRoute() string

func (*Client4) GetDataRetentionPolicy Uses

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

GetDataRetentionPolicy will get the current server data retention policy details.

func (*Client4) GetDataRetentionRoute Uses

func (c *Client4) GetDataRetentionRoute() string

func (*Client4) GetDatabaseRoute Uses

func (c *Client4) GetDatabaseRoute() string

func (*Client4) GetDefaultProfileImage Uses

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

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

func (*Client4) GetDeletedChannelsForTeam Uses

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 Uses

func (c *Client4) GetElasticsearchRoute() string

func (*Client4) GetEmoji Uses

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

GetEmoji returns a custom emoji based on the emojiId string.

func (*Client4) GetEmojiByName Uses

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

GetEmojiByName returns a custom emoji based on the name string.

func (*Client4) GetEmojiByNameRoute Uses

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

func (*Client4) GetEmojiImage Uses

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

GetEmojiImage returns the emoji image.

func (*Client4) GetEmojiList Uses

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

GetEmojiList returns a page of custom emoji on the system.

func (*Client4) GetEmojiRoute Uses

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

func (*Client4) GetEmojisRoute Uses

func (c *Client4) GetEmojisRoute() string

func (*Client4) GetEnvironmentConfig Uses

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 Uses

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

GetFile gets the bytes for a file by id.

func (*Client4) GetFileInfo Uses

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

GetFileInfo gets all the file info objects.

func (*Client4) GetFileInfosForPost Uses

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 Uses

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

GetFilePreview gets the bytes for a file by id.

func (*Client4) GetFileRoute Uses

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

func (*Client4) GetFileThumbnail Uses

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

GetFileThumbnail gets the bytes for a file by id.

func (*Client4) GetFilesRoute Uses

func (c *Client4) GetFilesRoute() string

func (*Client4) GetFlaggedPostsForUser Uses

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 Uses

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 Uses

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 Uses

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

func (*Client4) GetGroupRoute Uses

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

func (*Client4) GetGroupStats Uses

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

GetGroupStats retrieves stats for a Mattermost Group

func (*Client4) GetGroupSyncable Uses

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

func (*Client4) GetGroupSyncableRoute Uses

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

func (*Client4) GetGroupSyncables Uses

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

func (*Client4) GetGroupSyncablesRoute Uses

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

func (*Client4) GetGroups Uses

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

GetGroups retrieves Mattermost Groups

func (*Client4) GetGroupsAssociatedToChannelsByTeam Uses

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 Uses

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

GetGroupsByChannel retrieves the Mattermost Groups associated with a given channel

func (*Client4) GetGroupsByTeam Uses

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

GetGroupsByTeam retrieves the Mattermost Groups associated with a given team

func (*Client4) GetGroupsByUserId Uses

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

GetGroupsByUserId retrieves Mattermost Groups for a user

func (*Client4) GetGroupsRoute Uses

func (c *Client4) GetGroupsRoute() string

func (*Client4) GetIncomingWebhook Uses

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

GetIncomingWebhook returns an Incoming webhook given the hook ID.

func (*Client4) GetIncomingWebhookRoute Uses

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

func (*Client4) GetIncomingWebhooks Uses

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 Uses

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 Uses

func (c *Client4) GetIncomingWebhooksRoute() string

func (*Client4) GetJob Uses

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

GetJob gets a single job.

func (*Client4) GetJobs Uses

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 Uses

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 Uses

func (c *Client4) GetJobsRoute() string

func (*Client4) GetKnownUsers Uses

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

func (*Client4) GetLdapGroups Uses

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

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

func (*Client4) GetLdapRoute Uses

func (c *Client4) GetLdapRoute() string

func (*Client4) GetLicenseRoute Uses

func (c *Client4) GetLicenseRoute() string

func (*Client4) GetLogs Uses

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

GetLogs page of logs as a string array.

func (*Client4) GetMarketplacePlugins Uses

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 Uses

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

GetMe returns the logged in user.

func (*Client4) GetNewUsersInTeam Uses

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) GetOAuthAccessToken Uses

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

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

func (*Client4) GetOAuthApp Uses

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 Uses

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 Uses

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

func (*Client4) GetOAuthApps Uses

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 Uses

func (c *Client4) GetOAuthAppsRoute() string

func (*Client4) GetOldClientConfig Uses

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 Uses

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 Uses

func (c *Client4) GetOpenGraphRoute() string

func (*Client4) GetOutgoingWebhook Uses

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

GetOutgoingWebhook outgoing webhooks on the system requested by Hook Id.

func (*Client4) GetOutgoingWebhookRoute Uses

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

func (*Client4) GetOutgoingWebhooks Uses

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 Uses

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 Uses

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 Uses

func (c *Client4) GetOutgoingWebhooksRoute() string

func (*Client4) GetPing Uses

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 Uses

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

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

func (*Client4) GetPinnedPosts Uses

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

GetPinnedPosts gets a list of pinned posts.

func (*Client4) GetPluginRoute Uses

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

func (*Client4) GetPluginStatuses Uses

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 Uses

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 Uses

func (c *Client4) GetPluginsRoute() string

func (*Client4) GetPost Uses

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

GetPost gets a single post.

func (*Client4) GetPostRoute Uses

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

func (*Client4) GetPostThread Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (c *Client4) GetPostsEphemeralRoute() string

func (*Client4) GetPostsForChannel Uses

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 Uses

func (c *Client4) GetPostsRoute() string

func (*Client4) GetPostsSince Uses

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 Uses

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 Uses

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

GetPreferences returns the user's preferences.

func (*Client4) GetPreferencesByCategory Uses

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

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

func (*Client4) GetPreferencesRoute Uses

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

func (*Client4) GetPrivateChannelsForTeam Uses

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 Uses

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

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

func (*Client4) GetPublicChannelsByIdsForTeam Uses

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 Uses

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 Uses

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

func (*Client4) GetReactions Uses

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

GetReactions returns a list of reactions to a post.

func (*Client4) GetReactionsRoute Uses

func (c *Client4) GetReactionsRoute() string

func (*Client4) GetRecentlyActiveUsersInTeam Uses

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 Uses

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 Uses

func (c *Client4) GetRedirectLocationRoute() string

func (*Client4) GetRole Uses

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

GetRole gets a single role by ID.

func (*Client4) GetRoleByName Uses

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

GetRoleByName gets a single role by Name.

func (*Client4) GetRolesByNames Uses

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

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

func (*Client4) GetRolesRoute Uses

func (c *Client4) GetRolesRoute() string

func (*Client4) GetSamlCertificateStatus Uses

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

GetSamlCertificateStatus returns metadata for the SAML configuration.

func (*Client4) GetSamlMetadata Uses

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

GetSamlMetadata returns metadata for the SAML configuration.

func (*Client4) GetSamlMetadataFromIdp Uses

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

func (*Client4) GetSamlRoute Uses

func (c *Client4) GetSamlRoute() string

func (*Client4) GetScheme Uses

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

GetScheme gets a single scheme by ID.

func (*Client4) GetSchemeRoute Uses

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

func (*Client4) GetSchemes Uses

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 Uses

func (c *Client4) GetSchemesRoute() string

func (*Client4) GetServerBusy Uses

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 Uses

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 Uses

func (c *Client4) GetServerBusyRoute() string

func (*Client4) GetSessions Uses

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 Uses

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

func (*Client4) GetSidebarCategoryForTeamForUser Uses

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

func (*Client4) GetSidebarCategoryOrderForTeamForUser Uses

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

func (*Client4) GetSortedEmojiList Uses

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 Uses

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

GetSupportedTimezone returns a page of supported timezones on the system.

func (*Client4) GetSystemRoute Uses

func (c *Client4) GetSystemRoute() string

func (*Client4) GetTeam Uses

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

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

func (*Client4) GetTeamAutoCompleteCommandsRoute Uses

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

func (*Client4) GetTeamByName Uses

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

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

func (*Client4) GetTeamByNameRoute Uses

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

func (*Client4) GetTeamIcon Uses

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

GetTeamIcon gets the team icon of the team.

func (*Client4) GetTeamImportRoute Uses

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

func (*Client4) GetTeamInviteInfo Uses

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

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

func (*Client4) GetTeamMember Uses

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 Uses

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

func (*Client4) GetTeamMembers Uses

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 Uses

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 Uses

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

GetTeamMembersForUser returns the team members for a user.

func (*Client4) GetTeamMembersRoute Uses

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

func (*Client4) GetTeamMembersSortAndWithoutDeletedUsers Uses

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 Uses

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

func (*Client4) GetTeamSchemeRoute Uses

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

func (*Client4) GetTeamStats Uses

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 Uses

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

func (*Client4) GetTeamUnread Uses

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 Uses

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 Uses

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 Uses

func (c *Client4) GetTeamsRoute() string

func (*Client4) GetTeamsUnreadForUser Uses

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 Uses

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

GetTermsOfService fetches the latest terms of service

func (*Client4) GetTermsOfServiceRoute Uses

func (c *Client4) GetTermsOfServiceRoute() string

func (*Client4) GetTestEmailRoute Uses

func (c *Client4) GetTestEmailRoute() string

func (*Client4) GetTestS3Route Uses

func (c *Client4) GetTestS3Route() string

func (*Client4) GetTestSiteURLRoute Uses

func (c *Client4) GetTestSiteURLRoute() string

func (*Client4) GetTimezonesRoute Uses

func (c *Client4) GetTimezonesRoute() string

func (*Client4) GetTotalUsersStats Uses

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

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

func (*Client4) GetTotalUsersStatsRoute Uses

func (c *Client4) GetTotalUsersStatsRoute() string

func (*Client4) GetUser Uses

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

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

func (*Client4) GetUserAccessToken Uses

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 Uses

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

func (*Client4) GetUserAccessTokens Uses

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 Uses

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 Uses

func (c *Client4) GetUserAccessTokensRoute() string

func (*Client4) GetUserAudits Uses

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 Uses

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

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

func (*Client4) GetUserByEmailRoute Uses

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

func (*Client4) GetUserByUsername Uses

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

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

func (*Client4) GetUserByUsernameRoute Uses

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

func (*Client4) GetUserCategoryRoute Uses

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

func (*Client4) GetUserRoute Uses

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

func (*Client4) GetUserStatus Uses

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

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

func (*Client4) GetUserStatusRoute Uses

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

func (*Client4) GetUserStatusesRoute Uses

func (c *Client4) GetUserStatusesRoute() string

func (*Client4) GetUserTermsOfService Uses

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 Uses

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

func (*Client4) GetUsers Uses

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 Uses

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 Uses

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

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

func (*Client4) GetUsersByIdsWithOptions Uses

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 Uses

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

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

func (*Client4) GetUsersInChannel Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (c *Client4) GetUsersRoute() string

func (*Client4) GetUsersStatusesByIds Uses

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

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

func (*Client4) GetUsersWithoutTeam Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

func (*Client4) InvalidateCaches Uses

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

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

func (*Client4) InvalidateEmailInvites Uses

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

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

func (*Client4) InviteGuestsToTeam Uses

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 Uses

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 Uses

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

InviteUsersToTeam invite users by email to the team.

func (*Client4) InviteUsersToTeamGracefully Uses

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

InviteUsersToTeam invite users by email to the team.

func (*Client4) LinkGroupSyncable Uses

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

func (*Client4) LinkLdapGroup Uses

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 Uses

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

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

func (*Client4) ListCommandAutocompleteSuggestions Uses

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

ListCommandAutocompleteSuggestions will retrieve a list of suggestions for a userInput.

func (*Client4) ListCommands Uses

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

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

func (*Client4) Login Uses

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 Uses

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

LoginById authenticates a user by user id and password.

func (*Client4) LoginByLdap Uses

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

LoginByLdap authenticates a user by LDAP id and password.

func (*Client4) LoginWithDevice Uses

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 Uses

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

LoginWithMFA logs a user in with a MFA token

func (*Client4) Logout Uses

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

Logout terminates the current user's session.

func (*Client4) MigrateIdLdap Uses

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

MigrateIdLdap migrates the LDAP enabled users to given attribute

func (*Client4) MockSession Uses

func (c *Client4) MockSession(token string)

MockSession is deprecated in favour of SetToken

func (*Client4) MoveChannel Uses

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

MoveChannel moves the channel to the destination team.

func (*Client4) MoveCommand Uses

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

MoveCommand moves a command to a different team.

func (*Client4) Must Uses

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

Must is a convenience function used for testing.

func (*Client4) OpenGraph Uses

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 Uses

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 Uses

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

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

func (*Client4) PatchChannel Uses

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

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

func (*Client4) PatchChannelModerations Uses

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

func (*Client4) PatchConfig Uses

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

func (*Client4) PatchGroup Uses

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

func (*Client4) PatchGroupSyncable Uses

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

func (*Client4) PatchPost Uses

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

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

func (*Client4) PatchRole Uses

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 Uses

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 Uses

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

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

func (*Client4) PatchUser Uses

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 Uses

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

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

func (*Client4) PermanentDeleteTeam Uses

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 Uses

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 Uses

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

PinPost pin a post based on provided post id string.

func (*Client4) PostLog Uses

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 Uses

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

PromoteGuestToUser convert a guest into a regular user

func (*Client4) PublishUserTyping Uses

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 Uses

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

PurgeBleveIndexes immediately deletes all Bleve indexes.

func (*Client4) PurgeElasticsearchIndexes Uses

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

PurgeElasticsearchIndexes immediately deletes all Elasticsearch indexes.

func (*Client4) RegenCommandToken Uses

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

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

func (*Client4) RegenOutgoingHookToken Uses

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

RegenOutgoingHookToken regenerate the outgoing webhook token.

func (*Client4) RegenerateOAuthAppSecret Uses

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

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

func (*Client4) RegenerateTeamInviteId Uses

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

RegenerateTeamInviteId requests a new invite ID to be generated.

func (*Client4) RegisterTermsOfServiceAction Uses

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 Uses

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

ReloadConfig will reload the server configuration.

func (*Client4) RemoveLicenseFile Uses

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 Uses

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


func (*Client4) RemoveTeamIcon Uses

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

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

func (*Client4) RemoveTeamMember Uses

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

RemoveTeamMember will remove a user from a team.

func (*Client4) RemoveUserFromChannel Uses

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 Uses

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

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

func (*Client4) ResetPassword Uses

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

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

func (*Client4) RestoreChannel Uses

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

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

func (*Client4) RestoreTeam Uses

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

RestoreTeam restores a previously deleted team.

func (*Client4) RevokeAllSessions Uses

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

RevokeAllSessions revokes all sessions for the provided user id string.

func (*Client4) RevokeSession Uses

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 Uses

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

RevokeAllSessions revokes all sessions for all the users.

func (*Client4) RevokeUserAccessToken Uses

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 Uses

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 Uses

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

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

func (*Client4) SearchAllChannelsPaged Uses

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 Uses

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 Uses

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 Uses

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

SearchEmoji returns a list of emoji matching some search criteria.

func (*Client4) SearchGroupChannels Uses

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 Uses

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

SearchPosts returns any posts with matching terms string.

func (*Client4) SearchPostsWithMatches Uses

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

SearchPostsWithMatches returns any posts with matching terms string, including.

func (*Client4) SearchPostsWithParams Uses

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

SearchPostsWithParams returns any posts with matching terms string.

func (*Client4) SearchTeams Uses

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

SearchTeams returns teams matching the provided search term.

func (*Client4) SearchTeamsPaged Uses

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 Uses

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

SearchUserAccessTokens returns user access tokens matching the provided search term.

func (*Client4) SearchUsers Uses

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

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

func (*Client4) SendPasswordResetEmail Uses

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 Uses

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 Uses

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 Uses

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

SetBotIconImage sets LHS bot icon image.

func (*Client4) SetDefaultProfileImage Uses

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

SetDefaultProfileImage resets the profile image to a default generated one.

func (*Client4) SetOAuthToken Uses

func (c *Client4) SetOAuthToken(token string)

func (*Client4) SetPostUnread Uses

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 Uses

func (c *Client4) SetProfileImage(userId string, data []byte) (bool, *Response)

SetProfileImage sets profile image of the user.

func (*Client4) SetServerBusy Uses

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 Uses

func (c *Client4) SetTeamIcon(teamId string, data []byte) (bool, *Response)

SetTeamIcon sets team icon of the team.

func (*Client4) SetToken Uses

func (c *Client4) SetToken(token string)

func (*Client4) SoftDeleteTeam Uses

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

SoftDeleteTeam deletes the team softly (archive only, not permanent delete).

func (*Client4) SubmitInteractiveDialog Uses

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 Uses

func (c *Client4) SwitchAccountType(switchRequest *SwitchRequest) (string, *Response)

SwitchAccountType changes a user's login type from one type to another.

func (*Client4) SyncLdap Uses

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

SyncLdap will force a sync with the configured LDAP server.

func (*Client4) TeamExists Uses

func (c *Client4) TeamExists(name, etag string) (bool, *Response)

TeamExists returns true or false if the team exist or not.

func (*Client4) TeamMembersMinusGroupMembers Uses

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

func (*Client4) TestElasticsearch Uses

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 Uses

func (c *Client4) TestEmail(config *Config) (bool, *Response)

TestEmail will attempt to connect to the configured SMTP server.

func (*Client4) TestLdap Uses

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 Uses

func (c *Client4) TestS3Connection(config *Config) (bool, *Response)

TestS3Connection will attempt to connect to the AWS S3.

func (*Client4) TestSiteURL Uses

func (c *Client4) TestSiteURL(siteURL string) (bool, *Response)

TestSiteURL will test the validity of a site URL.

func (*Client4) UnlinkGroupSyncable Uses

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

func (*Client4) UnlinkLdapGroup Uses

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

UnlinkLdapGroup deletes the Mattermost group associated with the given LDAP group DN.

func (*Client4) UnpinPost Uses

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

UnpinPost unpin a post based on provided post id string.

func (*Client4)