Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayFromInterface(data interface{}) []string
- func ArrayFromJson(data io.Reader) []string
- func ArrayToJson(objmap []string) string
- func CleanTeamName(s string) string
- func CleanUsername(s string) string
- func ClearMentionTags(post string) string
- func ClusterInfosToJson(objmap []*ClusterInfo) string
- func CommandListToJson(l []*Command) string
- func ComparePassword(hash string, password string) bool
- func CompliancePostHeader() []string
- func EmojiListToJson(emojiList []*Emoji) string
- func Etag(parts ...interface{}) string
- func FileInfosToJson(infos []*FileInfo) string
- func GetAllTasks() *map[string]*ScheduledTask
- func GetDMNameFromIds(userId1, userId2 string) string
- func GetEtagForFileInfos(infos []*FileInfo) string
- func GetImageMimeType(ext string) string
- func GetInfoForBytes(name string, data []byte) (*FileInfo, *AppError)
- func GetMillis() int64
- func GetPreviousVersion(version string) string
- func HashPassword(password string) string
- func IncomingWebhookListToJson(l []*IncomingWebhook) string
- func InitalizePermissions()
- func InitalizeRoles()
- func IsChannelMarkUnreadLevelValid(markUnreadLevel string) bool
- func IsChannelNotifyLevelValid(notifyLevel string) bool
- func IsCurrentVersion(versionToCheck string) bool
- func IsFileExtImage(ext string) bool
- func IsInRole(userRoles string, inRole string) bool
- func IsLower(s string) bool
- func IsOfficalBuild() bool
- func IsPreviousVersionsSupported(versionToCheck string) bool
- func IsReservedTeamName(s string) bool
- func IsSafeLink(link *string) bool
- func IsValidAlphaNum(s string, allowUnderscores bool) bool
- func IsValidChannelIdentifier(s string) bool
- func IsValidEmail(email string) bool
- func IsValidHttpUrl(rawUrl string) bool
- func IsValidHttpsUrl(rawUrl string) bool
- func IsValidTeamName(s string) bool
- func IsValidTurnOrStunServer(rawUri string) bool
- func IsValidUserRoles(userRoles string) bool
- func IsValidUsername(s string) bool
- func IsValidWebsocketUrl(rawUrl string) bool
- func MapFromJson(data io.Reader) map[string]string
- func MapToJson(objmap map[string]string) string
- func NewId() string
- func NewRandomString(length int) string
- func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError)
- func OAuthAppListToJson(l []*OAuthApp) string
- func OAuthAppMapFromJson(data io.Reader) map[string]*OAuthApp
- func OAuthAppMapToJson(a map[string]*OAuthApp) string
- func OutgoingWebhookListToJson(l []*OutgoingWebhook) string
- func ParseHashtags(text string) (string, string)
- func RoleIdsToString(roles []string) string
- func SessionsToJson(o []*Session) string
- func SplitVersion(version string) (int64, int64, int64)
- func StringFromJson(data io.Reader) string
- func StringInterfaceFromJson(data io.Reader) map[string]interface{}
- func StringInterfaceToJson(objmap map[string]interface{}) string
- func StringToJson(s string) string
- func TeamMapFromJson(data io.Reader) map[string]*Team
- func TeamMapToJson(u map[string]*Team) string
- func TeamMembersToJson(o []*TeamMember) string
- func UserListToJson(u []*User) string
- func UserMapFromJson(data io.Reader) map[string]*User
- func UserMapToJson(u map[string]*User) string
- type AccessData
- type AccessResponse
- type AnalyticsRow
- type AnalyticsRows
- type AppError
- type Audit
- type Audits
- type AuthData
- type Channel
- type ChannelCounts
- type ChannelData
- type ChannelList
- type ChannelMember
- type ChannelMembers
- type ChannelStats
- type Client
- func (c *Client) AddChannelMember(id, user_id string) (*Result, *AppError)
- func (c *Client) AddUserToTeam(teamId string, userId string) (*Result, *AppError)
- func (c *Client) AddUserToTeamFromInvite(hash, dataToHash, inviteId string) (*Result, *AppError)
- func (c *Client) AdminResetMfa(userId string) (*Result, *AppError)
- func (c *Client) AdminResetPassword(userId, newPassword string) (*Result, *AppError)
- func (c *Client) AllowOAuth(rspType, clientId, redirect, scope, state string) (*Result, *AppError)
- func (c *Client) AttachDeviceId(deviceId string) (*Result, *AppError)
- func (c *Client) AutocompleteUsersInChannel(term string, channelId string) (*Result, *AppError)
- func (c *Client) AutocompleteUsersInTeam(term string) (*Result, *AppError)
- func (c *Client) CheckMfa(loginId string) (*Result, *AppError)
- func (c *Client) CheckStatusOK(r *http.Response) bool
- func (c *Client) ClearOAuthToken()
- func (c *Client) ClearTeamId()
- func (c *Client) Command(channelId string, command string, suggest bool) (*Result, *AppError)
- func (c *Client) CreateChannel(channel *Channel) (*Result, *AppError)
- func (c *Client) CreateCommand(cmd *Command) (*Result, *AppError)
- func (c *Client) CreateDirectChannel(userId string) (*Result, *AppError)
- func (c *Client) CreateEmoji(emoji *Emoji, image []byte, filename string) (*Emoji, *AppError)
- func (c *Client) CreateIncomingWebhook(hook *IncomingWebhook) (*Result, *AppError)
- func (c *Client) CreateOutgoingWebhook(hook *OutgoingWebhook) (*Result, *AppError)
- func (c *Client) CreatePost(post *Post) (*Result, *AppError)
- func (c *Client) CreateTeam(team *Team) (*Result, *AppError)
- func (c *Client) CreateTeamFromSignup(teamSignup *TeamSignup) (*Result, *AppError)
- func (c *Client) CreateUser(user *User, hash string) (*Result, *AppError)
- func (c *Client) CreateUserFromSignup(user *User, data string, hash string) (*Result, *AppError)
- func (c *Client) CreateUserWithInvite(user *User, hash string, data string, inviteId string) (*Result, *AppError)
- func (c *Client) DeleteChannel(id string) (*Result, *AppError)
- func (c *Client) DeleteCommand(data map[string]string) (*Result, *AppError)
- func (c *Client) DeleteEmoji(id string) (bool, *AppError)
- func (c *Client) DeleteIncomingWebhook(id string) (*Result, *AppError)
- func (c *Client) DeleteOAuthApp(id string) (*Result, *AppError)
- func (c *Client) DeleteOutgoingWebhook(id string) (*Result, *AppError)
- func (c *Client) DeletePost(channelId string, postId string) (*Result, *AppError)
- func (c *Client) DeletePreferences(preferences *Preferences) (bool, *AppError)
- func (c *Client) DoApiGet(url string, data string, etag string) (*http.Response, *AppError)
- func (c *Client) DoApiPost(url string, data string) (*http.Response, *AppError)
- func (c *Client) DoPost(url, data, contentType string) (*http.Response, *AppError)
- func (c *Client) DownloadComplianceReport(id string) (*Result, *AppError)
- func (c *Client) EmailToLDAP(m map[string]string) (*Result, *AppError)
- func (c *Client) EmailToOAuth(m map[string]string) (*Result, *AppError)
- func (c *Client) FindTeamByName(name string) (*Result, *AppError)
- func (c *Client) GenerateMfaSecret() (*Result, *AppError)
- func (c *Client) GetAccessToken(data url.Values) (*Result, *AppError)
- func (c *Client) GetAllAudits() (*Result, *AppError)
- func (c *Client) GetAllPreferences() (*Result, *AppError)
- func (c *Client) GetAllTeamListings() (*Result, *AppError)
- func (c *Client) GetAllTeams() (*Result, *AppError)
- func (c *Client) GetAudits(id string, etag string) (*Result, *AppError)
- func (c *Client) GetChannel(id, etag string) (*Result, *AppError)
- func (c *Client) GetChannelCounts(etag string) (*Result, *AppError)
- func (c *Client) GetChannelMember(channelId string, userId string) (*Result, *AppError)
- func (c *Client) GetChannelNameRoute(channelName string) string
- func (c *Client) GetChannelRoute(channelId string) string
- func (c *Client) GetChannelStats(id string, etag string) (*Result, *AppError)
- func (c *Client) GetChannels(etag string) (*Result, *AppError)
- func (c *Client) GetClientLicenceConfig(etag string) (*Result, *AppError)
- func (c *Client) GetClientProperties() (map[string]string, *AppError)
- func (c *Client) GetClusterStatus() ([]*ClusterInfo, *AppError)
- func (c *Client) GetComplianceReports() (*Result, *AppError)
- func (c *Client) GetConfig() (*Result, *AppError)
- func (c *Client) GetCustomEmojiImageUrl(id string) string
- func (c *Client) GetEmojiRoute() string
- func (c *Client) GetFile(fileId string) (io.ReadCloser, *AppError)
- func (c *Client) GetFileInfo(fileId string) (*FileInfo, *AppError)
- func (c *Client) GetFileInfosForPost(channelId string, postId string, etag string) ([]*FileInfo, *AppError)
- func (c *Client) GetFilePreview(fileId string) (io.ReadCloser, *AppError)
- func (c *Client) GetFileRoute(fileId string) string
- func (c *Client) GetFileThumbnail(fileId string) (io.ReadCloser, *AppError)
- func (c *Client) GetFlaggedPosts(offset int, limit int) (*Result, *AppError)
- func (c *Client) GetGeneralRoute() string
- func (c *Client) GetInitialLoad() (*Result, *AppError)
- func (c *Client) GetLogs() (*Result, *AppError)
- func (c *Client) GetMe(etag string) (*Result, *AppError)
- func (c *Client) GetMoreChannels(etag string) (*Result, *AppError)
- func (c *Client) GetMyChannelMembers() (*Result, *AppError)
- func (c *Client) GetMyTeam(etag string) (*Result, *AppError)
- func (c *Client) GetOAuthAppInfo(clientId string) (*Result, *AppError)
- func (c *Client) GetOAuthAppsByUser() (*Result, *AppError)
- func (c *Client) GetOAuthAuthorizedApps() (*Result, *AppError)
- func (c *Client) GetPing() (map[string]string, *AppError)
- func (c *Client) GetPost(channelId string, postId string, etag string) (*Result, *AppError)
- func (c *Client) GetPosts(channelId string, offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetPostsAfter(channelId string, postid string, offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetPostsBefore(channelId string, postid string, offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetPostsSince(channelId string, time int64) (*Result, *AppError)
- func (c *Client) GetPreference(category string, name string) (*Result, *AppError)
- func (c *Client) GetPreferenceCategory(category string) (*Result, *AppError)
- func (c *Client) GetProfiles(offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetProfilesByIds(userIds []string) (*Result, *AppError)
- func (c *Client) GetProfilesInChannel(channelId string, offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetProfilesInTeam(teamId string, offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetProfilesNotInChannel(channelId string, offset int, limit int, etag string) (*Result, *AppError)
- func (c *Client) GetPublicLink(fileId string) (string, *AppError)
- func (c *Client) GetRecentlyActiveUsers(teamId string) (*Result, *AppError)
- func (c *Client) GetSessions(id string) (*Result, *AppError)
- func (c *Client) GetStatuses() (*Result, *AppError)
- func (c *Client) GetStatusesByIds(userIds []string) (*Result, *AppError)
- func (c *Client) GetSystemAnalytics(name string) (*Result, *AppError)
- func (c *Client) GetTeamAnalytics(teamId, name string) (*Result, *AppError)
- func (c *Client) GetTeamId() string
- func (c *Client) GetTeamMember(teamId string, userId string) (*Result, *AppError)
- func (c *Client) GetTeamMembers(teamId string, offset int, limit int) (*Result, *AppError)
- func (c *Client) GetTeamMembersByIds(teamId string, userIds []string) (*Result, *AppError)
- func (c *Client) GetTeamRoute() string
- func (c *Client) GetTeamStats(teamId string) (*Result, *AppError)
- func (c *Client) GetUser(id string, etag string) (*Result, *AppError)
- func (c *Client) GetUserRequiredRoute(userId string) string
- func (c *Client) GetWebrtcToken() (map[string]string, *AppError)
- func (c *Client) InviteMembers(invites *Invites) (*Result, *AppError)
- func (c *Client) JoinChannel(id string) (*Result, *AppError)
- func (c *Client) JoinChannelByName(name string) (*Result, *AppError)
- func (c *Client) LDAPToEmail(m map[string]string) (*Result, *AppError)
- func (c *Client) LdapSyncNow() (*Result, *AppError)
- func (c *Client) LeaveChannel(id string) (*Result, *AppError)
- func (c *Client) ListCommands() (*Result, *AppError)
- func (c *Client) ListEmoji() ([]*Emoji, *AppError)
- func (c *Client) ListIncomingWebhooks() (*Result, *AppError)
- func (c *Client) ListOutgoingWebhooks() (*Result, *AppError)
- func (c *Client) ListTeamCommands() (*Result, *AppError)
- func (c *Client) LogClient(message string) (bool, *AppError)
- func (c *Client) Login(loginId string, password string) (*Result, *AppError)
- func (c *Client) LoginById(id string, password string) (*Result, *AppError)
- func (c *Client) LoginByLdap(loginId string, password string) (*Result, *AppError)
- func (c *Client) LoginWithDevice(loginId string, password string, deviceId string) (*Result, *AppError)
- func (c *Client) Logout() (*Result, *AppError)
- func (c *Client) MockSession(sessionToken string)
- func (c *Client) Must(result *Result, err *AppError) *Result
- func (c *Client) MustGeneric(result interface{}, err *AppError) interface{}
- func (c *Client) OAuthDeauthorizeApp(clientId string) *AppError
- func (c *Client) OAuthToEmail(m map[string]string) (*Result, *AppError)
- func (c *Client) PostToWebhook(id, payload string) (*Result, *AppError)
- func (c *Client) RecycleDatabaseConnection() (bool, *AppError)
- func (c *Client) RegenCommandToken(data map[string]string) (*Result, *AppError)
- func (c *Client) RegenOutgoingWebhookToken(id string) (*Result, *AppError)
- func (c *Client) RegenerateOAuthAppSecret(clientId string) (*Result, *AppError)
- func (c *Client) RegisterApp(app *OAuthApp) (*Result, *AppError)
- func (c *Client) ReloadConfig() (bool, *AppError)
- func (c *Client) RemoveCertificateFile(filename string) *AppError
- func (c *Client) RemoveChannelMember(id, user_id string) (*Result, *AppError)
- func (c *Client) RemoveUserFromTeam(teamId string, userId string) (*Result, *AppError)
- func (c *Client) ResetPassword(code, newPassword string) (*Result, *AppError)
- func (c *Client) RevokeSession(sessionAltId string) (*Result, *AppError)
- func (c *Client) SamlCertificateStatus(filename string) (map[string]interface{}, *AppError)
- func (c *Client) SaveComplianceReport(job *Compliance) (*Result, *AppError)
- func (c *Client) SaveConfig(config *Config) (*Result, *AppError)
- func (c *Client) SearchPosts(terms string, isOrSearch bool) (*Result, *AppError)
- func (c *Client) SearchUsers(params UserSearch) (*Result, *AppError)
- func (c *Client) SendPasswordReset(email string) (*Result, *AppError)
- func (c *Client) SetActiveChannel(channelId string) (*Result, *AppError)
- func (c *Client) SetOAuthToken(token string)
- func (c *Client) SetPreferences(preferences *Preferences) (*Result, *AppError)
- func (c *Client) SetTeamId(teamId string)
- func (c *Client) SignupTeam(email string, displayName string) (*Result, *AppError)
- func (c *Client) TestEmail(config *Config) (*Result, *AppError)
- func (c *Client) TestLdap(config *Config) (*Result, *AppError)
- func (c *Client) UpdateActive(userId string, active bool) (*Result, *AppError)
- func (c *Client) UpdateChannel(channel *Channel) (*Result, *AppError)
- func (c *Client) UpdateChannelHeader(data map[string]string) (*Result, *AppError)
- func (c *Client) UpdateChannelPurpose(data map[string]string) (*Result, *AppError)
- func (c *Client) UpdateLastViewedAt(channelId string, active bool) (*Result, *AppError)
- func (c *Client) UpdateMfa(activate bool, token string) (*Result, *AppError)
- func (c *Client) UpdateNotifyProps(data map[string]string) (*Result, *AppError)
- func (c *Client) UpdatePost(post *Post) (*Result, *AppError)
- func (c *Client) UpdateTeam(team *Team) (*Result, *AppError)
- func (c *Client) UpdateTeamRoles(userId string, roles string) (*Result, *AppError)
- func (c *Client) UpdateUser(user *User) (*Result, *AppError)
- func (c *Client) UpdateUserNotify(data map[string]string) (*Result, *AppError)
- func (c *Client) UpdateUserPassword(userId, currentPassword, newPassword string) (*Result, *AppError)
- func (c *Client) UpdateUserRoles(userId string, roles string) (*Result, *AppError)
- func (c *Client) UploadCertificateFile(data []byte, contentType string) *AppError
- func (c *Client) UploadPostAttachment(data []byte, channelId string, filename string) (*FileUploadResponse, *AppError)
- func (c *Client) UploadProfileFile(data []byte, contentType string) (*Result, *AppError)
- type ClusterInfo
- type ClusterSettings
- type Command
- type CommandResponse
- type Compliance
- type CompliancePost
- type ComplianceSettings
- type Compliances
- type Config
- type Customer
- type EmailSettings
- type Emoji
- type EncryptStringMap
- type Features
- type FileInfo
- type FileSettings
- type FileUploadResponse
- type GatewayResponse
- type IncomingWebhook
- type IncomingWebhookRequest
- type InitialLoad
- type Invites
- type LdapSettings
- type License
- type LicenseRecord
- type LocalizationSettings
- type LogSettings
- type NativeAppSettings
- type OAuthApp
- type OutgoingWebhook
- type OutgoingWebhookPayload
- type PasswordRecovery
- type PasswordSettings
- type Permission
- type Post
- type PostList
- type Preference
- type Preferences
- type PrivacySettings
- type PushNotification
- type RateLimitSettings
- type Result
- type Role
- type SSOSettings
- type SamlAuthRequest
- type SamlSettings
- type ScheduledTask
- type SearchParams
- type SecurityBulletin
- type SecurityBulletins
- type ServiceSettings
- type Session
- func (me *Session) AddProp(key string, value string)
- func (me *Session) GetTeamByTeamId(teamId string) *TeamMember
- func (me *Session) GetUserRoles() []string
- func (me *Session) IsExpired() bool
- func (me *Session) IsMobileApp() bool
- func (me *Session) PreSave()
- func (me *Session) Sanitize()
- func (me *Session) SetExpireInDays(days int)
- func (me *Session) ToJson() string
- type SqlSettings
- type Status
- type StringArray
- type StringInterface
- type StringMap
- type SuggestCommand
- type SupportSettings
- type System
- type TaskFunc
- type Team
- type TeamMember
- type TeamSettings
- type TeamSignup
- type TeamStats
- type User
- func (u *User) AddNotifyProp(key string, value string)
- func (u *User) AddProp(key string, value string)
- func (u *User) ClearNonProfileFields()
- func (u *User) Etag(showFullName, showEmail bool) string
- func (u *User) GetDisplayName() string
- func (u *User) GetDisplayNameForPreference(nameFormat string) string
- func (u *User) GetFullName() string
- func (u *User) GetRawRoles() string
- func (u *User) GetRoles() []string
- func (u *User) IsInRole(inRole string) bool
- func (u *User) IsLDAPUser() bool
- func (u *User) IsOAuthUser() bool
- func (u *User) IsValid() *AppError
- func (u *User) MakeNonNil()
- func (u *User) PreSave()
- func (u *User) PreUpdate()
- func (u *User) Sanitize(options map[string]bool)
- func (u *User) SanitizeProfile(options map[string]bool)
- func (u *User) SetDefaultNotifications()
- func (u *User) ToJson() string
- func (user *User) UpdateMentionKeysFromUsername(oldUsername string)
- type UserAutocompleteInChannel
- type UserAutocompleteInTeam
- type UserSearch
- type WebSocketClient
- func (wsc *WebSocketClient) Close()
- func (wsc *WebSocketClient) Connect() *AppError
- func (wsc *WebSocketClient) GetStatuses()
- func (wsc *WebSocketClient) GetStatusesByIds(userIds []string)
- func (wsc *WebSocketClient) Listen()
- func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{})
- func (wsc *WebSocketClient) UserTyping(channelId, parentId string)
- type WebSocketEvent
- type WebSocketMessage
- type WebSocketRequest
- type WebSocketResponse
- type WebrtcSettings
- type WebsocketBroadcast
Constants ¶
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 AUTHCODE_RESPONSE_TYPE = "code" DEFAULT_SCOPE = "user" )
const ( CHANNEL_OPEN = "O" CHANNEL_PRIVATE = "P" CHANNEL_DIRECT = "D" DEFAULT_CHANNEL = "town-square" CHANNEL_DISPLAY_NAME_MAX_RUNES = 64 CHANNEL_NAME_MAX_LENGTH = 64 CHANNEL_HEADER_MAX_RUNES = 1024 CHANNEL_PURPOSE_MAX_RUNES = 250 )
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" )
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_BEARER = "BEARER" HEADER_AUTH = "Authorization" HEADER_REQUESTED_WITH = "X-Requested-With" HEADER_REQUESTED_WITH_XML = "XMLHttpRequest" STATUS = "status" STATUS_OK = "OK" STATUS_FAIL = "FAIL" CLIENT_DIR = "webapp/dist" API_URL_SUFFIX_V1 = "/api/v1" API_URL_SUFFIX_V3 = "/api/v3" API_URL_SUFFIX = API_URL_SUFFIX_V3 )
const ( COMMAND_METHOD_POST = "P" COMMAND_METHOD_GET = "G" MIN_TRIGGER_LENGTH = 1 MAX_TRIGGER_LENGTH = 128 )
const ( COMMAND_RESPONSE_TYPE_IN_CHANNEL = "in_channel" COMMAND_RESPONSE_TYPE_EPHEMERAL = "ephemeral" )
const ( COMPLIANCE_STATUS_CREATED = "created" COMPLIANCE_STATUS_RUNNING = "running" COMPLIANCE_STATUS_FINISHED = "finished" COMPLIANCE_STATUS_FAILED = "failed" COMPLIANCE_STATUS_REMOVED = "removed" COMPLIANCE_TYPE_DAILY = "daily" COMPLIANCE_TYPE_ADHOC = "adhoc" )
const ( CONN_SECURITY_NONE = "" CONN_SECURITY_PLAIN = "PLAIN" CONN_SECURITY_TLS = "TLS" CONN_SECURITY_STARTTLS = "STARTTLS" IMAGE_DRIVER_LOCAL = "local" IMAGE_DRIVER_S3 = "amazons3" DATABASE_DRIVER_MYSQL = "mysql" DATABASE_DRIVER_POSTGRES = "postgres" PASSWORD_MAXIMUM_LENGTH = 64 PASSWORD_MINIMUM_LENGTH = 5 SERVICE_GITLAB = "gitlab" SERVICE_GOOGLE = "google" SERVICE_OFFICE365 = "office365" WEBSERVER_MODE_REGULAR = "regular" WEBSERVER_MODE_GZIP = "gzip" WEBSERVER_MODE_DISABLED = "disabled" GENERIC_NOTIFICATION = "generic" FULL_NOTIFICATION = "full" DIRECT_MESSAGE_ANY = "any" DIRECT_MESSAGE_TEAM = "team" PERMISSIONS_ALL = "all" PERMISSIONS_TEAM_ADMIN = "team_admin" PERMISSIONS_SYSTEM_ADMIN = "system_admin" FAKE_SETTING = "********************************" RESTRICT_EMOJI_CREATION_ALL = "all" RESTRICT_EMOJI_CREATION_ADMIN = "admin" RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin" EMAIL_BATCHING_BUFFER_SIZE = 256 EMAIL_BATCHING_INTERVAL = 30 SITENAME_MAX_LENGTH = 30 )
const ( USER_AUTH_SERVICE_LDAP = "ldap" LDAP_SYNC_TASK_NAME = "LDAP Syncronization" )
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" )
const ( PASSWORD_RECOVERY_CODE_SIZE = 128 PASSWORD_RECOVER_EXPIRY_TIME = 1000 * 60 * 60 // 1 hour )
const ( POST_SYSTEM_MESSAGE_PREFIX = "system_" POST_DEFAULT = "" POST_SLACK_ATTACHMENT = "slack_attachment" POST_SYSTEM_GENERIC = "system_generic" POST_JOIN_LEAVE = "system_join_leave" POST_ADD_REMOVE = "system_add_remove" POST_HEADER_CHANGE = "system_header_change" POST_CHANNEL_DELETED = "system_channel_deleted" POST_EPHEMERAL = "system_ephemeral" )
const ( PREFERENCE_CATEGORY_DIRECT_CHANNEL_SHOW = "direct_channel_show" PREFERENCE_CATEGORY_TUTORIAL_STEPS = "tutorial_step" PREFERENCE_CATEGORY_ADVANCED_SETTINGS = "advanced_settings" PREFERENCE_CATEGORY_FLAGGED_POST = "flagged_post" PREFERENCE_CATEGORY_DISPLAY_SETTINGS = "display_settings" PREFERENCE_NAME_COLLAPSE_SETTING = "collapse_previews" PREFERENCE_NAME_DISPLAY_NAME_FORMAT = "name_format" PREFERENCE_VALUE_DISPLAY_NAME_NICKNAME = "nickname_full_name" PREFERENCE_VALUE_DISPLAY_NAME_FULL = "full_name" PREFERENCE_VALUE_DISPLAY_NAME_USERNAME = "username" PREFERENCE_DEFAULT_DISPLAY_NAME_FORMAT = PREFERENCE_VALUE_DISPLAY_NAME_USERNAME PREFERENCE_CATEGORY_THEME = "theme" PREFERENCE_CATEGORY_AUTHORIZED_OAUTH_APP = "oauth_app" PREFERENCE_CATEGORY_LAST = "last" PREFERENCE_NAME_LAST_CHANNEL = "channel" PREFERENCE_CATEGORY_NOTIFICATIONS = "notifications" PREFERENCE_NAME_EMAIL_INTERVAL = "email_interval" PREFERENCE_DEFAULT_EMAIL_INTERVAL = "30" // default to match the interval of the "immediate" setting (ie 30 seconds) )
const ( PUSH_NOTIFY_APPLE = "apple" PUSH_NOTIFY_ANDROID = "android" PUSH_TYPE_MESSAGE = "message" PUSH_TYPE_CLEAR = "clear" CATEGORY_DM = "DIRECT_MESSAGE" MHPNS = "https://push.mattermost.com" )
const ( USER_AUTH_SERVICE_SAML = "saml" USER_AUTH_SERVICE_SAML_TEXT = "With SAML" SAML_IDP_CERTIFICATE = 1 SAML_PRIVATE_KEY = 2 SAML_PUBLIC_CERT = 3 )
const ( SESSION_COOKIE_TOKEN = "MMAUTHTOKEN" SESSION_CACHE_SIZE = 25000 SESSION_PROP_PLATFORM = "platform" SESSION_PROP_OS = "os" SESSION_PROP_BROWSER = "browser" )
const ( STATUS_OFFLINE = "offline" STATUS_AWAY = "away" STATUS_ONLINE = "online" STATUS_CACHE_SIZE = 25000 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" )
const ( TEAM_OPEN = "O" TEAM_INVITE = "I" )
const ( USER_NOTIFY_ALL = "all" USER_NOTIFY_MENTION = "mention" USER_NOTIFY_NONE = "none" DEFAULT_LOCALE = "en" USER_AUTH_SERVICE_EMAIL = "email" USER_AUTH_SERVICE_USERNAME = "username" )
const ( LOWERCASE_LETTERS = "abcdefghijklmnopqrstuvwxyz" UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" NUMBERS = "0123456789" SYMBOLS = " !\"\\#$%&'()*+,-./:;<=>?@[]^_`|~" )
const ( WEBSOCKET_EVENT_TYPING = "typing" WEBSOCKET_EVENT_POSTED = "posted" WEBSOCKET_EVENT_POST_EDITED = "post_edited" WEBSOCKET_EVENT_POST_DELETED = "post_deleted" WEBSOCKET_EVENT_CHANNEL_DELETED = "channel_deleted" WEBSOCKET_EVENT_CHANNEL_VIEWED = "channel_viewed" WEBSOCKET_EVENT_DIRECT_ADDED = "direct_added" WEBSOCKET_EVENT_NEW_USER = "new_user" WEBSOCKET_EVENT_LEAVE_TEAM = "leave_team" WEBSOCKET_EVENT_USER_ADDED = "user_added" WEBSOCKET_EVENT_USER_UPDATED = "user_updated" WEBSOCKET_EVENT_USER_REMOVED = "user_removed" WEBSOCKET_EVENT_PREFERENCE_CHANGED = "preference_changed" WEBSOCKET_EVENT_EPHEMERAL_MESSAGE = "ephemeral_message" WEBSOCKET_EVENT_STATUS_CHANGE = "status_change" WEBSOCKET_EVENT_HELLO = "hello" WEBSOCKET_EVENT_WEBRTC = "webrtc" WEBSOCKET_AUTHENTICATION_CHALLENGE = "authentication_challenge" )
const (
DEFAULT_WEBHOOK_USERNAME = "webhook"
)
const (
USER_AUTH_SERVICE_GITLAB = "gitlab"
)
Variables ¶
var ( IMAGE_EXTENSIONS = [5]string{".jpg", ".jpeg", ".gif", ".bmp", ".png"} IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"} )
var BuildDate string
var BuildEnterpriseReady string
var BuildHash string
var BuildHashEnterprise string
var BuildNumber string
var BuiltInRoles map[string]*Role
var CurrentVersion string = versions[0]
var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`)
var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true, '/': true, '\\': true}
var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`)
Functions ¶
func ArrayFromInterface ¶
func ArrayFromInterface(data interface{}) []string
func ArrayFromJson ¶
func ArrayToJson ¶
func CleanTeamName ¶
func CleanUsername ¶
func ClearMentionTags ¶
func ClusterInfosToJson ¶
func ClusterInfosToJson(objmap []*ClusterInfo) string
func CommandListToJson ¶
func ComparePassword ¶
ComparePassword compares the hash
func CompliancePostHeader ¶
func CompliancePostHeader() []string
func EmojiListToJson ¶
func FileInfosToJson ¶
func GetAllTasks ¶
func GetAllTasks() *map[string]*ScheduledTask
func GetDMNameFromIds ¶
func GetEtagForFileInfos ¶
func GetImageMimeType ¶
func GetInfoForBytes ¶ added in v1.4.0
func GetMillis ¶
func GetMillis() int64
GetMillis is a convience method to get milliseconds since epoch.
func GetPreviousVersion ¶
func HashPassword ¶
HashPassword generates a hash using the bcrypt.GenerateFromPassword
func IncomingWebhookListToJson ¶
func IncomingWebhookListToJson(l []*IncomingWebhook) string
func InitalizePermissions ¶
func InitalizePermissions()
func InitalizeRoles ¶
func InitalizeRoles()
func IsChannelMarkUnreadLevelValid ¶ added in v1.1.0
func IsCurrentVersion ¶
func IsFileExtImage ¶
func IsInRole ¶
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 IsOfficalBuild ¶ added in v1.1.0
func IsOfficalBuild() bool
func IsReservedTeamName ¶
func IsSafeLink ¶
func IsValidAlphaNum ¶
func IsValidEmail ¶
func IsValidHttpUrl ¶ added in v1.2.1
func IsValidHttpsUrl ¶
func IsValidTeamName ¶
func IsValidTurnOrStunServer ¶
func IsValidUserRoles ¶
func IsValidUsername ¶
func IsValidWebsocketUrl ¶
func MapFromJson ¶
MapFromJson will decode the key/value pair map
func NewId ¶
func NewId() string
NewId is a globally unique identifier. It is a [A-Z0-9] string 26 characters long. It is a UUID version 4 Guid that is zbased32 encoded with the padding stripped off.
func NewRandomString ¶ added in v1.4.0
func NewWebSocketClient ¶
func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError)
NewWebSocketClient constructs a new WebSocket client with convienence methods for talking to the server.
func OAuthAppListToJson ¶
func OAuthAppMapToJson ¶
func OutgoingWebhookListToJson ¶ added in v1.2.1
func OutgoingWebhookListToJson(l []*OutgoingWebhook) string
func ParseHashtags ¶
func RoleIdsToString ¶
func SessionsToJson ¶
func StringFromJson ¶
func StringInterfaceFromJson ¶ added in v1.2.1
func StringInterfaceToJson ¶ added in v1.2.1
func StringToJson ¶
func TeamMapToJson ¶
func TeamMembersToJson ¶
func TeamMembersToJson(o []*TeamMember) string
func UserListToJson ¶
func UserMapToJson ¶
Types ¶
type AccessData ¶
type AccessData struct { ClientId string `json:"client_id"` UserId string `json:"user_id"` Token string `json:"token"` RefreshToken string `json:"refresh_token"` RedirectUri string `json:"redirect_uri"` ExpiresAt int64 `json:"expires_at"` }
func AccessDataFromJson ¶
func AccessDataFromJson(data io.Reader) *AccessData
func (*AccessData) IsExpired ¶
func (me *AccessData) IsExpired() bool
func (*AccessData) IsValid ¶
func (ad *AccessData) IsValid() *AppError
IsValid validates the AccessData and returns an error if it isn't configured correctly.
func (*AccessData) ToJson ¶
func (ad *AccessData) ToJson() string
type AccessResponse ¶
type AccessResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int32 `json:"expires_in"` Scope string `json:"scope"` RefreshToken string `json:"refresh_token"` }
func AccessResponseFromJson ¶
func AccessResponseFromJson(data io.Reader) *AccessResponse
func (*AccessResponse) ToJson ¶
func (ar *AccessResponse) ToJson() string
type AnalyticsRow ¶ added in v1.2.1
func AnalyticsRowFromJson ¶ added in v1.2.1
func AnalyticsRowFromJson(data io.Reader) *AnalyticsRow
func (*AnalyticsRow) ToJson ¶ added in v1.2.1
func (me *AnalyticsRow) ToJson() string
type AnalyticsRows ¶ added in v1.2.1
type AnalyticsRows []*AnalyticsRow
func AnalyticsRowsFromJson ¶ added in v1.2.1
func AnalyticsRowsFromJson(data io.Reader) AnalyticsRows
func (AnalyticsRows) ToJson ¶ added in v1.2.1
func (me AnalyticsRows) ToJson() string
type AppError ¶
type AppError struct { Id string `json:"id"` Message string `json:"message"` // Message to be display to the end user without debugging information DetailedError string `json:"detailed_error"` // Internal error string to help the developer RequestId string `json:"request_id,omitempty"` // The RequestId that's also set in the header StatusCode int `json:"status_code,omitempty"` // The http status code Where string `json:"-"` // The function where it happened in the form of Struct.Func IsOAuth bool `json:"is_oauth,omitempty"` // Whether the error is OAuth specific // contains filtered or unexported fields }
func AppErrorFromJson ¶
AppErrorFromJson will decode the input and return an AppError
func NewLocAppError ¶
func (*AppError) SystemMessage ¶
func (er *AppError) SystemMessage(T goi18n.TranslateFunc) string
func (*AppError) Translate ¶
func (er *AppError) Translate(T goi18n.TranslateFunc)
type Audit ¶
type Audit struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UserId string `json:"user_id"` Action string `json:"action"` ExtraInfo string `json:"extra_info"` IpAddress string `json:"ip_address"` SessionId string `json:"session_id"` }
func AuditFromJson ¶
type AuthData ¶
type AuthData struct { ClientId string `json:"client_id"` UserId string `json:"user_id"` Code string `json:"code"` ExpiresIn int32 `json:"expires_in"` CreateAt int64 `json:"create_at"` RedirectUri string `json:"redirect_uri"` State string `json:"state"` Scope string `json:"scope"` }
func AuthDataFromJson ¶
type Channel ¶
type Channel struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` TeamId string `json:"team_id"` Type string `json:"type"` DisplayName string `json:"display_name"` Name string `json:"name"` Header string `json:"header"` Purpose string `json:"purpose"` LastPostAt int64 `json:"last_post_at"` TotalMsgCount int64 `json:"total_msg_count"` ExtraUpdateAt int64 `json:"extra_update_at"` CreatorId string `json:"creator_id"` }
func ChannelFromJson ¶
func (*Channel) ExtraUpdated ¶
func (o *Channel) ExtraUpdated()
type ChannelCounts ¶
type ChannelCounts struct { Counts map[string]int64 `json:"counts"` UpdateTimes map[string]int64 `json:"update_times"` }
func ChannelCountsFromJson ¶
func ChannelCountsFromJson(data io.Reader) *ChannelCounts
func (*ChannelCounts) Etag ¶
func (o *ChannelCounts) Etag() string
func (*ChannelCounts) ToJson ¶
func (o *ChannelCounts) ToJson() string
type ChannelData ¶
type ChannelData struct { Channel *Channel `json:"channel"` Member *ChannelMember `json:"member"` }
func ChannelDataFromJson ¶
func ChannelDataFromJson(data io.Reader) *ChannelData
func (*ChannelData) Etag ¶
func (o *ChannelData) Etag() string
func (*ChannelData) ToJson ¶
func (o *ChannelData) ToJson() string
type ChannelList ¶
type ChannelList []*Channel
func ChannelListFromJson ¶
func ChannelListFromJson(data io.Reader) *ChannelList
func (*ChannelList) Etag ¶
func (o *ChannelList) Etag() string
func (*ChannelList) ToJson ¶
func (o *ChannelList) ToJson() string
type ChannelMember ¶
type ChannelMember struct { ChannelId string `json:"channel_id"` UserId string `json:"user_id"` Roles string `json:"roles"` LastViewedAt int64 `json:"last_viewed_at"` MsgCount int64 `json:"msg_count"` MentionCount int64 `json:"mention_count"` NotifyProps StringMap `json:"notify_props"` LastUpdateAt int64 `json:"last_update_at"` }
func ChannelMemberFromJson ¶
func ChannelMemberFromJson(data io.Reader) *ChannelMember
func (*ChannelMember) GetRoles ¶
func (o *ChannelMember) GetRoles() []string
func (*ChannelMember) IsValid ¶
func (o *ChannelMember) IsValid() *AppError
func (*ChannelMember) PreSave ¶
func (o *ChannelMember) PreSave()
func (*ChannelMember) PreUpdate ¶ added in v1.1.0
func (o *ChannelMember) PreUpdate()
func (*ChannelMember) ToJson ¶
func (o *ChannelMember) ToJson() string
type ChannelMembers ¶
type ChannelMembers []ChannelMember
func ChannelMembersFromJson ¶
func ChannelMembersFromJson(data io.Reader) *ChannelMembers
func (*ChannelMembers) ToJson ¶
func (o *ChannelMembers) ToJson() string
type ChannelStats ¶
type ChannelStats struct { ChannelId string `json:"channel_id"` MemberCount int64 `json:"member_count"` }
func ChannelStatsFromJson ¶
func ChannelStatsFromJson(data io.Reader) *ChannelStats
func (*ChannelStats) ToJson ¶
func (o *ChannelStats) ToJson() string
type Client ¶
type Client struct { Url string // The location of the server like "http://localhost:8065" ApiUrl string // The api location of the server like "http://localhost:8065/api/v3" HttpClient *http.Client // The http client AuthToken string AuthType string TeamId string RequestId string Etag string ServerVersion string }
func NewClient ¶
NewClient constructs a new client with convienence methods for talking to the server.
func (*Client) AddChannelMember ¶
func (*Client) AddUserToTeam ¶
Adds a user directly to the team without sending an invite. The teamId and userId are required. You must be a valid member of the team and/or have the correct role to add new users to the team. Returns a map of user_id=userId if successful, otherwise returns an AppError.
func (*Client) AddUserToTeamFromInvite ¶
AddUserToTeamFromInvite adds a user to a team based off data provided in an invite link. Either hash and dataToHash are required or inviteId is required.
func (*Client) AdminResetPassword ¶
func (*Client) AllowOAuth ¶
AllowOAuth allows a new session by an OAuth2 App. On success it returns the url to be redirected back to the app which initiated the oauth2 flow. Must be authenticated as a user.
func (*Client) AttachDeviceId ¶
func (*Client) AutocompleteUsersInChannel ¶
AutocompleteUsersInChannel returns two lists for autocompletion of users in a channel. The first list "in_channel", specifies users in the channel. The second list "out_of_channel" specifies users outside of the channel. Term, the string to search against, is required, channel id is also required. Must be authenticated.
func (*Client) AutocompleteUsersInTeam ¶
AutocompleteUsersInTeam returns a list for autocompletion of users in a team. The list "in_team" specifies the users in the team that match the provided term, matching against username, full name and nickname. Must be authenticated.
func (*Client) CheckMfa ¶
CheckMfa returns a map with key "mfa_required" with the string value "true" or "false", indicating whether MFA is required to log the user in, based on a provided login id (username, email or some sort of SSO identifier based on configuration).
func (*Client) CheckStatusOK ¶
CheckStatusOK is a convenience function for checking the return of Web Service call that return the a map of status=OK.
func (*Client) ClearOAuthToken ¶
func (c *Client) ClearOAuthToken()
func (*Client) ClearTeamId ¶
func (c *Client) ClearTeamId()
func (*Client) CreateChannel ¶
func (*Client) CreateDirectChannel ¶
func (*Client) CreateEmoji ¶
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 (*Client) CreateIncomingWebhook ¶
func (c *Client) CreateIncomingWebhook(hook *IncomingWebhook) (*Result, *AppError)
func (*Client) CreateOutgoingWebhook ¶ added in v1.2.1
func (c *Client) CreateOutgoingWebhook(hook *OutgoingWebhook) (*Result, *AppError)
func (*Client) CreateTeam ¶
CreateTeam creates a team based on the provided Team struct. On success it returns the Team struct with the Id, CreateAt and other server-decided fields populated.
func (*Client) CreateTeamFromSignup ¶
func (c *Client) CreateTeamFromSignup(teamSignup *TeamSignup) (*Result, *AppError)
CreateTeamFromSignup creates a team based on the provided TeamSignup struct. On success it returns the TeamSignup struct.
func (*Client) CreateUser ¶
CreateUser creates a user in the system based on the provided user struct.
func (*Client) CreateUserFromSignup ¶
func (*Client) CreateUserWithInvite ¶
func (c *Client) CreateUserWithInvite(user *User, hash string, data string, inviteId string) (*Result, *AppError)
CreateUserWithInvite creates a user based on the provided user struct. Either the hash and data strings or the inviteId is required from the invite.
func (*Client) DeleteCommand ¶
func (*Client) DeleteEmoji ¶
DeleteEmoji will delete an emoji from the server if the current user has permission to do so. If successful, it will return status=ok. Otherwise, an error will be returned.
func (*Client) DeleteIncomingWebhook ¶
func (*Client) DeleteOAuthApp ¶
DeleteOAuthApp deletes an OAuth2 app, the app must be deleted by the same user who created it or a System Administrator. On success returs Status OK. Must be authenticated as a user.
func (*Client) DeleteOutgoingWebhook ¶ added in v1.2.1
func (*Client) DeletePost ¶
func (*Client) DeletePreferences ¶
func (c *Client) DeletePreferences(preferences *Preferences) (bool, *AppError)
DeletePreferences deletes a list of preferences owned by the current user. If successful, it will return status=ok. Otherwise, an error will be returned.
func (*Client) DownloadComplianceReport ¶
func (*Client) EmailToOAuth ¶
func (*Client) FindTeamByName ¶
FindTeamByName returns the strings "true" or "false" depending on if a team with the provided name was found.
func (*Client) GenerateMfaSecret ¶
GenerateMfaSecret returns a QR code image containing the secret, to be scanned by a multi-factor authentication mobile application. It also returns the secret for manual entry. Must be authenticated.
func (*Client) GetAccessToken ¶
func (*Client) GetAllAudits ¶
func (*Client) GetAllPreferences ¶ added in v1.2.1
func (*Client) GetAllTeamListings ¶
GetAllTeamListings returns a map of all teams that are available to join using team ids as the key. Must be authenticated.
func (*Client) GetAllTeams ¶
GetAllTeams returns a map of all teams using team ids as the key.
func (*Client) GetChannelCounts ¶
func (*Client) GetChannelMember ¶
func (*Client) GetChannelNameRoute ¶
func (*Client) GetChannelRoute ¶
func (*Client) GetChannelStats ¶
func (*Client) GetClientLicenceConfig ¶
func (*Client) GetClientProperties ¶
GetClientProperties returns properties needed by the client to show/hide certian features. It returns a map of strings.
func (*Client) GetClusterStatus ¶
func (c *Client) GetClusterStatus() ([]*ClusterInfo, *AppError)
func (*Client) GetComplianceReports ¶
func (*Client) GetCustomEmojiImageUrl ¶
GetCustomEmojiImageUrl returns the API route that can be used to get the image used by the given emoji.
func (*Client) GetEmojiRoute ¶
func (*Client) GetFileInfosForPost ¶
func (c *Client) GetFileInfosForPost(channelId string, postId string, etag string) ([]*FileInfo, *AppError)
GetFileInfosForPost returns a list of FileInfo objects for a given post id, if successful. Otherwise, it returns an error.
func (*Client) GetFilePreview ¶
func (c *Client) GetFilePreview(fileId string) (io.ReadCloser, *AppError)
func (*Client) GetFileRoute ¶
func (*Client) GetFileThumbnail ¶
func (c *Client) GetFileThumbnail(fileId string) (io.ReadCloser, *AppError)
func (*Client) GetFlaggedPosts ¶
GetFlaggedPosts will return a post list of posts that have been flagged by the user. The page is set by the integer parameters offset and limit.
func (*Client) GetGeneralRoute ¶
func (*Client) GetInitialLoad ¶
func (*Client) GetMyChannelMembers ¶
func (*Client) GetOAuthAppInfo ¶
GetOAuthAppInfo lookup an OAuth2 App using the client_id. On success it returns a Sanitized OAuth2 App. Must be authenticated as a user.
func (*Client) GetOAuthAppsByUser ¶
GetOAuthAppsByUser returns the OAuth2 Apps registered by the user. On success it returns a list of OAuth2 Apps from the same user or all the registered apps if the user is a System Administrator. Must be authenticated as a user.
func (*Client) GetOAuthAuthorizedApps ¶
GetOAuthAuthorizedApps returns the OAuth2 Apps authorized by the user. On success it returns a list of sanitized OAuth2 Authorized Apps by the user.
func (*Client) GetPing ¶
GetPing returns a map of strings with server time, server version, and node Id. Systems that want to check on health status of the server should check the url /api/v3/ping for a 200 status response.
func (*Client) GetPostsAfter ¶ added in v1.2.1
func (*Client) GetPostsBefore ¶ added in v1.2.1
func (*Client) GetPostsSince ¶
func (*Client) GetPreference ¶ added in v1.2.1
func (*Client) GetPreferenceCategory ¶ added in v1.2.1
func (*Client) GetProfiles ¶
GetProfiles returns a map of users using user id as the key. Must be authenticated.
func (*Client) GetProfilesByIds ¶
GetProfilesByIds returns a map of users based on the user ids provided. Must be authenticated.
func (*Client) GetProfilesInChannel ¶
func (c *Client) GetProfilesInChannel(channelId string, offset int, limit int, etag string) (*Result, *AppError)
GetProfilesInChannel returns a map of users for a channel using user id as the key. Must be authenticated.
func (*Client) GetProfilesInTeam ¶
func (c *Client) GetProfilesInTeam(teamId string, offset int, limit int, etag string) (*Result, *AppError)
GetProfilesInTeam returns a map of users for a team using user id as the key. Must be authenticated.
func (*Client) GetProfilesNotInChannel ¶
func (c *Client) GetProfilesNotInChannel(channelId string, offset int, limit int, etag string) (*Result, *AppError)
GetProfilesNotInChannel returns a map of users not in a channel but on the team using user id as the key. Must be authenticated.
func (*Client) GetRecentlyActiveUsers ¶
GetRecentlyActiveUsers returns a map of users including lastActivityAt using user id as the key
func (*Client) GetStatuses ¶
GetStatuses returns a map of string statuses using user id as the key
func (*Client) GetStatusesByIds ¶
GetStatusesByIds returns a map of string statuses using user id as the key, based on the provided user ids
func (*Client) GetSystemAnalytics ¶
func (*Client) GetTeamAnalytics ¶
func (*Client) GetTeamMember ¶
GetTeamMember will return a team member object based on the team id and user id provided. Must be authenticated.
func (*Client) GetTeamMembers ¶
GetTeamMembers will return a page of team member objects as an array paged based on the team id, offset and limit provided. Must be authenticated.
func (*Client) GetTeamMembersByIds ¶
GetTeamMembersByIds will return team member objects as an array based on the team id and a list of user ids provided. Must be authenticated.
func (*Client) GetTeamRoute ¶
func (*Client) GetTeamStats ¶
GetTeamStats will return a team stats object containing the number of users on the team based on the team id provided. Must be authenticated.
func (*Client) GetUser ¶
GetUser returns a user based on a provided user id string. Must be authenticated.
func (*Client) GetUserRequiredRoute ¶
func (*Client) GetWebrtcToken ¶
GetWebrtcToken if Successful returns a map with a valid token, stun server and turn server with credentials to use with the Mattermost WebRTC service, otherwise returns an AppError. Must be authenticated user.
func (*Client) InviteMembers ¶
func (*Client) JoinChannelByName ¶
func (*Client) LdapSyncNow ¶
Initiate immediate synchronization of LDAP users. The synchronization will be performed asynchronously and this function will always return OK unless you don't have permissions. You must be the system administrator to use this function.
func (*Client) ListCommands ¶
func (*Client) ListIncomingWebhooks ¶
func (*Client) ListOutgoingWebhooks ¶ added in v1.2.1
func (*Client) ListTeamCommands ¶
func (*Client) LogClient ¶
LogClient 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 true if the logging was successful.
func (*Client) Login ¶
Login authenticates a user by login id, which can be username, email or some sort of SSO identifier based on configuration, and a password.
func (*Client) LoginByLdap ¶
LoginByLdap authenticates a user by LDAP id and password.
func (*Client) LoginWithDevice ¶
func (c *Client) LoginWithDevice(loginId string, password string, deviceId string) (*Result, *AppError)
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 (*Client) MockSession ¶
func (*Client) MustGeneric ¶
MustGeneric is a convenience function used for testing.
func (*Client) OAuthDeauthorizeApp ¶
OAuthDeauthorizeApp deauthorize a user an OAuth 2.0 app. On success it returns status OK or an AppError on fail.
func (*Client) OAuthToEmail ¶
func (*Client) PostToWebhook ¶
func (*Client) RecycleDatabaseConnection ¶
RecycleDatabaseConnection will attempt to recycle the database connections. You must have the system admin role to call this method. It will return status=OK if it's successfully recycled the connections, otherwise check the returned error.
func (*Client) RegenCommandToken ¶
func (*Client) RegenOutgoingWebhookToken ¶ added in v1.2.1
func (*Client) RegenerateOAuthAppSecret ¶
RegenerateOAuthAppSecret generates a new OAuth App Client Secret. On success it returns an OAuth2 App. Must be authenticated as a user and the same user who registered the app or a System Admin.
func (*Client) RegisterApp ¶
RegisterApp creates a new OAuth2 app to be used with the OAuth2 Provider. On success it returns the created app. Must be authenticated as a user.
func (*Client) ReloadConfig ¶
ReloadConfig will reload the config.json file from disk. Properties requiring a server restart will still need a server restart. You must have the system admin role to call this method. It will return status=OK if it's successfully reloaded the config file, otherwise check the returned error.
func (*Client) RemoveCertificateFile ¶
Removes a x509 base64 Certificate or Private Key file used with SAML. filename is required. Returns nil if successful, otherwise returns an AppError
func (*Client) RemoveChannelMember ¶
func (*Client) RemoveUserFromTeam ¶
Removes a user directly from the team. The teamId and userId are required. You must be a valid member of the team and/or have the correct role to remove a user from the team. Returns a map of user_id=userId if successful, otherwise returns an AppError.
func (*Client) ResetPassword ¶
func (*Client) RevokeSession ¶
func (*Client) SamlCertificateStatus ¶
Checks if the x509 base64 Certificates and Private Key files used with SAML exists on the file system. Returns a map[string]interface{} if successful, otherwise returns an AppError. Must be System Admin authenticated.
func (*Client) SaveComplianceReport ¶
func (c *Client) SaveComplianceReport(job *Compliance) (*Result, *AppError)
func (*Client) SearchPosts ¶
func (*Client) SearchUsers ¶
func (c *Client) SearchUsers(params UserSearch) (*Result, *AppError)
SearchUsers returns a list of users that have a username matching or similar to the search term. Must be authenticated.
func (*Client) SendPasswordReset ¶
func (*Client) SetActiveChannel ¶
SetActiveChannel sets the the channel id the user is currently viewing. The channelId key is required but the value can be blank. Returns standard response.
func (*Client) SetOAuthToken ¶
func (*Client) SetPreferences ¶ added in v1.2.1
func (c *Client) SetPreferences(preferences *Preferences) (*Result, *AppError)
func (*Client) SignupTeam ¶
SignupTeam sends an email with a team sign-up link to the provided address if email verification is enabled, otherwise it returns a map with a "follow_link" entry containing the team sign-up link.
func (*Client) TestLdap ¶
TestLdap will run a connection test on the current LDAP settings. It will return the standard OK response if settings work. Otherwise it will return an appropriate error.
func (*Client) UpdateActive ¶
func (*Client) UpdateChannel ¶
func (*Client) UpdateChannelHeader ¶ added in v1.2.1
func (*Client) UpdateChannelPurpose ¶ added in v1.2.1
func (*Client) UpdateLastViewedAt ¶
UpdateLastViewedAt will mark a channel as read. The channelId indicates the channel to mark as read. If active is true, push notifications will be cleared if there are unread messages. The default for active is true.
func (*Client) UpdateMfa ¶
UpdateMfa activates multi-factor authenticates for the current user if activate is true and a valid token is provided. If activate is false, then token is not required and multi-factor authentication is disabled for the current user.
func (*Client) UpdateNotifyProps ¶ added in v1.1.0
func (*Client) UpdateTeam ¶ added in v1.2.1
UpdateTeam updates a team based on the changes in the provided team struct. On success it returns a sanitized version of the updated team. Must be authenticated as a team admin for that team or a system admin.
func (*Client) UpdateTeamRoles ¶
func (*Client) UpdateUserNotify ¶
func (*Client) UpdateUserPassword ¶
func (*Client) UpdateUserRoles ¶
func (*Client) UploadCertificateFile ¶
Uploads a x509 base64 Certificate or Private Key file to be used with SAML. data byte array is required and needs to be a Multi-Part with 'certificate' as the field name contentType is also required. Returns nil if succesful, otherwise returns an AppError
func (*Client) UploadPostAttachment ¶
type ClusterInfo ¶
type ClusterInfo struct { Id string `json:"id"` Version string `json:"version"` ConfigHash string `json:"config_hash"` InterNodeUrl string `json:"internode_url"` Hostname string `json:"hostname"` LastSuccessfulPing int64 `json:"last_ping"` IsAlive bool `json:"is_alive"` }
func ClusterInfoFromJson ¶
func ClusterInfoFromJson(data io.Reader) *ClusterInfo
func ClusterInfosFromJson ¶
func ClusterInfosFromJson(data io.Reader) []*ClusterInfo
func (*ClusterInfo) HaveEstablishedInitialContact ¶
func (me *ClusterInfo) HaveEstablishedInitialContact() bool
func (*ClusterInfo) ToJson ¶
func (me *ClusterInfo) ToJson() string
type ClusterSettings ¶
type Command ¶
type Command struct { Id string `json:"id"` Token string `json:"token"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` CreatorId string `json:"creator_id"` TeamId string `json:"team_id"` Trigger string `json:"trigger"` Method string `json:"method"` Username string `json:"username"` IconURL string `json:"icon_url"` AutoComplete bool `json:"auto_complete"` AutoCompleteDesc string `json:"auto_complete_desc"` AutoCompleteHint string `json:"auto_complete_hint"` DisplayName string `json:"display_name"` Description string `json:"description"` URL string `json:"url"` }
func CommandFromJson ¶
func CommandListFromJson ¶
type CommandResponse ¶
type CommandResponse struct { ResponseType string `json:"response_type"` Text string `json:"text"` GotoLocation string `json:"goto_location"` Attachments interface{} `json:"attachments"` }
func CommandResponseFromJson ¶
func CommandResponseFromJson(data io.Reader) *CommandResponse
func (*CommandResponse) ToJson ¶
func (o *CommandResponse) ToJson() string
type Compliance ¶
type Compliance struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UserId string `json:"user_id"` Status string `json:"status"` Count int `json:"count"` Desc string `json:"desc"` Type string `json:"type"` StartAt int64 `json:"start_at"` EndAt int64 `json:"end_at"` Keywords string `json:"keywords"` Emails string `json:"emails"` }
func ComplianceFromJson ¶
func ComplianceFromJson(data io.Reader) *Compliance
func (*Compliance) IsValid ¶
func (me *Compliance) IsValid() *AppError
func (*Compliance) JobName ¶
func (me *Compliance) JobName() string
func (*Compliance) PreSave ¶
func (me *Compliance) PreSave()
func (*Compliance) ToJson ¶
func (o *Compliance) ToJson() string
type CompliancePost ¶
type CompliancePost struct { // From Team TeamName string TeamDisplayName string // From Channel ChannelName string ChannelDisplayName string // From User UserUsername string UserEmail string UserNickname string // From Post PostId string PostCreateAt int64 PostUpdateAt int64 PostDeleteAt int64 PostRootId string PostParentId string PostOriginalId string PostMessage string PostType string PostProps string PostFileIds string }
func (*CompliancePost) Row ¶
func (me *CompliancePost) Row() []string
type ComplianceSettings ¶
type Compliances ¶
type Compliances []Compliance
func CompliancesFromJson ¶
func CompliancesFromJson(data io.Reader) Compliances
func (Compliances) ToJson ¶
func (o Compliances) ToJson() string
type Config ¶
type Config struct { ServiceSettings ServiceSettings TeamSettings TeamSettings SqlSettings SqlSettings LogSettings LogSettings PasswordSettings PasswordSettings FileSettings FileSettings EmailSettings EmailSettings RateLimitSettings RateLimitSettings PrivacySettings PrivacySettings SupportSettings SupportSettings GitLabSettings SSOSettings GoogleSettings SSOSettings Office365Settings SSOSettings LdapSettings LdapSettings ComplianceSettings ComplianceSettings LocalizationSettings LocalizationSettings SamlSettings SamlSettings NativeAppSettings NativeAppSettings ClusterSettings ClusterSettings WebrtcSettings WebrtcSettings }
func ConfigFromJson ¶
func (*Config) GetSSOService ¶
func (o *Config) GetSSOService(service string) *SSOSettings
func (*Config) GetSanitizeOptions ¶ added in v1.3.0
func (*Config) SetDefaults ¶ added in v1.1.0
func (o *Config) SetDefaults()
type EmailSettings ¶
type EmailSettings struct { EnableSignUpWithEmail bool EnableSignInWithEmail *bool EnableSignInWithUsername *bool SendEmailNotifications bool RequireEmailVerification bool FeedbackName string FeedbackEmail string FeedbackOrganization *string SMTPUsername string SMTPPassword string SMTPServer string SMTPPort string ConnectionSecurity string InviteSalt string PasswordResetSalt string SendPushNotifications *bool PushNotificationServer *string PushNotificationContents *string EnableEmailBatching *bool EmailBatchingBufferSize *int EmailBatchingInterval *int }
type Emoji ¶
type Emoji struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` CreatorId string `json:"creator_id"` Name string `json:"name"` }
func EmojiFromJson ¶
func EmojiListFromJson ¶
type EncryptStringMap ¶
type Features ¶
type Features struct { Users *int `json:"users"` LDAP *bool `json:"ldap"` MFA *bool `json:"mfa"` GoogleOAuth *bool `json:"google_oauth"` Office365OAuth *bool `json:"office365_oauth"` Compliance *bool `json:"compliance"` Cluster *bool `json:"cluster"` CustomBrand *bool `json:"custom_brand"` MHPNS *bool `json:"mhpns"` SAML *bool `json:"saml"` PasswordRequirements *bool `json:"password_requirements"` // after we enabled more features for webrtc we'll need to control them with this FutureFeatures *bool `json:"future_features"` }
func (*Features) SetDefaults ¶
func (f *Features) SetDefaults()
type FileInfo ¶ added in v1.4.0
type FileInfo struct { Id string `json:"id"` CreatorId string `json:"user_id"` PostId string `json:"post_id,omitempty"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` Path string `json:"-"` // not sent back to the client ThumbnailPath string `json:"-"` // not sent back to the client PreviewPath string `json:"-"` // not sent back to the client Name string `json:"name"` Extension string `json:"extension"` Size int64 `json:"size"` MimeType string `json:"mime_type"` Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` HasPreviewImage bool `json:"has_preview_image,omitempty"` }
func FileInfoFromJson ¶ added in v1.4.0
func FileInfosFromJson ¶
type FileSettings ¶
type FileSettings struct { MaxFileSize *int64 DriverName string Directory string EnablePublicLink bool PublicLinkSalt *string ThumbnailWidth int ThumbnailHeight int PreviewWidth int PreviewHeight int ProfileWidth int ProfileHeight int InitialFont string AmazonS3AccessKeyId string AmazonS3SecretAccessKey string AmazonS3Bucket string AmazonS3Region string AmazonS3Endpoint string AmazonS3SSL *bool }
type FileUploadResponse ¶
type FileUploadResponse struct { FileInfos []*FileInfo `json:"file_infos"` ClientIds []string `json:"client_ids"` }
func FileUploadResponseFromJson ¶
func FileUploadResponseFromJson(data io.Reader) *FileUploadResponse
func (*FileUploadResponse) ToJson ¶
func (o *FileUploadResponse) ToJson() string
type GatewayResponse ¶
type GatewayResponse struct {
Status string `json:"janus"`
}
func GatewayResponseFromJson ¶
func GatewayResponseFromJson(data io.Reader) *GatewayResponse
type IncomingWebhook ¶
type IncomingWebhook struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` UserId string `json:"user_id"` ChannelId string `json:"channel_id"` TeamId string `json:"team_id"` DisplayName string `json:"display_name"` Description string `json:"description"` }
func IncomingWebhookFromJson ¶
func IncomingWebhookFromJson(data io.Reader) *IncomingWebhook
func IncomingWebhookListFromJson ¶
func IncomingWebhookListFromJson(data io.Reader) []*IncomingWebhook
func (*IncomingWebhook) IsValid ¶
func (o *IncomingWebhook) IsValid() *AppError
func (*IncomingWebhook) PreSave ¶
func (o *IncomingWebhook) PreSave()
func (*IncomingWebhook) PreUpdate ¶
func (o *IncomingWebhook) PreUpdate()
func (*IncomingWebhook) ToJson ¶
func (o *IncomingWebhook) ToJson() string
type IncomingWebhookRequest ¶ added in v1.2.1
type IncomingWebhookRequest struct { Text string `json:"text"` Username string `json:"username"` IconURL string `json:"icon_url"` ChannelName string `json:"channel"` Props StringInterface `json:"props"` Attachments interface{} `json:"attachments"` Type string `json:"type"` }
func IncomingWebhookRequestFromJson ¶ added in v1.2.1
func IncomingWebhookRequestFromJson(data io.Reader) *IncomingWebhookRequest
type InitialLoad ¶
type InitialLoad struct { User *User `json:"user"` TeamMembers []*TeamMember `json:"team_members"` Teams []*Team `json:"teams"` Preferences Preferences `json:"preferences"` ClientCfg map[string]string `json:"client_cfg"` LicenseCfg map[string]string `json:"license_cfg"` NoAccounts bool `json:"no_accounts"` }
func InitialLoadFromJson ¶
func InitialLoadFromJson(data io.Reader) *InitialLoad
func (*InitialLoad) ToJson ¶
func (me *InitialLoad) ToJson() string
type Invites ¶
func InvitesFromJson ¶
type LdapSettings ¶ added in v1.4.0
type LdapSettings struct { // Basic Enable *bool LdapServer *string LdapPort *int ConnectionSecurity *string BaseDN *string BindUsername *string BindPassword *string // Filtering UserFilter *string // User Mapping FirstNameAttribute *string LastNameAttribute *string EmailAttribute *string UsernameAttribute *string NicknameAttribute *string IdAttribute *string // Syncronization SyncIntervalMinutes *int // Advanced SkipCertificateVerification *bool QueryTimeout *int MaxPageSize *int // Customization LoginFieldName *string }
type License ¶
type License struct { Id string `json:"id"` IssuedAt int64 `json:"issued_at"` StartsAt int64 `json:"starts_at"` ExpiresAt int64 `json:"expires_at"` Customer *Customer `json:"customer"` Features *Features `json:"features"` }
func LicenseFromJson ¶
type LicenseRecord ¶
type LicenseRecord struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` Bytes string `json:"-"` }
func (*LicenseRecord) IsValid ¶
func (lr *LicenseRecord) IsValid() *AppError
func (*LicenseRecord) PreSave ¶
func (lr *LicenseRecord) PreSave()
type LocalizationSettings ¶
type LogSettings ¶
type NativeAppSettings ¶
type OAuthApp ¶
type OAuthApp struct { Id string `json:"id"` CreatorId string `json:"creator_id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` ClientSecret string `json:"client_secret"` Name string `json:"name"` Description string `json:"description"` IconURL string `json:"icon_url"` CallbackUrls StringArray `json:"callback_urls"` Homepage string `json:"homepage"` IsTrusted bool `json:"is_trusted"` }
func OAuthAppFromJson ¶
OAuthAppFromJson will decode the input and return a User
func OAuthAppListFromJson ¶
func (*OAuthApp) IsValid ¶
IsValid validates the app and returns an error if it isn't configured correctly.
func (*OAuthApp) IsValidRedirectURL ¶
func (*OAuthApp) PreSave ¶
func (a *OAuthApp) PreSave()
PreSave will set the Id and ClientSecret if missing. It will also fill in the CreateAt, UpdateAt times. It should be run before saving the app to the db.
func (*OAuthApp) PreUpdate ¶
func (a *OAuthApp) PreUpdate()
PreUpdate should be run before updating the app in the db.
type OutgoingWebhook ¶ added in v1.2.1
type OutgoingWebhook struct { Id string `json:"id"` Token string `json:"token"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` CreatorId string `json:"creator_id"` ChannelId string `json:"channel_id"` TeamId string `json:"team_id"` TriggerWords StringArray `json:"trigger_words"` TriggerWhen int `json:"trigger_when"` CallbackURLs StringArray `json:"callback_urls"` DisplayName string `json:"display_name"` Description string `json:"description"` ContentType string `json:"content_type"` }
func OutgoingWebhookFromJson ¶ added in v1.2.1
func OutgoingWebhookFromJson(data io.Reader) *OutgoingWebhook
func OutgoingWebhookListFromJson ¶ added in v1.2.1
func OutgoingWebhookListFromJson(data io.Reader) []*OutgoingWebhook
func (*OutgoingWebhook) HasTriggerWord ¶ added in v1.2.1
func (o *OutgoingWebhook) HasTriggerWord(word string) bool
func (*OutgoingWebhook) IsValid ¶ added in v1.2.1
func (o *OutgoingWebhook) IsValid() *AppError
func (*OutgoingWebhook) PreSave ¶ added in v1.2.1
func (o *OutgoingWebhook) PreSave()
func (*OutgoingWebhook) PreUpdate ¶ added in v1.2.1
func (o *OutgoingWebhook) PreUpdate()
func (*OutgoingWebhook) ToJson ¶ added in v1.2.1
func (o *OutgoingWebhook) ToJson() string
func (*OutgoingWebhook) TriggerWordStartsWith ¶
func (o *OutgoingWebhook) TriggerWordStartsWith(word string) bool
type OutgoingWebhookPayload ¶
type OutgoingWebhookPayload struct { Token string `json:"token"` TeamId string `json:"team_id"` TeamDomain string `json:"team_domain"` ChannelId string `json:"channel_id"` ChannelName string `json:"channel_name"` Timestamp int64 `json:"timestamp"` UserId string `json:"user_id"` UserName string `json:"user_name"` PostId string `json:"post_id"` Text string `json:"text"` TriggerWord string `json:"trigger_word"` }
func (*OutgoingWebhookPayload) ToFormValues ¶
func (o *OutgoingWebhookPayload) ToFormValues() string
func (*OutgoingWebhookPayload) ToJSON ¶
func (o *OutgoingWebhookPayload) ToJSON() string
type PasswordRecovery ¶
func (*PasswordRecovery) IsValid ¶
func (p *PasswordRecovery) IsValid() *AppError
func (*PasswordRecovery) PreSave ¶
func (p *PasswordRecovery) PreSave()
type PasswordSettings ¶
type Permission ¶
type Permission struct { Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` }
var PERMISSION_ADD_USER_TO_TEAM *Permission
var PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE *Permission
var PERMISSION_CREATE_DIRECT_CHANNEL *Permission
var PERMISSION_CREATE_POST *Permission
var PERMISSION_CREATE_PRIVATE_CHANNEL *Permission
var PERMISSION_CREATE_PUBLIC_CHANNEL *Permission
var PERMISSION_DELETE_PRIVATE_CHANNEL *Permission
var PERMISSION_DELETE_PUBLIC_CHANNEL *Permission
var PERMISSION_EDIT_OTHERS_POSTS *Permission
var PERMISSION_EDIT_OTHER_USERS *Permission
var PERMISSION_EDIT_POST *Permission
var PERMISSION_GET_PUBLIC_LINK *Permission
var PERMISSION_IMPORT_TEAM *Permission
var PERMISSION_INVITE_USER *Permission
var PERMISSION_JOIN_PUBLIC_CHANNELS *Permission
var PERMISSION_LIST_TEAM_CHANNELS *Permission
var PERMISSION_MANAGE_OAUTH *Permission
var PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS *Permission
var PERMISSION_MANAGE_OTHERS_WEBHOOKS *Permission
var PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS *Permission
var PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES *Permission
var PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS *Permission
var PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES *Permission
var PERMISSION_MANAGE_ROLES *Permission
var PERMISSION_MANAGE_SLASH_COMMANDS *Permission
var PERMISSION_MANAGE_SYSTEM *Permission
General permission that encompases all system admin functions in the future this could be broken up to allow access to some admin functions but not others
var PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH *Permission
var PERMISSION_MANAGE_TEAM *Permission
var PERMISSION_MANAGE_WEBHOOKS *Permission
var PERMISSION_PERMANENT_DELETE_USER *Permission
var PERMISSION_READ_CHANNEL *Permission
var PERMISSION_REMOVE_USER_FROM_TEAM *Permission
var PERMISSION_UPLOAD_FILE *Permission
var PERMISSION_USE_SLASH_COMMANDS *Permission
type Post ¶
type Post struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` UserId string `json:"user_id"` ChannelId string `json:"channel_id"` RootId string `json:"root_id"` ParentId string `json:"parent_id"` OriginalId string `json:"original_id"` Message string `json:"message"` Type string `json:"type"` Props StringInterface `json:"props"` Filenames StringArray `json:"filenames,omitempty"` // Deprecated, do not use this field any more FileIds StringArray `json:"file_ids,omitempty"` PendingPostId string `json:"pending_post_id" db:"-"` }
func PostFromJson ¶
func (*Post) IsSystemMessage ¶ added in v1.3.0
func (*Post) MakeNonNil ¶
func (o *Post) MakeNonNil()
type PostList ¶
func PostListFromJson ¶
func (*PostList) IsChannelId ¶
func (*PostList) MakeNonNil ¶
func (o *PostList) MakeNonNil()
type Preference ¶ added in v1.2.1
type Preference struct { UserId string `json:"user_id"` Category string `json:"category"` Name string `json:"name"` Value string `json:"value"` }
func PreferenceFromJson ¶ added in v1.2.1
func PreferenceFromJson(data io.Reader) *Preference
func (*Preference) IsValid ¶ added in v1.2.1
func (o *Preference) IsValid() *AppError
func (*Preference) PreUpdate ¶
func (o *Preference) PreUpdate()
func (*Preference) ToJson ¶ added in v1.2.1
func (o *Preference) ToJson() string
type Preferences ¶ added in v1.2.1
type Preferences []Preference
func PreferencesFromJson ¶ added in v1.2.1
func PreferencesFromJson(data io.Reader) (Preferences, error)
func (*Preferences) ToJson ¶ added in v1.2.1
func (o *Preferences) ToJson() string
type PrivacySettings ¶
type PushNotification ¶ added in v1.3.0
type PushNotification struct { Platform string `json:"platform"` ServerId string `json:"server_id"` DeviceId string `json:"device_id"` Category string `json:"category"` Sound string `json:"sound"` Message string `json:"message"` Badge int `json:"badge"` ContentAvailable int `json:"cont_ava"` ChannelId string `json:"channel_id"` ChannelName string `json:"channel_name"` Type string `json:"type"` }
func PushNotificationFromJson ¶ added in v1.3.0
func PushNotificationFromJson(data io.Reader) *PushNotification
func (*PushNotification) SetDeviceIdAndPlatform ¶
func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string)
func (*PushNotification) ToJson ¶ added in v1.3.0
func (me *PushNotification) ToJson() string
type RateLimitSettings ¶
type Role ¶
type Role struct { Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Permissions []string `json:"permissions"` }
var ROLE_CHANNEL_ADMIN *Role
var ROLE_CHANNEL_GUEST *Role
var ROLE_CHANNEL_USER *Role
var ROLE_SYSTEM_ADMIN *Role
var ROLE_SYSTEM_USER *Role
var ROLE_TEAM_ADMIN *Role
var ROLE_TEAM_USER *Role
type SSOSettings ¶
type SamlAuthRequest ¶
type SamlSettings ¶
type SamlSettings struct { // Basic Enable *bool Verify *bool Encrypt *bool IdpUrl *string IdpDescriptorUrl *string AssertionConsumerServiceURL *string IdpCertificateFile *string PublicCertificateFile *string PrivateKeyFile *string // User Mapping FirstNameAttribute *string LastNameAttribute *string EmailAttribute *string UsernameAttribute *string NicknameAttribute *string LocaleAttribute *string LoginButtonText *string }
type ScheduledTask ¶
type ScheduledTask struct { Name string `json:"name"` Interval time.Duration `json:"interval"` Recurring bool `json:"recurring"` // contains filtered or unexported fields }
func CreateRecurringTask ¶
func CreateRecurringTask(name string, function TaskFunc, interval time.Duration) *ScheduledTask
func CreateTask ¶
func CreateTask(name string, function TaskFunc, timeToExecution time.Duration) *ScheduledTask
func GetTaskByName ¶
func GetTaskByName(name string) *ScheduledTask
func (*ScheduledTask) Cancel ¶
func (task *ScheduledTask) Cancel()
func (*ScheduledTask) Execute ¶
func (task *ScheduledTask) Execute()
Executes the task immediatly. A recurring task will be run regularally after interval.
func (*ScheduledTask) String ¶
func (task *ScheduledTask) String() string
type SearchParams ¶ added in v1.2.1
type SearchParams struct { Terms string IsHashtag bool InChannels []string FromUsers []string OrTerms bool }
func ParseSearchParams ¶ added in v1.2.1
func ParseSearchParams(text string) []*SearchParams
type SecurityBulletin ¶ added in v1.1.0
type SecurityBulletin struct { Id string `json:"id"` AppliesToVersion string `json:"applies_to_version"` }
func SecurityBulletinFromJson ¶ added in v1.1.0
func SecurityBulletinFromJson(data io.Reader) *SecurityBulletin
func (*SecurityBulletin) ToJson ¶ added in v1.1.0
func (me *SecurityBulletin) ToJson() string
type SecurityBulletins ¶ added in v1.1.0
type SecurityBulletins []SecurityBulletin
func SecurityBulletinsFromJson ¶ added in v1.1.0
func SecurityBulletinsFromJson(data io.Reader) SecurityBulletins
func (SecurityBulletins) ToJson ¶ added in v1.1.0
func (me SecurityBulletins) ToJson() string
type ServiceSettings ¶
type ServiceSettings struct { SiteURL *string ListenAddress string ConnectionSecurity *string TLSCertFile *string TLSKeyFile *string UseLetsEncrypt *bool LetsEncryptCertificateCacheFile *string Forward80To443 *bool ReadTimeout *int WriteTimeout *int MaximumLoginAttempts int SegmentDeveloperKey string GoogleDeveloperKey string EnableOAuthServiceProvider bool EnableIncomingWebhooks bool EnableOutgoingWebhooks bool EnableCommands *bool EnableOnlyAdminIntegrations *bool EnablePostUsernameOverride bool EnablePostIconOverride bool EnableTesting bool EnableDeveloper *bool EnableSecurityFixAlert *bool EnableInsecureOutgoingConnections *bool EnableMultifactorAuthentication *bool AllowCorsFrom *string SessionLengthWebInDays *int SessionLengthMobileInDays *int SessionLengthSSOInDays *int SessionCacheInMinutes *int WebsocketSecurePort *int WebsocketPort *int WebserverMode *string EnableCustomEmoji *bool RestrictCustomEmojiCreation *string }
type Session ¶
type Session struct { Id string `json:"id"` Token string `json:"token"` CreateAt int64 `json:"create_at"` ExpiresAt int64 `json:"expires_at"` LastActivityAt int64 `json:"last_activity_at"` UserId string `json:"user_id"` DeviceId string `json:"device_id"` Roles string `json:"roles"` IsOAuth bool `json:"is_oauth"` Props StringMap `json:"props"` TeamMembers []*TeamMember `json:"team_members" db:"-"` }
func SessionFromJson ¶
func SessionsFromJson ¶
func (*Session) GetTeamByTeamId ¶
func (me *Session) GetTeamByTeamId(teamId string) *TeamMember
func (*Session) GetUserRoles ¶
func (*Session) IsMobileApp ¶
func (*Session) SetExpireInDays ¶
type SqlSettings ¶
type Status ¶
type Status struct { UserId string `json:"user_id"` Status string `json:"status"` Manual bool `json:"manual"` LastActivityAt int64 `json:"last_activity_at"` ActiveChannel string `json:"active_channel"` }
func StatusFromJson ¶
type StringArray ¶
type StringArray []string
type StringInterface ¶ added in v1.2.1
type StringInterface map[string]interface{}
type StringMap ¶
func GetDefaultChannelNotifyProps ¶ added in v1.1.0
func GetDefaultChannelNotifyProps() StringMap
type SuggestCommand ¶
type SuggestCommand struct { Suggestion string `json:"suggestion"` Description string `json:"description"` }
func SuggestCommandFromJson ¶
func SuggestCommandFromJson(data io.Reader) *SuggestCommand
func (*SuggestCommand) ToJson ¶
func (o *SuggestCommand) ToJson() string
type SupportSettings ¶ added in v1.4.0
type System ¶
func SystemFromJson ¶
type Team ¶
type Team struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` DisplayName string `json:"display_name"` Name string `json:"name"` Email string `json:"email"` Type string `json:"type"` CompanyName string `json:"company_name"` AllowedDomains string `json:"allowed_domains"` InviteId string `json:"invite_id"` AllowOpenInvite bool `json:"allow_open_invite"` }
func TeamFromJson ¶
func (*Team) SanitizeForNotLoggedIn ¶
func (o *Team) SanitizeForNotLoggedIn()
type TeamMember ¶
type TeamMember struct { TeamId string `json:"team_id"` UserId string `json:"user_id"` Roles string `json:"roles"` DeleteAt int64 `json:"delete_at"` }
func TeamMemberFromJson ¶
func TeamMemberFromJson(data io.Reader) *TeamMember
func TeamMembersFromJson ¶
func TeamMembersFromJson(data io.Reader) []*TeamMember
func (*TeamMember) GetRoles ¶
func (o *TeamMember) GetRoles() []string
func (*TeamMember) IsValid ¶
func (o *TeamMember) IsValid() *AppError
func (*TeamMember) PreUpdate ¶
func (o *TeamMember) PreUpdate()
func (*TeamMember) ToJson ¶
func (o *TeamMember) ToJson() string
type TeamSettings ¶
type TeamSettings struct { SiteName string MaxUsersPerTeam int EnableTeamCreation bool EnableUserCreation bool EnableOpenServer *bool RestrictCreationToDomains string EnableCustomBrand *bool CustomBrandText *string CustomDescriptionText *string RestrictDirectMessage *string RestrictTeamInvite *string RestrictPublicChannelManagement *string RestrictPrivateChannelManagement *string UserStatusAwayTimeout *int64 MaxChannelsPerTeam *int64 }
type TeamSignup ¶
type TeamSignup struct { Team Team `json:"team"` User User `json:"user"` Invites []string `json:"invites"` Data string `json:"data"` Hash string `json:"hash"` }
func TeamSignupFromJson ¶
func TeamSignupFromJson(data io.Reader) *TeamSignup
func (*TeamSignup) ToJson ¶
func (o *TeamSignup) ToJson() string
type TeamStats ¶
type TeamStats struct { TeamId string `json:"team_id"` TotalMemberCount int64 `json:"total_member_count"` ActiveMemberCount int64 `json:"active_member_count"` }
func TeamStatsFromJson ¶
type User ¶
type User struct { Id string `json:"id"` CreateAt int64 `json:"create_at,omitempty"` UpdateAt int64 `json:"update_at,omitempty"` DeleteAt int64 `json:"delete_at"` Username string `json:"username"` Password string `json:"password,omitempty"` AuthData *string `json:"auth_data,omitempty"` AuthService string `json:"auth_service"` Email string `json:"email"` EmailVerified bool `json:"email_verified,omitempty"` Nickname string `json:"nickname"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Roles string `json:"roles"` AllowMarketing bool `json:"allow_marketing,omitempty"` Props StringMap `json:"props,omitempty"` NotifyProps StringMap `json:"notify_props,omitempty"` LastPasswordUpdate int64 `json:"last_password_update,omitempty"` LastPictureUpdate int64 `json:"last_picture_update,omitempty"` FailedAttempts int `json:"failed_attempts,omitempty"` Locale string `json:"locale"` MfaActive bool `json:"mfa_active,omitempty"` MfaSecret string `json:"mfa_secret,omitempty"` LastActivityAt int64 `db:"-" json:"last_activity_at,omitempty"` }
func UserFromJson ¶
UserFromJson will decode the input and return a User
func UserListFromJson ¶
func (*User) AddNotifyProp ¶
func (*User) ClearNonProfileFields ¶ added in v1.3.0
func (u *User) ClearNonProfileFields()
func (*User) GetDisplayName ¶
func (*User) GetDisplayNameForPreference ¶
func (*User) GetFullName ¶
func (*User) GetRawRoles ¶
func (*User) IsInRole ¶
Make sure you acually want to use this function. In context.go there are functions to check permissions This function should not be used to check permissions.
func (*User) IsLDAPUser ¶
func (*User) IsOAuthUser ¶
func (*User) IsValid ¶
IsValid validates the user and returns an error if it isn't configured correctly.
func (*User) MakeNonNil ¶
func (u *User) MakeNonNil()
func (*User) PreSave ¶
func (u *User) PreSave()
PreSave will set the Id and Username if missing. It will also fill in the CreateAt, UpdateAt times. It will also hash the password. It should be run before saving the user to the db.
func (*User) PreUpdate ¶
func (u *User) PreUpdate()
PreUpdate should be run before updating the user in the db.
func (*User) SanitizeProfile ¶
func (*User) SetDefaultNotifications ¶
func (u *User) SetDefaultNotifications()
func (*User) UpdateMentionKeysFromUsername ¶
type UserAutocompleteInChannel ¶
type UserAutocompleteInChannel struct { InChannel []*User `json:"in_channel"` OutOfChannel []*User `json:"out_of_channel"` }
func UserAutocompleteInChannelFromJson ¶
func UserAutocompleteInChannelFromJson(data io.Reader) *UserAutocompleteInChannel
func (*UserAutocompleteInChannel) ToJson ¶
func (o *UserAutocompleteInChannel) ToJson() string
type UserAutocompleteInTeam ¶
type UserAutocompleteInTeam struct {
InTeam []*User `json:"in_team"`
}
func UserAutocompleteInTeamFromJson ¶
func UserAutocompleteInTeamFromJson(data io.Reader) *UserAutocompleteInTeam
func (*UserAutocompleteInTeam) ToJson ¶
func (o *UserAutocompleteInTeam) ToJson() string
type UserSearch ¶
type UserSearch struct { Term string `json:"term"` TeamId string `json:"team_id"` InChannelId string `json:"in_channel_id"` NotInChannelId string `json:"not_in_channel_id"` AllowInactive bool `json:"allow_inactive"` }
func UserSearchFromJson ¶
func UserSearchFromJson(data io.Reader) *UserSearch
UserSearchFromJson will decode the input and return a User
func (*UserSearch) ToJson ¶
func (u *UserSearch) ToJson() string
ToJson convert a User to a json string
type WebSocketClient ¶
type WebSocketClient struct { Url string // The location of the server like "ws://localhost:8065" ApiUrl string // The api location of the server like "ws://localhost:8065/api/v3" Conn *websocket.Conn // The WebSocket connection AuthToken string // The token used to open the WebSocket Sequence int64 // The ever-incrementing sequence attached to each WebSocket action EventChannel chan *WebSocketEvent ResponseChannel chan *WebSocketResponse ListenError *AppError }
func (*WebSocketClient) Close ¶
func (wsc *WebSocketClient) Close()
func (*WebSocketClient) Connect ¶
func (wsc *WebSocketClient) Connect() *AppError
func (*WebSocketClient) GetStatuses ¶
func (wsc *WebSocketClient) GetStatuses()
GetStatuses will return a map of string statuses using user id as the key
func (*WebSocketClient) GetStatusesByIds ¶
func (wsc *WebSocketClient) GetStatusesByIds(userIds []string)
GetStatusesByIds will fetch certain user statuses based on ids and return a map of string statuses using user id as the key
func (*WebSocketClient) Listen ¶
func (wsc *WebSocketClient) Listen()
func (*WebSocketClient) SendMessage ¶
func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{})
func (*WebSocketClient) UserTyping ¶
func (wsc *WebSocketClient) UserTyping(channelId, parentId string)
UserTyping will push a user_typing event out to all connected users who are in the specified channel
type WebSocketEvent ¶
type WebSocketEvent struct { Event string `json:"event"` Data map[string]interface{} `json:"data"` Broadcast *WebsocketBroadcast `json:"broadcast"` PreComputeJson []byte `json:"-"` }
func NewWebSocketEvent ¶
func NewWebSocketEvent(event, teamId, channelId, userId string, omitUsers map[string]bool) *WebSocketEvent
func WebSocketEventFromJson ¶
func WebSocketEventFromJson(data io.Reader) *WebSocketEvent
func (*WebSocketEvent) Add ¶
func (m *WebSocketEvent) Add(key string, value interface{})
func (*WebSocketEvent) DoPreComputeJson ¶
func (o *WebSocketEvent) DoPreComputeJson()
func (*WebSocketEvent) GetPreComputeJson ¶
func (o *WebSocketEvent) GetPreComputeJson() []byte
func (*WebSocketEvent) IsValid ¶
func (o *WebSocketEvent) IsValid() bool
func (*WebSocketEvent) ToJson ¶
func (o *WebSocketEvent) ToJson() string
type WebSocketMessage ¶
type WebSocketRequest ¶
type WebSocketRequest struct { // Client-provided fields Seq int64 `json:"seq"` Action string `json:"action"` Data map[string]interface{} `json:"data"` // Server-provided fields Session Session `json:"-"` T goi18n.TranslateFunc `json:"-"` Locale string `json:"-"` }
func WebSocketRequestFromJson ¶
func WebSocketRequestFromJson(data io.Reader) *WebSocketRequest
func (*WebSocketRequest) ToJson ¶
func (o *WebSocketRequest) ToJson() string
type WebSocketResponse ¶
type WebSocketResponse struct { Status string `json:"status"` SeqReply int64 `json:"seq_reply,omitempty"` Data map[string]interface{} `json:"data,omitempty"` Error *AppError `json:"error,omitempty"` PreComputeJson []byte `json:"-"` }
func NewWebSocketError ¶
func NewWebSocketError(seqReply int64, err *AppError) *WebSocketResponse
func NewWebSocketResponse ¶
func NewWebSocketResponse(status string, seqReply int64, data map[string]interface{}) *WebSocketResponse
func WebSocketResponseFromJson ¶
func WebSocketResponseFromJson(data io.Reader) *WebSocketResponse
func (*WebSocketResponse) Add ¶
func (m *WebSocketResponse) Add(key string, value interface{})
func (*WebSocketResponse) DoPreComputeJson ¶
func (o *WebSocketResponse) DoPreComputeJson()
func (*WebSocketResponse) GetPreComputeJson ¶
func (o *WebSocketResponse) GetPreComputeJson() []byte
func (*WebSocketResponse) IsValid ¶
func (o *WebSocketResponse) IsValid() bool
func (*WebSocketResponse) ToJson ¶
func (o *WebSocketResponse) ToJson() string
type WebrtcSettings ¶
type WebsocketBroadcast ¶
type WebsocketBroadcast struct { OmitUsers map[string]bool `json:"omit_users"` // broadcast is omitted for users listed here UserId string `json:"user_id"` // broadcast only occurs for this user ChannelId string `json:"channel_id"` // broadcast only occurs for users in this channel TeamId string `json:"team_id"` // broadcast only occurs for users in this team }
Source Files ¶
- access.go
- analytics_row.go
- audit.go
- audits.go
- authorization.go
- authorize.go
- autocomplete.go
- channel.go
- channel_count.go
- channel_data.go
- channel_list.go
- channel_member.go
- channel_stats.go
- client.go
- cluster_info.go
- command.go
- command_response.go
- compliance.go
- compliance_post.go
- config.go
- emoji.go
- file.go
- file_info.go
- gitlab.go
- incoming_webhook.go
- initial_load.go
- job.go
- ldap.go
- license.go
- oauth.go
- outgoing_webhook.go
- password_recovery.go
- post.go
- post_list.go
- preference.go
- preferences.go
- push_notification.go
- saml.go
- search_params.go
- security_bulletin.go
- session.go
- status.go
- suggest_command.go
- system.go
- team.go
- team_member.go
- team_signup.go
- team_stats.go
- user.go
- user_search.go
- utils.go
- version.go
- webrtc.go
- websocket_client.go
- websocket_message.go
- websocket_request.go