Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayFromInterface(data interface{}) []string
- func ArrayFromJson(data io.Reader) []string
- func ArrayToJson(objmap []string) string
- func CheckBool(t *testing.T, got bool, expected bool)
- func CheckFalse(t *testing.T, test bool)
- func CheckInt(t *testing.T, got int, expected int)
- func CheckInt64(t *testing.T, got int64, expected int64)
- func CheckStatusOK(r *http.Response) bool
- func CheckString(t *testing.T, got string, expected string)
- func CheckTrue(t *testing.T, test bool)
- 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 GetGroupDisplayNameFromUsers(users []*User, truncate bool) string
- func GetGroupNameFromUserIds(userIds []string) 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 IsSendEmailValid(sendEmail string) bool
- func IsValidAlphaNum(s string) bool
- func IsValidAlphaNumHyphenUnderscore(s string, withFormat 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 JobStatusesToJson(statuses []*JobStatus) string
- func MapBoolFromJson(data io.Reader) map[string]bool
- func MapBoolToJson(objmap map[string]bool) string
- 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 NewWebSocketClient4(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 ReactionsToJson(o []*Reaction) string
- func RoleIdsToString(roles []string) string
- func SessionsToJson(o []*Session) string
- func SplitVersion(version string) (int64, int64, int64)
- func StatusListToJson(u []*Status) string
- func StatusMapToInterfaceMap(statusMap map[string]*Status) map[string]interface{}
- 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 TeamListToJson(t []*Team) string
- func TeamMapFromJson(data io.Reader) map[string]*Team
- func TeamMapToJson(u map[string]*Team) string
- func TeamMembersToJson(o []*TeamMember) string
- func TeamsUnreadToJson(o []*TeamUnread) 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 AnalyticsSettings
- type AnnouncementSettings
- type AppError
- func AppErrorFromJson(data io.Reader) *AppError
- func InvalidUserError(fieldName string, userId string) *AppError
- func NewAppError(where string, id string, params map[string]interface{}, details string, ...) *AppError
- func NewLocAppError(where string, id string, params map[string]interface{}, details string) *AppError
- type Audit
- type Audits
- type AuthData
- type AuthorizeRequest
- type Channel
- func (o *Channel) Etag() string
- func (o *Channel) ExtraUpdated()
- func (o *Channel) IsGroupOrDirect() bool
- func (o *Channel) IsValid() *AppError
- func (o *Channel) Patch(patch *ChannelPatch)
- func (o *Channel) PreSave()
- func (o *Channel) PreUpdate()
- func (o *Channel) StatsEtag() string
- func (o *Channel) ToJson() string
- type ChannelCounts
- type ChannelData
- type ChannelList
- type ChannelMember
- type ChannelMembers
- type ChannelPatch
- type ChannelSearch
- type ChannelStats
- type ChannelUnread
- type ChannelView
- 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) AutocompleteChannels(term string) (*Result, *AppError)
- func (c *Client) AutocompleteUsers(term 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) (*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) CreateGroupChannel(userIds []string) (*Result, *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) 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) DeleteReaction(channelId string, reaction *Reaction) *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) GetByEmail(email string, etag string) (*User, *ResponseMetadata)
- func (c *Client) GetByUsername(username string, etag string) (*Result, *AppError)
- func (c *Client) GetChannel(id, etag string) (*Result, *AppError)
- func (c *Client) GetChannelByName(channelName string) (*Result, *AppError)
- func (c *Client) GetChannelCounts(etag string) (*Result, *AppError)
- func (c *Client) GetChannelMember(channelId string, userId string) (*Result, *AppError)
- func (c *Client) GetChannelMembersByIds(channelId string, userIds []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) GetMoreChannelsPage(offset int, limit int) (*Result, *AppError)
- func (c *Client) GetMyChannelMembers() (*Result, *AppError)
- func (c *Client) GetMyTeam(etag string) (*Result, *AppError)
- func (c *Client) GetMyTeamMembers() (*Result, *AppError)
- func (c *Client) GetMyTeamsUnread(teamId 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) GetPermalink(channelId string, postId string, etag string) (*PostList, *ResponseMetadata)
- func (c *Client) GetPing() (map[string]string, *AppError)
- func (c *Client) GetPinnedPosts(channelId string) (*Result, *AppError)
- func (c *Client) GetPost(channelId string, postId string, etag string) (*Result, *AppError)
- func (c *Client) GetPostById(postId string, etag string) (*PostList, *ResponseMetadata)
- 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) GetTeamByName(teamName 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) InvalidateAllCaches() (bool, *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) ListReactions(channelId string, postId string) ([]*Reaction, *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) PinPost(channelId string, postId 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) SaveReaction(channelId string, reaction *Reaction) (*Reaction, *AppError)
- func (c *Client) SearchMoreChannels(channelSearch ChannelSearch) (*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) SetOAuthToken(token string)
- func (c *Client) SetPreferences(preferences *Preferences) (*Result, *AppError)
- func (c *Client) SetTeamId(teamId string)
- func (c *Client) TestEmail(config *Config) (*Result, *AppError)
- func (c *Client) TestLdap(config *Config) (*Result, *AppError)
- func (c *Client) UnpinPost(channelId string, postId string) (*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) UpdateChannelRoles(channelId string, userId string, roles string) (map[string]string, *ResponseMetadata)
- func (c *Client) UpdateCommand(cmd *Command) (*Result, *AppError)
- func (c *Client) UpdateIncomingWebhook(hook *IncomingWebhook) (*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) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*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)
- func (c *Client) ViewChannel(params ChannelView) (bool, *ResponseMetadata)
- type Client4
- func (c *Client4) AddChannelMember(channelId, userId string) (*ChannelMember, *Response)
- func (c *Client4) AddTeamMember(teamId, userId, hash, dataToHash, inviteId string) (*TeamMember, *Response)
- func (c *Client4) AddTeamMembers(teamId string, userIds []string) ([]*TeamMember, *Response)
- func (c *Client4) AttachDeviceId(deviceId string) (bool, *Response)
- func (c *Client4) AuthorizeOAuthApp(authRequest *AuthorizeRequest) (string, *Response)
- func (c *Client4) AutocompleteUsers(username string, etag string) (*UserAutocomplete, *Response)
- func (c *Client4) AutocompleteUsersInChannel(teamId string, channelId string, username string, etag string) (*UserAutocomplete, *Response)
- func (c *Client4) AutocompleteUsersInTeam(teamId string, username string, etag string) (*UserAutocomplete, *Response)
- func (c *Client4) CheckUserMfa(loginId string) (bool, *Response)
- func (c *Client4) ClearOAuthToken()
- func (c *Client4) CreateChannel(channel *Channel) (*Channel, *Response)
- func (c *Client4) CreateCommand(cmd *Command) (*Command, *Response)
- func (c *Client4) CreateComplianceReport(report *Compliance) (*Compliance, *Response)
- func (c *Client4) CreateDirectChannel(userId1, userId2 string) (*Channel, *Response)
- func (c *Client4) CreateEmoji(emoji *Emoji, image []byte, filename string) (*Emoji, *Response)
- func (c *Client4) CreateGroupChannel(userIds []string) (*Channel, *Response)
- func (c *Client4) CreateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response)
- func (c *Client4) CreateOAuthApp(app *OAuthApp) (*OAuthApp, *Response)
- func (c *Client4) CreateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response)
- func (c *Client4) CreatePost(post *Post) (*Post, *Response)
- func (c *Client4) CreateTeam(team *Team) (*Team, *Response)
- func (c *Client4) CreateUser(user *User) (*User, *Response)
- func (c *Client4) CreateUserWithHash(user *User, hash, data string) (*User, *Response)
- func (c *Client4) CreateUserWithInviteId(user *User, inviteId string) (*User, *Response)
- func (c *Client4) DatabaseRecycle() (bool, *Response)
- func (c *Client4) DeauthorizeOAuthApp(appId string) (bool, *Response)
- func (c *Client4) DeleteChannel(channelId string) (bool, *Response)
- func (c *Client4) DeleteCommand(commandId string) (bool, *Response)
- func (c *Client4) DeleteEmoji(emojiId string) (bool, *Response)
- func (c *Client4) DeleteIncomingWebhook(hookID string) (bool, *Response)
- func (c *Client4) DeleteOAuthApp(appId string) (bool, *Response)
- func (c *Client4) DeleteOutgoingWebhook(hookId string) (bool, *Response)
- func (c *Client4) DeletePost(postId string) (bool, *Response)
- func (c *Client4) DeletePreferences(userId string, preferences *Preferences) (bool, *Response)
- func (c *Client4) DeleteReaction(reaction *Reaction) (bool, *Response)
- func (c *Client4) DeleteSamlIdpCertificate() (bool, *Response)
- func (c *Client4) DeleteSamlPrivateCertificate() (bool, *Response)
- func (c *Client4) DeleteSamlPublicCertificate() (bool, *Response)
- func (c *Client4) DeleteUser(userId string) (bool, *Response)
- func (c *Client4) DoApiDelete(url string) (*http.Response, *AppError)
- func (c *Client4) DoApiGet(url string, etag string) (*http.Response, *AppError)
- func (c *Client4) DoApiPost(url string, data string) (*http.Response, *AppError)
- func (c *Client4) DoApiPut(url string, data string) (*http.Response, *AppError)
- func (c *Client4) DoApiRequest(method, url, data, etag string) (*http.Response, *AppError)
- func (c *Client4) DoEmojiUploadFile(url string, data []byte, contentType string) (*Emoji, *Response)
- func (c *Client4) DoUploadFile(url string, data []byte, contentType string) (*FileUploadResponse, *Response)
- func (c *Client4) DoUploadImportTeam(url string, data []byte, contentType string) ([]byte, *Response)
- func (c *Client4) DownloadComplianceReport(reportId string) ([]byte, *Response)
- func (c *Client4) ExecuteCommand(channelId, command string) (*CommandResponse, *Response)
- func (c *Client4) GenerateMfaSecret(userId string) (*MfaSecret, *Response)
- func (c *Client4) GetAllTeams(etag string, page int, perPage int) ([]*Team, *Response)
- func (c *Client4) GetAudits(page int, perPage int, etag string) (Audits, *Response)
- func (c *Client4) GetAuthorizedOAuthAppsForUser(userId string, page, perPage int) ([]*OAuthApp, *Response)
- func (c *Client4) GetBrandImage() ([]byte, *Response)
- func (c *Client4) GetBrandRoute() string
- func (c *Client4) GetCacheRoute() string
- func (c *Client4) GetChannel(channelId, etag string) (*Channel, *Response)
- func (c *Client4) GetChannelByName(channelName, teamId string, etag string) (*Channel, *Response)
- func (c *Client4) GetChannelByNameForTeamName(channelName, teamName string, etag string) (*Channel, *Response)
- func (c *Client4) GetChannelByNameForTeamNameRoute(channelName, teamName string) string
- func (c *Client4) GetChannelByNameRoute(channelName, teamId string) string
- func (c *Client4) GetChannelMember(channelId, userId, etag string) (*ChannelMember, *Response)
- func (c *Client4) GetChannelMemberRoute(channelId, userId string) string
- func (c *Client4) GetChannelMembers(channelId string, page, perPage int, etag string) (*ChannelMembers, *Response)
- func (c *Client4) GetChannelMembersByIds(channelId string, userIds []string) (*ChannelMembers, *Response)
- func (c *Client4) GetChannelMembersForUser(userId, teamId, etag string) (*ChannelMembers, *Response)
- func (c *Client4) GetChannelMembersRoute(channelId string) string
- func (c *Client4) GetChannelRoute(channelId string) string
- func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats, *Response)
- func (c *Client4) GetChannelUnread(channelId, userId string) (*ChannelUnread, *Response)
- func (c *Client4) GetChannelsForTeamForUser(teamId, userId, etag string) ([]*Channel, *Response)
- func (c *Client4) GetChannelsForTeamRoute(teamId string) string
- func (c *Client4) GetChannelsRoute() string
- func (c *Client4) GetClusterRoute() string
- func (c *Client4) GetClusterStatus() ([]*ClusterInfo, *Response)
- func (c *Client4) GetCommandRoute(commandId string) string
- func (c *Client4) GetCommandsRoute() string
- func (c *Client4) GetComplianceReport(reportId string) (*Compliance, *Response)
- func (c *Client4) GetComplianceReportRoute(reportId string) string
- func (c *Client4) GetComplianceReports(page, perPage int) (Compliances, *Response)
- func (c *Client4) GetComplianceReportsRoute() string
- func (c *Client4) GetConfig() (*Config, *Response)
- func (c *Client4) GetConfigRoute() string
- func (c *Client4) GetDatabaseRoute() string
- func (c *Client4) GetDeletedChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response)
- func (c *Client4) GetEmoji(emojiId string) (*Emoji, *Response)
- func (c *Client4) GetEmojiImage(emojiId string) ([]byte, *Response)
- func (c *Client4) GetEmojiList() ([]*Emoji, *Response)
- func (c *Client4) GetEmojiRoute(emojiId string) string
- func (c *Client4) GetEmojisRoute() string
- func (c *Client4) GetFile(fileId string) ([]byte, *Response)
- func (c *Client4) GetFileInfo(fileId string) (*FileInfo, *Response)
- func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response)
- func (c *Client4) GetFileLink(fileId string) (string, *Response)
- func (c *Client4) GetFilePreview(fileId string) ([]byte, *Response)
- func (c *Client4) GetFileRoute(fileId string) string
- func (c *Client4) GetFileThumbnail(fileId string) ([]byte, *Response)
- func (c *Client4) GetFilesRoute() string
- func (c *Client4) GetFlaggedPostsForUser(userId string, page int, perPage int) (*PostList, *Response)
- func (c *Client4) GetFlaggedPostsForUserInChannel(userId string, channelId string, page int, perPage int) (*PostList, *Response)
- func (c *Client4) GetFlaggedPostsForUserInTeam(userId string, teamId string, page int, perPage int) (*PostList, *Response)
- func (c *Client4) GetIncomingWebhook(hookID string, etag string) (*IncomingWebhook, *Response)
- func (c *Client4) GetIncomingWebhookRoute(hookID string) string
- func (c *Client4) GetIncomingWebhooks(page int, perPage int, etag string) ([]*IncomingWebhook, *Response)
- func (c *Client4) GetIncomingWebhooksForTeam(teamId string, page int, perPage int, etag string) ([]*IncomingWebhook, *Response)
- func (c *Client4) GetIncomingWebhooksRoute() string
- func (c *Client4) GetJobStatus(id string) (*JobStatus, *Response)
- func (c *Client4) GetJobStatusesByType(jobType string, page int, perPage int) ([]*JobStatus, *Response)
- func (c *Client4) GetJobsRoute() string
- func (c *Client4) GetLdapRoute() string
- func (c *Client4) GetLicenseRoute() string
- func (c *Client4) GetLogs(page, perPage int) ([]string, *Response)
- func (c *Client4) GetMe(etag string) (*User, *Response)
- func (c *Client4) GetOAuthApp(appId string) (*OAuthApp, *Response)
- func (c *Client4) GetOAuthAppInfo(appId string) (*OAuthApp, *Response)
- func (c *Client4) GetOAuthAppRoute(appId string) string
- func (c *Client4) GetOAuthApps(page, perPage int) ([]*OAuthApp, *Response)
- func (c *Client4) GetOAuthAppsRoute() string
- func (c *Client4) GetOldClientConfig(etag string) (map[string]string, *Response)
- func (c *Client4) GetOldClientLicense(etag string) (map[string]string, *Response)
- func (c *Client4) GetOpenGraphRoute() string
- func (c *Client4) GetOutgoingWebhook(hookId string) (*OutgoingWebhook, *Response)
- func (c *Client4) GetOutgoingWebhookRoute(hookID string) string
- func (c *Client4) GetOutgoingWebhooks(page int, perPage int, etag string) ([]*OutgoingWebhook, *Response)
- func (c *Client4) GetOutgoingWebhooksForChannel(channelId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response)
- func (c *Client4) GetOutgoingWebhooksForTeam(teamId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response)
- func (c *Client4) GetOutgoingWebhooksRoute() string
- func (c *Client4) GetPing() (string, *Response)
- func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Response)
- func (c *Client4) GetPost(postId string, etag string) (*Post, *Response)
- func (c *Client4) GetPostRoute(postId string) string
- func (c *Client4) GetPostThread(postId string, etag string) (*PostList, *Response)
- func (c *Client4) GetPostsAfter(channelId, postId string, page, perPage int, etag string) (*PostList, *Response)
- func (c *Client4) GetPostsBefore(channelId, postId string, page, perPage int, etag string) (*PostList, *Response)
- func (c *Client4) GetPostsForChannel(channelId string, page, perPage int, etag string) (*PostList, *Response)
- func (c *Client4) GetPostsRoute() string
- func (c *Client4) GetPostsSince(channelId string, time int64) (*PostList, *Response)
- func (c *Client4) GetPreferenceByCategoryAndName(userId string, category string, preferenceName string) (*Preference, *Response)
- func (c *Client4) GetPreferences(userId string) (Preferences, *Response)
- func (c *Client4) GetPreferencesByCategory(userId string, category string) (Preferences, *Response)
- func (c *Client4) GetPreferencesRoute(userId string) string
- func (c *Client4) GetProfileImage(userId, etag string) ([]byte, *Response)
- func (c *Client4) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) ([]*Channel, *Response)
- func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response)
- func (c *Client4) GetReactions(postId string) ([]*Reaction, *Response)
- func (c *Client4) GetReactionsRoute() string
- func (c *Client4) GetSamlCertificateStatus() (*SamlCertificateStatus, *Response)
- func (c *Client4) GetSamlMetadata() (string, *Response)
- func (c *Client4) GetSamlRoute() string
- func (c *Client4) GetSessions(userId, etag string) ([]*Session, *Response)
- func (c *Client4) GetSystemRoute() string
- func (c *Client4) GetTeam(teamId, etag string) (*Team, *Response)
- func (c *Client4) GetTeamAutoCompleteCommandsRoute(teamId string) string
- func (c *Client4) GetTeamByName(name, etag string) (*Team, *Response)
- func (c *Client4) GetTeamByNameRoute(teamName string) string
- func (c *Client4) GetTeamImportRoute(teamId string) string
- func (c *Client4) GetTeamMember(teamId, userId, etag string) (*TeamMember, *Response)
- func (c *Client4) GetTeamMemberRoute(teamId, userId string) string
- func (c *Client4) GetTeamMembers(teamId string, page int, perPage int, etag string) ([]*TeamMember, *Response)
- func (c *Client4) GetTeamMembersByIds(teamId string, userIds []string) ([]*TeamMember, *Response)
- func (c *Client4) GetTeamMembersForUser(userId string, etag string) ([]*TeamMember, *Response)
- func (c *Client4) GetTeamMembersRoute(teamId string) string
- func (c *Client4) GetTeamRoute(teamId string) string
- func (c *Client4) GetTeamStats(teamId, etag string) (*TeamStats, *Response)
- func (c *Client4) GetTeamStatsRoute(teamId string) string
- func (c *Client4) GetTeamUnread(teamId, userId string) (*TeamUnread, *Response)
- func (c *Client4) GetTeamsForUser(userId, etag string) ([]*Team, *Response)
- func (c *Client4) GetTeamsRoute() string
- func (c *Client4) GetTeamsUnreadForUser(userId, teamIdToExclude string) ([]*TeamUnread, *Response)
- func (c *Client4) GetTestEmailRoute() string
- func (c *Client4) GetUser(userId, etag string) (*User, *Response)
- func (c *Client4) GetUserAudits(userId string, page int, perPage int, etag string) (Audits, *Response)
- func (c *Client4) GetUserByEmail(email, etag string) (*User, *Response)
- func (c *Client4) GetUserByEmailRoute(email string) string
- func (c *Client4) GetUserByUsername(userName, etag string) (*User, *Response)
- func (c *Client4) GetUserByUsernameRoute(userName string) string
- func (c *Client4) GetUserRoute(userId string) string
- func (c *Client4) GetUserStatus(userId, etag string) (*Status, *Response)
- func (c *Client4) GetUserStatusRoute(userId string) string
- func (c *Client4) GetUserStatusesRoute() string
- func (c *Client4) GetUsers(page int, perPage int, etag string) ([]*User, *Response)
- func (c *Client4) GetUsersByIds(userIds []string) ([]*User, *Response)
- func (c *Client4) GetUsersByUsernames(usernames []string) ([]*User, *Response)
- func (c *Client4) GetUsersInChannel(channelId string, page int, perPage int, etag string) ([]*User, *Response)
- func (c *Client4) GetUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)
- func (c *Client4) GetUsersNotInChannel(teamId, channelId string, page int, perPage int, etag string) ([]*User, *Response)
- func (c *Client4) GetUsersNotInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response)
- func (c *Client4) GetUsersRoute() string
- func (c *Client4) GetUsersStatusesByIds(userIds []string) ([]*Status, *Response)
- func (c *Client4) GetUsersWithoutTeam(page int, perPage int, etag string) ([]*User, *Response)
- func (c *Client4) GetWebrtcToken() (*WebrtcInfoResponse, *Response)
- func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, teamId string) ([]byte, *Response)
- func (c *Client4) InvalidateCaches() (bool, *Response)
- func (c *Client4) InviteUsersToTeam(teamId string, userEmails []string) (bool, *Response)
- func (c *Client4) ListAutocompleteCommands(teamId string) ([]*Command, *Response)
- func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Response)
- func (c *Client4) Login(loginId string, password string) (*User, *Response)
- func (c *Client4) LoginById(id string, password string) (*User, *Response)
- func (c *Client4) LoginByLdap(loginId string, password string) (*User, *Response)
- func (c *Client4) LoginWithDevice(loginId string, password string, deviceId string) (*User, *Response)
- func (c *Client4) Logout() (bool, *Response)
- func (c *Client4) OpenGraph(url string) (map[string]string, *Response)
- func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel, *Response)
- func (c *Client4) PatchPost(postId string, patch *PostPatch) (*Post, *Response)
- func (c *Client4) PatchTeam(teamId string, patch *TeamPatch) (*Team, *Response)
- func (c *Client4) PatchUser(userId string, patch *UserPatch) (*User, *Response)
- func (c *Client4) PinPost(postId string) (bool, *Response)
- func (c *Client4) PostLog(message map[string]string) (map[string]string, *Response)
- func (c *Client4) RegenCommandToken(commandId string) (string, *Response)
- func (c *Client4) RegenOutgoingHookToken(hookId string) (*OutgoingWebhook, *Response)
- func (c *Client4) RegenerateOAuthAppSecret(appId string) (*OAuthApp, *Response)
- func (c *Client4) ReloadConfig() (bool, *Response)
- func (c *Client4) RemoveTeamMember(teamId, userId string) (bool, *Response)
- func (c *Client4) RemoveUserFromChannel(channelId, userId string) (bool, *Response)
- func (c *Client4) ResetPassword(token, newPassword string) (bool, *Response)
- func (c *Client4) RestoreChannel(channelId string) (*Channel, *Response)
- func (c *Client4) RevokeSession(userId, sessionId string) (bool, *Response)
- func (c *Client4) SaveReaction(reaction *Reaction) (*Reaction, *Response)
- func (c *Client4) SearchChannels(teamId string, search *ChannelSearch) ([]*Channel, *Response)
- func (c *Client4) SearchPosts(teamId string, terms string, isOrSearch bool) (*PostList, *Response)
- func (c *Client4) SearchTeams(search *TeamSearch) ([]*Team, *Response)
- func (c *Client4) SearchUsers(search *UserSearch) ([]*User, *Response)
- func (c *Client4) SendPasswordResetEmail(email string) (bool, *Response)
- func (c *Client4) SendVerificationEmail(email string) (bool, *Response)
- func (c *Client4) SetOAuthToken(token string)
- func (c *Client4) SetProfileImage(userId string, data []byte) (bool, *Response)
- func (c *Client4) SoftDeleteTeam(teamId string) (bool, *Response)
- func (c *Client4) SwitchAccountType(switchRequest *SwitchRequest) (string, *Response)
- func (c *Client4) SyncLdap() (bool, *Response)
- func (c *Client4) TeamExists(name, etag string) (bool, *Response)
- func (c *Client4) TestEmail() (bool, *Response)
- func (c *Client4) TestLdap() (bool, *Response)
- func (c *Client4) UnpinPost(postId string) (bool, *Response)
- func (c *Client4) UpdateChannel(channel *Channel) (*Channel, *Response)
- func (c *Client4) UpdateChannelNotifyProps(channelId, userId string, props map[string]string) (bool, *Response)
- func (c *Client4) UpdateChannelRoles(channelId, userId, roles string) (bool, *Response)
- func (c *Client4) UpdateCommand(cmd *Command) (*Command, *Response)
- func (c *Client4) UpdateConfig(config *Config) (*Config, *Response)
- func (c *Client4) UpdateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response)
- func (c *Client4) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response)
- func (c *Client4) UpdatePost(postId string, post *Post) (*Post, *Response)
- func (c *Client4) UpdatePreferences(userId string, preferences *Preferences) (bool, *Response)
- func (c *Client4) UpdateTeam(team *Team) (*Team, *Response)
- func (c *Client4) UpdateTeamMemberRoles(teamId, userId, newRoles string) (bool, *Response)
- func (c *Client4) UpdateUser(user *User) (*User, *Response)
- func (c *Client4) UpdateUserActive(userId string, active bool) (bool, *Response)
- func (c *Client4) UpdateUserMfa(userId, code string, activate bool) (bool, *Response)
- func (c *Client4) UpdateUserPassword(userId, currentPassword, newPassword string) (bool, *Response)
- func (c *Client4) UpdateUserRoles(userId, roles string) (bool, *Response)
- func (c *Client4) UpdateUserStatus(userId string, userStatus *Status) (*Status, *Response)
- func (c *Client4) UploadBrandImage(data []byte) (bool, *Response)
- func (c *Client4) UploadFile(data []byte, channelId string, filename string) (*FileUploadResponse, *Response)
- func (c *Client4) UploadSamlIdpCertificate(data []byte, filename string) (bool, *Response)
- func (c *Client4) UploadSamlPrivateCertificate(data []byte, filename string) (bool, *Response)
- func (c *Client4) UploadSamlPublicCertificate(data []byte, filename string) (bool, *Response)
- func (c *Client4) VerifyUserEmail(token string) (bool, *Response)
- func (c *Client4) ViewChannel(userId string, view *ChannelView) (bool, *Response)
- type ClusterInfo
- type ClusterSettings
- type ClusterStats
- type Command
- type CommandArgs
- type CommandResponse
- type Compliance
- type CompliancePost
- type ComplianceSettings
- type Compliances
- type Config
- type Customer
- type DataRetentionSettings
- type ElasticSearchSettings
- 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 Job
- type JobStatus
- type LdapSettings
- type License
- type LicenseRecord
- type LocalizationSettings
- type LogSettings
- type MetricsSettings
- type MfaSecret
- type NativeAppSettings
- type OAuthApp
- type OutgoingWebhook
- type OutgoingWebhookPayload
- type PasswordSettings
- type Permission
- type Post
- type PostList
- type PostPatch
- type Preference
- type Preferences
- type PrivacySettings
- type PushNotification
- type PushResponse
- type RateLimitSettings
- type Reaction
- type Response
- type ResponseMetadata
- type Result
- type Role
- type SSOSettings
- type SamlAuthRequest
- type SamlCertificateStatus
- 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 SlackAttachment
- type SlackAttachmentField
- type SqlSettings
- type Status
- type StringArray
- type StringInterface
- type StringMap
- type SuggestCommand
- type SupportSettings
- type SwitchRequest
- type System
- type TaskFunc
- type Team
- type TeamMember
- type TeamPatch
- type TeamSearch
- type TeamSettings
- type TeamStats
- type TeamUnread
- type Token
- 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) IsSSOUser() bool
- func (u *User) IsValid() *AppError
- func (u *User) MakeNonNil()
- func (u *User) Patch(patch *UserPatch)
- 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 UserAutocomplete
- type UserAutocompleteInChannel
- type UserAutocompleteInTeam
- type UserPatch
- 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 WebrtcInfoResponse
- 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" CHANNEL_GROUP = "G" CHANNEL_GROUP_MAX_USERS = 8 CHANNEL_GROUP_MIN_USERS = 3 DEFAULT_CHANNEL = "town-square" CHANNEL_DISPLAY_NAME_MAX_RUNES = 64 CHANNEL_NAME_MIN_LENGTH = 2 CHANNEL_NAME_MAX_LENGTH = 64 CHANNEL_HEADER_MAX_RUNES = 1024 CHANNEL_PURPOSE_MAX_RUNES = 250 CHANNEL_CACHE_SIZE = 25000 )
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" STATUS_REMOVE = "REMOVE" CLIENT_DIR = "webapp/dist" API_URL_SUFFIX_V1 = "/api/v1" API_URL_SUFFIX_V3 = "/api/v3" API_URL_SUFFIX_V4 = "/api/v4" API_URL_SUFFIX = API_URL_SUFFIX_V4 )
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_CHANNEL_ADMIN = "channel_admin" PERMISSIONS_TEAM_ADMIN = "team_admin" PERMISSIONS_SYSTEM_ADMIN = "system_admin" FAKE_SETTING = "********************************" RESTRICT_EMOJI_CREATION_ALL = "all" RESTRICT_EMOJI_CREATION_ADMIN = "admin" RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin" PERMISSIONS_DELETE_POST_ALL = "all" PERMISSIONS_DELETE_POST_TEAM_ADMIN = "team_admin" PERMISSIONS_DELETE_POST_SYSTEM_ADMIN = "system_admin" ALLOW_EDIT_POST_ALWAYS = "always" ALLOW_EDIT_POST_NEVER = "never" ALLOW_EDIT_POST_TIME_LIMIT = "time_limit" EMAIL_BATCHING_BUFFER_SIZE = 256 EMAIL_BATCHING_INTERVAL = 30 SITENAME_MAX_LENGTH = 30 SERVICE_SETTINGS_DEFAULT_SITE_URL = "" SERVICE_SETTINGS_DEFAULT_TLS_CERT_FILE = "" SERVICE_SETTINGS_DEFAULT_TLS_KEY_FILE = "" SERVICE_SETTINGS_DEFAULT_READ_TIMEOUT = 300 SERVICE_SETTINGS_DEFAULT_WRITE_TIMEOUT = 300 SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM = "" TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT = "" TEAM_SETTINGS_DEFAULT_CUSTOM_DESCRIPTION_TEXT = "" TEAM_SETTINGS_DEFAULT_USER_STATUS_AWAY_TIMEOUT = 300 EMAIL_SETTINGS_DEFAULT_FEEDBACK_ORGANIZATION = "" SUPPORT_SETTINGS_DEFAULT_TERMS_OF_SERVICE_LINK = "https://about.mattermost.com/default-terms/" SUPPORT_SETTINGS_DEFAULT_PRIVACY_POLICY_LINK = "https://about.mattermost.com/default-privacy-policy/" SUPPORT_SETTINGS_DEFAULT_ABOUT_LINK = "https://about.mattermost.com/default-about/" SUPPORT_SETTINGS_DEFAULT_HELP_LINK = "https://about.mattermost.com/default-help/" SUPPORT_SETTINGS_DEFAULT_REPORT_A_PROBLEM_LINK = "https://about.mattermost.com/default-report-a-problem/" SUPPORT_SETTINGS_DEFAULT_ADMINISTRATORS_GUIDE_LINK = "https://about.mattermost.com/administrators-guide/" SUPPORT_SETTINGS_DEFAULT_TROUBLESHOOTING_FORUM_LINK = "https://about.mattermost.com/troubleshooting-forum/" SUPPORT_SETTINGS_DEFAULT_COMMERCIAL_SUPPORT_LINK = "https://about.mattermost.com/commercial-support/" SUPPORT_SETTINGS_DEFAULT_SUPPORT_EMAIL = "feedback@mattermost.com" LDAP_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_ID_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_POSITION_ATTRIBUTE = "" LDAP_SETTINGS_DEFAULT_LOGIN_FIELD_NAME = "" SAML_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE = "" SAML_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE = "" SAML_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE = "" SAML_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE = "" SAML_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE = "" SAML_SETTINGS_DEFAULT_LOCALE_ATTRIBUTE = "" SAML_SETTINGS_DEFAULT_POSITION_ATTRIBUTE = "" NATIVEAPP_SETTINGS_DEFAULT_APP_DOWNLOAD_LINK = "https://about.mattermost.com/downloads/" NATIVEAPP_SETTINGS_DEFAULT_ANDROID_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-android-app/" NATIVEAPP_SETTINGS_DEFAULT_IOS_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-ios-app/" WEBRTC_SETTINGS_DEFAULT_STUN_URI = "" WEBRTC_SETTINGS_DEFAULT_TURN_URI = "" ANALYTICS_SETTINGS_DEFAULT_MAX_USERS_FOR_STATISTICS = 2500 )
const ( JOB_TYPE_DATA_RETENTION = "data_retention" JOB_TYPE_SEARCH_INDEXING = "search_indexing" )
const ( USER_AUTH_SERVICE_LDAP = "ldap" LDAP_SYNC_TASK_NAME = "LDAP Syncronization" )
const ( EXPIRED_LICENSE_ERROR = "api.license.add_license.expired.app_error" INVALID_LICENSE_ERROR = "api.license.add_license.invalid.app_error" )
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 ( POST_SYSTEM_MESSAGE_PREFIX = "system_" POST_DEFAULT = "" POST_SLACK_ATTACHMENT = "slack_attachment" POST_SYSTEM_GENERIC = "system_generic" POST_JOIN_LEAVE = "system_join_leave" // Deprecated, use POST_JOIN_CHANNEL or POST_LEAVE_CHANNEL instead POST_JOIN_CHANNEL = "system_join_channel" POST_LEAVE_CHANNEL = "system_leave_channel" 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_REMOVE_FROM_CHANNEL = "system_remove_from_channel" POST_HEADER_CHANGE = "system_header_change" POST_DISPLAYNAME_CHANGE = "system_displayname_change" POST_PURPOSE_CHANGE = "system_purpose_change" POST_CHANNEL_DELETED = "system_channel_deleted" POST_EPHEMERAL = "system_ephemeral" POST_FILEIDS_MAX_RUNES = 150 POST_FILENAMES_MAX_RUNES = 4000 POST_HASHTAGS_MAX_RUNES = 1000 POST_MESSAGE_MAX_RUNES = 4000 POST_PROPS_MAX_RUNES = 8000 )
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_NAME_LAST_TEAM = "team" 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_NOTIFY_APPLE_REACT_NATIVE = "apple_rn" PUSH_NOTIFY_ANDROID_REACT_NATIVE = "android_rn" PUSH_TYPE_MESSAGE = "message" PUSH_TYPE_CLEAR = "clear" CATEGORY_DM = "DIRECT_MESSAGE" MHPNS = "https://push.mattermost.com" )
const ( PUSH_STATUS = "status" PUSH_STATUS_OK = "OK" PUSH_STATUS_FAIL = "FAIL" PUSH_STATUS_REMOVE = "REMOVE" PUSH_STATUS_ERROR_MSG = "error" )
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_COOKIE_USER = "MMUSERID" SESSION_CACHE_SIZE = 35000 SESSION_PROP_PLATFORM = "platform" SESSION_PROP_OS = "os" SESSION_PROP_BROWSER = "browser" SESSION_ACTIVITY_TIMEOUT = 1000 * 60 * 5 // 5 minutes )
const ( STATUS_OFFLINE = "offline" STATUS_AWAY = "away" STATUS_ONLINE = "online" STATUS_CACHE_SIZE = SESSION_CACHE_SIZE 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" TEAM_ALLOWED_DOMAINS_MAX_LENGTH = 500 TEAM_COMPANY_NAME_MAX_LENGTH = 64 TEAM_DESCRIPTION_MAX_LENGTH = 255 TEAM_DISPLAY_NAME_MAX_RUNES = 64 TEAM_EMAIL_MAX_LENGTH = 128 TEAM_NAME_MAX_LENGTH = 64 TEAM_NAME_MIN_LENGTH = 2 )
const ( TOKEN_SIZE = 64 MAX_TOKEN_EXIPRY_TIME = 1000 * 60 * 60 * 24 // 24 hour TOKEN_TYPE_OAUTH = "oauth" )
const ( ME = "me" USER_NOTIFY_ALL = "all" USER_NOTIFY_MENTION = "mention" USER_NOTIFY_NONE = "none" DESKTOP_NOTIFY_PROP = "desktop" MARK_UNREAD_NOTIFY_PROP = "mark_unread" PUSH_NOTIFY_PROP = "push" EMAIL_NOTIFY_PROP = "email" DEFAULT_LOCALE = "en" USER_AUTH_SERVICE_EMAIL = "email" USER_EMAIL_MAX_LENGTH = 128 USER_NICKNAME_MAX_RUNES = 64 USER_POSITION_MAX_RUNES = 64 USER_FIRST_NAME_MAX_RUNES = 64 USER_LAST_NAME_MAX_RUNES = 64 USER_AUTH_DATA_MAX_LENGTH = 128 USER_NAME_MAX_LENGTH = 64 USER_NAME_MIN_LENGTH = 1 USER_PASSWORD_MAX_LENGTH = 72 )
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_CREATED = "channel_created" 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_USER_ADDED = "user_added" WEBSOCKET_EVENT_USER_UPDATED = "user_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_EVENT_WEBRTC = "webrtc" WEBSOCKET_AUTHENTICATION_CHALLENGE = "authentication_challenge" WEBSOCKET_EVENT_REACTION_ADDED = "reaction_added" WEBSOCKET_EVENT_REACTION_REMOVED = "reaction_removed" WEBSOCKET_EVENT_RESPONSE = "response" )
const (
DEFAULT_WEBHOOK_USERNAME = "webhook"
)
const (
MaxImageSize = 6048 * 4032 // 24 megapixels, roughly 36MB as a raw image
)
const (
SOCKET_MAX_MESSAGE_SIZE_KB = 8 * 1024 // 8KB
)
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 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 ¶ added in v3.5.0
func ArrayFromInterface(data interface{}) []string
func ArrayFromJson ¶
func ArrayToJson ¶
func CheckFalse ¶ added in v3.9.0
func CheckStatusOK ¶ added in v3.7.0
CheckStatusOK is a convenience function for checking the standard OK response from the web service.
func CleanTeamName ¶
func CleanUsername ¶
func ClearMentionTags ¶
func ClusterInfosToJson ¶ added in v3.3.0
func ClusterInfosToJson(objmap []*ClusterInfo) string
func CommandListToJson ¶
func ComparePassword ¶
ComparePassword compares the hash
func CompliancePostHeader ¶
func CompliancePostHeader() []string
func EmojiListToJson ¶ added in v3.2.0
func FileInfosToJson ¶ added in v3.5.0
func GetAllTasks ¶ added in v3.1.0
func GetAllTasks() *map[string]*ScheduledTask
func GetDMNameFromIds ¶
func GetEtagForFileInfos ¶ added in v3.5.0
func GetGroupDisplayNameFromUsers ¶ added in v3.7.0
func GetGroupNameFromUserIds ¶ added in v3.7.0
func GetImageMimeType ¶
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 ¶ added in v3.5.0
func InitalizePermissions()
func InitalizeRoles ¶ added in v3.5.0
func InitalizeRoles()
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 ¶
func IsOfficalBuild() bool
func IsReservedTeamName ¶
func IsSafeLink ¶
func IsSendEmailValid ¶ added in v3.7.0
func IsValidAlphaNum ¶
func IsValidAlphaNumHyphenUnderscore ¶ added in v3.9.0
func IsValidEmail ¶
func IsValidHttpUrl ¶
func IsValidHttpsUrl ¶
func IsValidTeamName ¶
func IsValidTurnOrStunServer ¶ added in v3.5.0
func IsValidUserRoles ¶
func IsValidUsername ¶
func IsValidWebsocketUrl ¶ added in v3.5.0
func JobStatusesToJson ¶ added in v3.10.0
func MapBoolFromJson ¶ added in v3.8.0
MapFromJson will decode the key/value pair map
func MapBoolToJson ¶ added in v3.8.0
MapToJson converts a map to a json string
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 ¶
func NewWebSocketClient ¶ added in v3.3.0
func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError)
NewWebSocketClient constructs a new WebSocket client with convienence methods for talking to the server.
func NewWebSocketClient4 ¶ added in v3.8.0
func NewWebSocketClient4(url, authToken string) (*WebSocketClient, *AppError)
NewWebSocketClient4 constructs a new WebSocket client with convienence methods for talking to the server. Uses the v4 endpoint.
func OAuthAppListToJson ¶ added in v3.3.0
func OAuthAppMapToJson ¶
func OutgoingWebhookListToJson ¶
func OutgoingWebhookListToJson(l []*OutgoingWebhook) string
func ParseHashtags ¶
func ReactionsToJson ¶ added in v3.6.0
func RoleIdsToString ¶ added in v3.5.0
func SessionsToJson ¶
func StatusListToJson ¶ added in v3.8.0
func StatusMapToInterfaceMap ¶ added in v3.6.0
func StringFromJson ¶
func StringInterfaceFromJson ¶
func StringInterfaceToJson ¶
func StringToJson ¶
func TeamListToJson ¶ added in v3.7.0
func TeamMapToJson ¶
func TeamMembersToJson ¶
func TeamMembersToJson(o []*TeamMember) string
func TeamsUnreadToJson ¶ added in v3.6.0
func TeamsUnreadToJson(o []*TeamUnread) string
func UserListToJson ¶ added in v3.5.0
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"` Scope string `json:"scope"` }
func AccessDataFromJson ¶
func AccessDataFromJson(data io.Reader) *AccessData
func (*AccessData) IsExpired ¶ added in v3.3.0
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 ¶
func AnalyticsRowFromJson ¶
func AnalyticsRowFromJson(data io.Reader) *AnalyticsRow
func (*AnalyticsRow) ToJson ¶
func (me *AnalyticsRow) ToJson() string
type AnalyticsRows ¶
type AnalyticsRows []*AnalyticsRow
func AnalyticsRowsFromJson ¶
func AnalyticsRowsFromJson(data io.Reader) AnalyticsRows
func (AnalyticsRows) ToJson ¶
func (me AnalyticsRows) ToJson() string
type AnalyticsSettings ¶ added in v3.6.0
type AnalyticsSettings struct {
MaxUsersForStatistics *int
}
type AnnouncementSettings ¶ added in v3.10.0
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 InvalidUserError ¶ added in v3.9.0
func NewAppError ¶ added in v3.7.0
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 AuthorizeRequest ¶ added in v3.9.0
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 ¶ added in v3.9.0
func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest
func (*AuthorizeRequest) IsValid ¶ added in v3.9.0
func (ar *AuthorizeRequest) IsValid() *AppError
IsValid validates the AuthorizeRequest and returns an error if it isn't configured correctly.
func (*AuthorizeRequest) ToJson ¶ added in v3.9.0
func (ar *AuthorizeRequest) ToJson() string
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 ChannelSliceFromJson ¶ added in v3.10.0
func (*Channel) ExtraUpdated ¶
func (o *Channel) ExtraUpdated()
func (*Channel) IsGroupOrDirect ¶ added in v3.7.0
func (*Channel) Patch ¶ added in v3.8.0
func (o *Channel) Patch(patch *ChannelPatch)
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 ¶ added in v3.5.0
func (o *ChannelMember) GetRoles() []string
func (*ChannelMember) IsValid ¶
func (o *ChannelMember) IsValid() *AppError
func (*ChannelMember) PreSave ¶
func (o *ChannelMember) PreSave()
func (*ChannelMember) PreUpdate ¶
func (o *ChannelMember) PreUpdate()
func (*ChannelMember) ToJson ¶
func (o *ChannelMember) ToJson() string
type ChannelMembers ¶ added in v3.5.0
type ChannelMembers []ChannelMember
func ChannelMembersFromJson ¶ added in v3.5.0
func ChannelMembersFromJson(data io.Reader) *ChannelMembers
func (*ChannelMembers) ToJson ¶ added in v3.5.0
func (o *ChannelMembers) ToJson() string
type ChannelPatch ¶ added in v3.8.0
type ChannelPatch struct { DisplayName *string `json:"display_name"` Name *string `json:"name"` Header *string `json:"header"` Purpose *string `json:"purpose"` }
func ChannelPatchFromJson ¶ added in v3.8.0
func ChannelPatchFromJson(data io.Reader) *ChannelPatch
func (*ChannelPatch) ToJson ¶ added in v3.8.0
func (o *ChannelPatch) ToJson() string
type ChannelSearch ¶ added in v3.6.0
type ChannelSearch struct {
Term string `json:"term"`
}
func ChannelSearchFromJson ¶ added in v3.6.0
func ChannelSearchFromJson(data io.Reader) *ChannelSearch
ChannelSearchFromJson will decode the input and return a Channel
func (*ChannelSearch) ToJson ¶ added in v3.6.0
func (c *ChannelSearch) ToJson() string
ToJson convert a Channel to a json string
type ChannelStats ¶ added in v3.5.0
type ChannelStats struct { ChannelId string `json:"channel_id"` MemberCount int64 `json:"member_count"` }
func ChannelStatsFromJson ¶ added in v3.5.0
func ChannelStatsFromJson(data io.Reader) *ChannelStats
func (*ChannelStats) ToJson ¶ added in v3.5.0
func (o *ChannelStats) ToJson() string
type ChannelUnread ¶ added in v3.6.0
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 ¶ added in v3.8.0
func ChannelUnreadFromJson(data io.Reader) *ChannelUnread
func (*ChannelUnread) ToJson ¶ added in v3.8.0
func (o *ChannelUnread) ToJson() string
type ChannelView ¶ added in v3.6.0
type ChannelView struct { ChannelId string `json:"channel_id"` PrevChannelId string `json:"prev_channel_id"` }
func ChannelViewFromJson ¶ added in v3.6.0
func ChannelViewFromJson(data io.Reader) *ChannelView
func (*ChannelView) ToJson ¶ added in v3.6.0
func (o *ChannelView) 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) AutocompleteChannels ¶ added in v3.6.0
AutocompleteChannels will return a list of open channels that match the provided string. Must be authenticated.
func (*Client) AutocompleteUsers ¶ added in v3.6.0
AutocompleteUsers returns a list for autocompletion of users on the system that match the provided term, matching against username, full name and nickname. Must be authenticated.
func (*Client) AutocompleteUsersInChannel ¶ added in v3.5.0
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 ¶ added in v3.5.0
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 ¶ added in v3.1.0
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 ¶ added in v3.2.0
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) CreateGroupChannel ¶ added in v3.7.0
func (*Client) CreateIncomingWebhook ¶
func (c *Client) CreateIncomingWebhook(hook *IncomingWebhook) (*Result, *AppError)
func (*Client) CreateOutgoingWebhook ¶
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) 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 ¶ added in v3.2.0
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 ¶ added in v3.3.0
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 ¶
func (*Client) DeletePost ¶
func (*Client) DeletePreferences ¶ added in v3.3.0
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) DeleteReaction ¶ added in v3.6.0
Removes an emoji reaction for a post in the given channel. Returns nil if successful, otherwise returns an AppError.
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 ¶ added in v3.5.0
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 ¶
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) GetByEmail ¶ added in v3.6.0
func (c *Client) GetByEmail(email string, etag string) (*User, *ResponseMetadata)
getByEmail returns a user based on a provided username string. Must be authenticated.
func (*Client) GetByUsername ¶ added in v3.6.0
getByUsername returns a user based on a provided username string. Must be authenticated.
func (*Client) GetChannelByName ¶ added in v3.6.0
func (*Client) GetChannelCounts ¶
func (*Client) GetChannelMember ¶ added in v3.5.0
func (*Client) GetChannelMembersByIds ¶ added in v3.6.0
GetChannelMembersByIds will return channel member objects as an array based on the channel id and a list of user ids provided. Must be authenticated.
func (*Client) GetChannelNameRoute ¶
func (*Client) GetChannelRoute ¶
func (*Client) GetChannelStats ¶ added in v3.5.0
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 ¶ added in v3.3.0
func (c *Client) GetClusterStatus() ([]*ClusterInfo, *AppError)
func (*Client) GetComplianceReports ¶
func (*Client) GetCustomEmojiImageUrl ¶ added in v3.2.0
GetCustomEmojiImageUrl returns the API route that can be used to get the image used by the given emoji.
func (*Client) GetEmojiRoute ¶ added in v3.2.0
func (*Client) GetFileInfosForPost ¶ added in v3.5.0
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 ¶ added in v3.5.0
func (c *Client) GetFilePreview(fileId string) (io.ReadCloser, *AppError)
func (*Client) GetFileRoute ¶ added in v3.5.0
func (*Client) GetFileThumbnail ¶ added in v3.5.0
func (c *Client) GetFileThumbnail(fileId string) (io.ReadCloser, *AppError)
func (*Client) GetFlaggedPosts ¶ added in v3.3.0
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 ¶ added in v3.1.0
func (*Client) GetInitialLoad ¶
func (*Client) GetMoreChannelsPage ¶ added in v3.6.0
GetMoreChannelsPage will return a page of open channels the user is not in based on the provided offset and limit. Must be authenticated.
func (*Client) GetMyChannelMembers ¶ added in v3.5.0
func (*Client) GetMyTeamMembers ¶ added in v3.6.0
GetMyTeamMembers will return an array with team member objects that the current user is a member of. Must be authenticated.
func (*Client) GetMyTeamsUnread ¶ added in v3.6.0
GetMyTeamsUnread 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 (*Client) GetOAuthAppInfo ¶ added in v3.3.0
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 ¶ added in v3.3.0
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 ¶ added in v3.4.0
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) GetPermalink ¶ added in v3.7.0
func (c *Client) GetPermalink(channelId string, postId string, etag string) (*PostList, *ResponseMetadata)
GetPermalink returns a post list, based on the provided channel and post ID.
func (*Client) GetPing ¶ added in v3.1.0
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) GetPinnedPosts ¶ added in v3.8.0
func (*Client) GetPostById ¶ added in v3.6.0
func (c *Client) GetPostById(postId string, etag string) (*PostList, *ResponseMetadata)
GetPostById returns a post and any posts in the same thread by post id
func (*Client) GetPostsAfter ¶
func (*Client) GetPostsBefore ¶
func (*Client) GetPostsSince ¶
func (*Client) GetPreference ¶
func (*Client) GetPreferenceCategory ¶
func (*Client) GetProfiles ¶
GetProfiles returns a map of users using user id as the key. Must be authenticated.
func (*Client) GetProfilesByIds ¶ added in v3.5.0
GetProfilesByIds returns a map of users based on the user ids provided. Must be authenticated.
func (*Client) GetProfilesInChannel ¶ added in v3.5.0
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 ¶ added in v3.5.0
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 ¶ added in v3.5.0
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 ¶ added in v3.4.0
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 ¶ added in v3.5.0
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) GetTeamByName ¶ added in v3.6.0
GetTeamByName will return a team object based on the team name provided. Must be authenticated.
func (*Client) GetTeamMember ¶ added in v3.5.0
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 ¶ added in v3.5.0
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 ¶ added in v3.5.0
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 ¶ added in v3.5.0
func (*Client) GetWebrtcToken ¶ added in v3.5.0
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) InvalidateAllCaches ¶ added in v3.6.0
func (*Client) InviteMembers ¶
func (*Client) JoinChannelByName ¶
func (*Client) LdapSyncNow ¶ added in v3.2.0
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) ListEmoji ¶ added in v3.2.0
ListEmoji returns a list of all user-created emoji for the server.
func (*Client) ListIncomingWebhooks ¶
func (*Client) ListOutgoingWebhooks ¶
func (*Client) ListReactions ¶ added in v3.6.0
Lists all emoji reactions made for the given post in the given channel. Returns a list of Reactions if successful, otherwise returns an AppError.
func (*Client) ListTeamCommands ¶
func (*Client) LogClient ¶ added in v3.1.0
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 ¶ added in v3.2.0
MustGeneric is a convenience function used for testing.
func (*Client) OAuthDeauthorizeApp ¶ added in v3.4.0
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 ¶ added in v3.1.0
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 ¶
func (*Client) RegenerateOAuthAppSecret ¶ added in v3.4.0
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 ¶ added in v3.1.0
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 ¶ added in v3.3.0
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 ¶ added in v3.2.0
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 ¶ added in v3.3.0
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) SaveReaction ¶ added in v3.6.0
Saves an emoji reaction for a post in the given channel. Returns the saved reaction if successful, otherwise returns an AppError.
func (*Client) SearchMoreChannels ¶ added in v3.6.0
func (c *Client) SearchMoreChannels(channelSearch ChannelSearch) (*Result, *AppError)
SearchMoreChannels will return a list of open channels the user is not in, that matches the search criteria provided. Must be authenticated.
func (*Client) SearchPosts ¶
func (*Client) SearchUsers ¶ added in v3.5.0
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) SetOAuthToken ¶
func (*Client) SetPreferences ¶
func (c *Client) SetPreferences(preferences *Preferences) (*Result, *AppError)
func (*Client) TestLdap ¶ added in v3.4.0
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 ¶
func (*Client) UpdateChannelPurpose ¶
func (*Client) UpdateChannelRoles ¶ added in v3.7.0
func (c *Client) UpdateChannelRoles(channelId string, userId string, roles string) (map[string]string, *ResponseMetadata)
Updates the user's roles in the channel by replacing them with the roles provided.
func (*Client) UpdateCommand ¶ added in v3.6.0
func (*Client) UpdateIncomingWebhook ¶ added in v3.7.0
func (c *Client) UpdateIncomingWebhook(hook *IncomingWebhook) (*Result, *AppError)
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 ¶
func (*Client) UpdateOutgoingWebhook ¶ added in v3.7.0
func (c *Client) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*Result, *AppError)
func (*Client) UpdateTeam ¶
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 ¶ added in v3.5.0
func (*Client) UpdateUserNotify ¶
func (*Client) UpdateUserPassword ¶
func (*Client) UpdateUserRoles ¶
func (*Client) UploadCertificateFile ¶ added in v3.3.0
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 ¶
func (*Client) UploadProfileFile ¶
func (*Client) ViewChannel ¶ added in v3.6.0
func (c *Client) ViewChannel(params ChannelView) (bool, *ResponseMetadata)
ViewChannel performs all the actions related to viewing a channel. This includes marking the channel and the previous one as read, and marking the channel as being actively viewed. ChannelId is required but may be blank to indicate no channel is being viewed. PrevChannelId is optional, populate to indicate a channel switch occurred.
type Client4 ¶ added in v3.7.0
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 }
func NewAPIv4Client ¶ added in v3.7.0
func (*Client4) AddChannelMember ¶ added in v3.8.0
func (c *Client4) AddChannelMember(channelId, userId string) (*ChannelMember, *Response)
AddChannelMember adds user to channel and return a channel member.
func (*Client4) AddTeamMember ¶ added in v3.8.0
func (c *Client4) AddTeamMember(teamId, userId, hash, dataToHash, inviteId string) (*TeamMember, *Response)
AddTeamMember adds user to a team and return a team member.
func (*Client4) AddTeamMembers ¶ added in v3.8.0
func (c *Client4) AddTeamMembers(teamId string, userIds []string) ([]*TeamMember, *Response)
AddTeamMember adds a number of users to a team and returns the team members.
func (*Client4) AttachDeviceId ¶ added in v3.8.0
AttachDeviceId attaches a mobile device ID to the current session.
func (*Client4) AuthorizeOAuthApp ¶ added in v3.9.0
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) AutocompleteUsers ¶ added in v3.8.0
func (c *Client4) AutocompleteUsers(username string, etag string) (*UserAutocomplete, *Response)
AutocompleteUsers returns the users in the system based on search term.
func (*Client4) AutocompleteUsersInChannel ¶ added in v3.8.0
func (c *Client4) AutocompleteUsersInChannel(teamId string, channelId string, username string, etag string) (*UserAutocomplete, *Response)
AutocompleteUsersInChannel returns the users in a channel based on search term.
func (*Client4) AutocompleteUsersInTeam ¶ added in v3.8.0
func (c *Client4) AutocompleteUsersInTeam(teamId string, username string, etag string) (*UserAutocomplete, *Response)
AutocompleteUsersInTeam returns the users on a team based on search term.
func (*Client4) CheckUserMfa ¶ added in v3.8.0
CheckUserMfa checks whether a user has MFA active on their account or not based on the provided login id.
func (*Client4) ClearOAuthToken ¶ added in v3.7.0
func (c *Client4) ClearOAuthToken()
func (*Client4) CreateChannel ¶ added in v3.7.0
CreateChannel creates a channel based on the provided channel struct.
func (*Client4) CreateCommand ¶ added in v3.8.0
CreateCommand will create a new command if the user have the right permissions.
func (*Client4) CreateComplianceReport ¶ added in v3.8.0
func (c *Client4) CreateComplianceReport(report *Compliance) (*Compliance, *Response)
CreateComplianceReport creates an incoming webhook for a channel.
func (*Client4) CreateDirectChannel ¶ added in v3.7.0
CreateDirectChannel creates a direct message channel based on the two user ids provided.
func (*Client4) CreateEmoji ¶ added in v3.9.0
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 ¶ added in v3.9.0
CreateGroupChannel creates a group message channel based on userIds provided
func (*Client4) CreateIncomingWebhook ¶ added in v3.7.0
func (c *Client4) CreateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response)
CreateIncomingWebhook creates an incoming webhook for a channel.
func (*Client4) CreateOAuthApp ¶ added in v3.9.0
CreateOAuthApp will register a new OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.
func (*Client4) CreateOutgoingWebhook ¶ added in v3.8.0
func (c *Client4) CreateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response)
CreateOutgoingWebhook creates an outgoing webhook for a team or channel.
func (*Client4) CreatePost ¶ added in v3.7.0
CreatePost creates a post based on the provided post struct.
func (*Client4) CreateTeam ¶ added in v3.7.0
CreateTeam creates a team in the system based on the provided team struct.
func (*Client4) CreateUser ¶ added in v3.7.0
CreateUser creates a user in the system based on the provided user struct.
func (*Client4) CreateUserWithHash ¶ added in v3.10.0
CreateUserWithHash creates a user in the system based on the provided user struct and hash created.
func (*Client4) CreateUserWithInviteId ¶ added in v3.10.0
CreateUserWithInviteId creates a user in the system based on the provided invited id.
func (*Client4) DatabaseRecycle ¶ added in v3.8.0
DatabaseRecycle will recycle the connections. Discard current connection and get new one.
func (*Client4) DeauthorizeOAuthApp ¶ added in v3.9.0
DeauthorizeOAuthApp will deauthorize an OAuth 2.0 client application from accessing a user's account.
func (*Client4) DeleteChannel ¶ added in v3.8.0
DeleteChannel deletes channel based on the provided channel id string.
func (*Client4) DeleteCommand ¶ added in v3.9.0
DeleteCommand deletes a command based on the provided command id string
func (*Client4) DeleteEmoji ¶ added in v3.9.0
DeleteEmoji delete an custom emoji on the provided emoji id string.
func (*Client4) DeleteIncomingWebhook ¶ added in v3.8.0
DeleteIncomingWebhook deletes and Incoming Webhook given the hook ID
func (*Client4) DeleteOAuthApp ¶ added in v3.9.0
DeleteOAuthApp deletes a registered OAuth 2.0 client application.
func (*Client4) DeleteOutgoingWebhook ¶ added in v3.8.0
DeleteOutgoingWebhook delete the outgoing webhook on the system requested by Hook Id.
func (*Client4) DeletePost ¶ added in v3.7.0
DeletePost deletes a post from the provided post id string.
func (*Client4) DeletePreferences ¶ added in v3.7.0
func (c *Client4) DeletePreferences(userId string, preferences *Preferences) (bool, *Response)
DeletePreferences deletes the user's preferences.
func (*Client4) DeleteReaction ¶ added in v3.9.0
DeleteReaction deletes reaction of a user in a post.
func (*Client4) DeleteSamlIdpCertificate ¶ added in v3.8.0
DeleteSamlIdpCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.
func (*Client4) DeleteSamlPrivateCertificate ¶ added in v3.8.0
DeleteSamlPrivateCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.
func (*Client4) DeleteSamlPublicCertificate ¶ added in v3.8.0
DeleteSamlPublicCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.
func (*Client4) DeleteUser ¶ added in v3.7.0
DeleteUser deactivates a user in the system based on the provided user id string.
func (*Client4) DoApiDelete ¶ added in v3.7.0
func (*Client4) DoApiRequest ¶ added in v3.7.0
func (*Client4) DoEmojiUploadFile ¶ added in v3.9.0
func (*Client4) DoUploadFile ¶ added in v3.7.0
func (*Client4) DoUploadImportTeam ¶ added in v3.8.0
func (*Client4) DownloadComplianceReport ¶ added in v3.8.0
DownloadComplianceReport returns a full compliance report as a file.
func (*Client4) ExecuteCommand ¶ added in v3.9.0
func (c *Client4) ExecuteCommand(channelId, command string) (*CommandResponse, *Response)
ExecuteCommand executes a given command.
func (*Client4) GenerateMfaSecret ¶ added in v3.8.0
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) GetAllTeams ¶ added in v3.7.0
GetAllTeams returns all teams based on permissions.
func (*Client4) GetAudits ¶ added in v3.7.0
GetAudits returns a list of audits for the whole system.
func (*Client4) GetAuthorizedOAuthAppsForUser ¶ added in v3.9.0
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) GetBrandImage ¶ added in v3.8.0
GetBrandImage retrieves the previously uploaded brand image.
func (*Client4) GetBrandRoute ¶ added in v3.8.0
func (*Client4) GetCacheRoute ¶ added in v3.8.0
func (*Client4) GetChannel ¶ added in v3.7.0
GetChannel returns a channel based on the provided channel id string.
func (*Client4) GetChannelByName ¶ added in v3.7.0
GetChannelByName returns a channel based on the provided channel name and team id strings.
func (*Client4) GetChannelByNameForTeamName ¶ added in v3.7.0
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) GetChannelByNameForTeamNameRoute ¶ added in v3.7.0
func (*Client4) GetChannelByNameRoute ¶ added in v3.7.0
func (*Client4) GetChannelMember ¶ added in v3.7.0
func (c *Client4) GetChannelMember(channelId, userId, etag string) (*ChannelMember, *Response)
GetChannelMember gets a channel member.
func (*Client4) GetChannelMemberRoute ¶ added in v3.7.0
func (*Client4) GetChannelMembers ¶ added in v3.7.0
func (c *Client4) GetChannelMembers(channelId string, page, perPage int, etag string) (*ChannelMembers, *Response)
GetChannelMembers gets a page of channel members.
func (*Client4) GetChannelMembersByIds ¶ added in v3.8.0
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 ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (*Client4) GetChannelRoute ¶ added in v3.7.0
func (*Client4) GetChannelStats ¶ added in v3.8.0
func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats, *Response)
GetChannelStats returns statistics for a channel.
func (*Client4) GetChannelUnread ¶ added in v3.8.0
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) GetChannelsForTeamForUser ¶ added in v3.8.0
GetChannelsForTeamForUser returns a list channels of on a team for a user.
func (*Client4) GetChannelsForTeamRoute ¶ added in v3.8.0
func (*Client4) GetChannelsRoute ¶ added in v3.7.0
func (*Client4) GetClusterRoute ¶ added in v3.8.0
func (*Client4) GetClusterStatus ¶ added in v3.8.0
func (c *Client4) GetClusterStatus() ([]*ClusterInfo, *Response)
GetClusterStatus returns the status of all the configured cluster nodes.
func (*Client4) GetCommandRoute ¶ added in v3.9.0
func (*Client4) GetCommandsRoute ¶ added in v3.8.0
func (*Client4) GetComplianceReport ¶ added in v3.8.0
func (c *Client4) GetComplianceReport(reportId string) (*Compliance, *Response)
GetComplianceReport returns a compliance report.
func (*Client4) GetComplianceReportRoute ¶ added in v3.8.0
func (*Client4) GetComplianceReports ¶ added in v3.8.0
func (c *Client4) GetComplianceReports(page, perPage int) (Compliances, *Response)
GetComplianceReports returns list of compliance reports.
func (*Client4) GetComplianceReportsRoute ¶ added in v3.8.0
func (*Client4) GetConfig ¶ added in v3.8.0
GetConfig will retrieve the server config with some sanitized items.
func (*Client4) GetConfigRoute ¶ added in v3.8.0
func (*Client4) GetDatabaseRoute ¶ added in v3.8.0
func (*Client4) GetDeletedChannelsForTeam ¶ added in v3.10.0
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) GetEmoji ¶ added in v3.9.0
GetEmoji returns a custom emoji in the system on the provided emoji id string.
func (*Client4) GetEmojiImage ¶ added in v3.9.0
GetEmojiImage returns the emoji image.
func (*Client4) GetEmojiList ¶ added in v3.9.0
GetEmojiList returns a list of custom emoji in the system.
func (*Client4) GetEmojiRoute ¶ added in v3.9.0
func (*Client4) GetEmojisRoute ¶ added in v3.9.0
func (*Client4) GetFileInfo ¶ added in v3.8.0
GetFileInfo gets all the file info objects.
func (*Client4) GetFileInfosForPost ¶ added in v3.7.0
GetFileInfosForPost gets all the file info objects attached to a post.
func (*Client4) GetFileLink ¶ added in v3.8.0
GetFileLink gets the public link of a file by id.
func (*Client4) GetFilePreview ¶ added in v3.8.0
GetFilePreview gets the bytes for a file by id.
func (*Client4) GetFileRoute ¶ added in v3.7.0
func (*Client4) GetFileThumbnail ¶ added in v3.7.0
GetFileThumbnail gets the bytes for a file by id.
func (*Client4) GetFilesRoute ¶ added in v3.7.0
func (*Client4) GetFlaggedPostsForUser ¶ added in v3.9.0
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 ¶ added in v3.9.0
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 ¶ added in v3.9.0
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) GetIncomingWebhook ¶ added in v3.8.0
func (c *Client4) GetIncomingWebhook(hookID string, etag string) (*IncomingWebhook, *Response)
GetIncomingWebhook returns an Incoming webhook given the hook ID
func (*Client4) GetIncomingWebhookRoute ¶ added in v3.8.0
func (*Client4) GetIncomingWebhooks ¶ added in v3.7.0
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 ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (*Client4) GetJobStatus ¶ added in v3.10.0
GetJobStatus gets the status of a single job.
func (*Client4) GetJobStatusesByType ¶ added in v3.10.0
func (c *Client4) GetJobStatusesByType(jobType string, page int, perPage int) ([]*JobStatus, *Response)
GetJobStatusesByType gets the status of all jobs of a given type, sorted with the job that most recently started first.
func (*Client4) GetJobsRoute ¶ added in v3.10.0
func (*Client4) GetLdapRoute ¶ added in v3.8.0
func (*Client4) GetLicenseRoute ¶ added in v3.8.0
func (*Client4) GetOAuthApp ¶ added in v3.9.0
GetOAuthApp gets a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.
func (*Client4) GetOAuthAppInfo ¶ added in v3.9.0
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 ¶ added in v3.9.0
func (*Client4) GetOAuthApps ¶ added in v3.9.0
GetOAuthApps gets a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider.
func (*Client4) GetOAuthAppsRoute ¶ added in v3.9.0
func (*Client4) GetOldClientConfig ¶ added in v3.8.0
GetOldClientConfig will retrieve the parts of the server configuration needed by the client, formatted in the old format.
func (*Client4) GetOldClientLicense ¶ added in v3.8.0
GetOldClientLicense will retrieve the parts of the server license needed by the client, formatted in the old format.
func (*Client4) GetOpenGraphRoute ¶ added in v3.10.0
func (*Client4) GetOutgoingWebhook ¶ added in v3.8.0
func (c *Client4) GetOutgoingWebhook(hookId string) (*OutgoingWebhook, *Response)
GetOutgoingWebhook outgoing webhooks on the system requested by Hook Id.
func (*Client4) GetOutgoingWebhookRoute ¶ added in v3.8.0
func (*Client4) GetOutgoingWebhooks ¶ added in v3.8.0
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 ¶ added in v3.8.0
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 ¶ added in v3.8.0
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 ¶ added in v3.8.0
func (*Client4) GetPing ¶ added in v3.7.0
GetPing will return ok if the running goRoutines are below the threshold and unhealthy for above.
func (*Client4) GetPinnedPosts ¶ added in v3.8.0
GetPinnedPosts gets a list of pinned posts.
func (*Client4) GetPostRoute ¶ added in v3.7.0
func (*Client4) GetPostThread ¶ added in v3.7.0
GetPostThread gets a post with all the other posts in the same thread.
func (*Client4) GetPostsAfter ¶ added in v3.8.0
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) GetPostsBefore ¶ added in v3.8.0
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) GetPostsForChannel ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (*Client4) GetPostsSince ¶ added in v3.8.0
GetPostsSince gets posts created after a specified time as Unix time in milliseconds.
func (*Client4) GetPreferenceByCategoryAndName ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (c *Client4) GetPreferences(userId string) (Preferences, *Response)
GetPreferences returns the user's preferences.
func (*Client4) GetPreferencesByCategory ¶ added in v3.7.0
func (c *Client4) GetPreferencesByCategory(userId string, category string) (Preferences, *Response)
GetPreferencesByCategory returns the user's preferences from the provided category string.
func (*Client4) GetPreferencesRoute ¶ added in v3.7.0
func (*Client4) GetProfileImage ¶ added in v3.7.0
GetProfileImage gets user's profile image. Must be logged in or be a system administrator.
func (*Client4) GetPublicChannelsByIdsForTeam ¶ added in v3.8.0
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 ¶ added in v3.8.0
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) GetReactions ¶ added in v3.9.0
GetReactions returns a list of reactions to a post.
func (*Client4) GetReactionsRoute ¶ added in v3.9.0
func (*Client4) GetSamlCertificateStatus ¶ added in v3.8.0
func (c *Client4) GetSamlCertificateStatus() (*SamlCertificateStatus, *Response)
GetSamlCertificateStatus returns metadata for the SAML configuration.
func (*Client4) GetSamlMetadata ¶ added in v3.8.0
GetSamlMetadata returns metadata for the SAML configuration.
func (*Client4) GetSamlRoute ¶ added in v3.8.0
func (*Client4) GetSessions ¶ added in v3.7.0
GetSessions returns a list of sessions based on the provided user id string.
func (*Client4) GetSystemRoute ¶ added in v3.7.0
func (*Client4) GetTeam ¶ added in v3.7.0
GetTeam returns a team based on the provided team id string.
func (*Client4) GetTeamAutoCompleteCommandsRoute ¶ added in v3.8.0
func (*Client4) GetTeamByName ¶ added in v3.7.0
GetTeamByName returns a team based on the provided team name string.
func (*Client4) GetTeamByNameRoute ¶ added in v3.7.0
func (*Client4) GetTeamImportRoute ¶ added in v3.8.0
func (*Client4) GetTeamMember ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (*Client4) GetTeamMembers ¶ added in v3.7.0
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 ¶ added in v3.8.0
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 ¶ added in v3.8.0
func (c *Client4) GetTeamMembersForUser(userId string, etag string) ([]*TeamMember, *Response)
GetTeamMembersForUser returns the team members for a user.
func (*Client4) GetTeamMembersRoute ¶ added in v3.7.0
func (*Client4) GetTeamRoute ¶ added in v3.7.0
func (*Client4) GetTeamStats ¶ added in v3.7.0
GetTeamStats returns a team stats based on the team id string. Must be authenticated.
func (*Client4) GetTeamStatsRoute ¶ added in v3.7.0
func (*Client4) GetTeamUnread ¶ added in v3.8.0
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) GetTeamsForUser ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (*Client4) GetTeamsUnreadForUser ¶ added in v3.7.0
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) GetTestEmailRoute ¶ added in v3.8.0
func (*Client4) GetUser ¶ added in v3.7.0
GetUser returns a user based on the provided user id string.
func (*Client4) GetUserAudits ¶ added in v3.8.0
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 ¶ added in v3.7.0
GetUserByEmail returns a user based on the provided user email string.
func (*Client4) GetUserByEmailRoute ¶ added in v3.7.0
func (*Client4) GetUserByUsername ¶ added in v3.7.0
GetUserByUsername returns a user based on the provided user name string.
func (*Client4) GetUserByUsernameRoute ¶ added in v3.7.0
func (*Client4) GetUserRoute ¶ added in v3.7.0
func (*Client4) GetUserStatus ¶ added in v3.8.0
GetUserStatus returns a user based on the provided user id string.
func (*Client4) GetUserStatusRoute ¶ added in v3.8.0
func (*Client4) GetUserStatusesRoute ¶ added in v3.8.0
func (*Client4) GetUsers ¶ added in v3.7.0
GetUsers returns a page of users on the system. Page counting starts at 0.
func (*Client4) GetUsersByIds ¶ added in v3.7.0
GetUsersByIds returns a list of users based on the provided user ids.
func (*Client4) GetUsersByUsernames ¶ added in v3.9.0
GetUsersByUsernames returns a list of users based on the provided usernames.
func (*Client4) GetUsersInChannel ¶ added in v3.7.0
func (c *Client4) GetUsersInChannel(channelId string, page int, perPage int, etag string) ([]*User, *Response)
GetUsersInChannel returns a page of users on a team. Page counting starts at 0.
func (*Client4) GetUsersInTeam ¶ added in v3.7.0
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 ¶ added in v3.7.0
func (c *Client4) GetUsersNotInChannel(teamId, channelId string, page int, perPage int, etag string) ([]*User, *Response)
GetUsersNotInChannel returns a page of users on a team. Page counting starts at 0.
func (*Client4) GetUsersNotInTeam ¶ added in v3.8.0
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 ¶ added in v3.7.0
func (*Client4) GetUsersStatusesByIds ¶ added in v3.8.0
GetUsersStatusesByIds returns a list of users status based on the provided user ids.
func (*Client4) GetUsersWithoutTeam ¶ added in v3.8.0
GetUsersWithoutTeam returns a page of users on the system that aren't on any teams. Page counting starts at 0.
func (*Client4) GetWebrtcToken ¶ added in v3.9.0
func (c *Client4) GetWebrtcToken() (*WebrtcInfoResponse, *Response)
GetWebrtcToken returns a valid token, stun server and turn server with credentials to use with the Mattermost WebRTC service.
func (*Client4) ImportTeam ¶ added in v3.8.0
func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, teamId string) ([]byte, *Response)
ImportTeam will import an exported team from other app into a existing team.
func (*Client4) InvalidateCaches ¶ added in v3.8.0
InvalidateCaches will purge the cache and can affect the performance while is cleaning.
func (*Client4) InviteUsersToTeam ¶ added in v3.8.0
InviteUsersToTeam invite users by email to the team.
func (*Client4) ListAutocompleteCommands ¶ added in v3.8.0
ListCommands will retrieve a list of commands available in the team.
func (*Client4) ListCommands ¶ added in v3.8.0
ListCommands will retrieve a list of commands available in the team.
func (*Client4) Login ¶ added in v3.7.0
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) LoginByLdap ¶ added in v3.7.0
LoginByLdap authenticates a user by LDAP id and password.
func (*Client4) LoginWithDevice ¶ added in v3.7.0
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) OpenGraph ¶ added in v3.10.0
OpenGraph return the open graph metadata for a particular url if the site have the metadata
func (*Client4) PatchChannel ¶ added in v3.8.0
func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel, *Response)
PatchChannel partially updates a channel. Any missing fields are not updated.
func (*Client4) PatchPost ¶ added in v3.8.0
PatchPost partially updates a post. Any missing fields are not updated.
func (*Client4) PatchTeam ¶ added in v3.8.0
PatchTeam partially updates a team. Any missing fields are not updated.
func (*Client4) PatchUser ¶ added in v3.7.0
PatchUser partially updates a user in the system. Any missing fields are not updated.
func (*Client4) PostLog ¶ added in v3.9.0
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) RegenCommandToken ¶ added in v3.9.0
RegenCommandToken will create a new token if the user have the right permissions.
func (*Client4) RegenOutgoingHookToken ¶ added in v3.8.0
func (c *Client4) RegenOutgoingHookToken(hookId string) (*OutgoingWebhook, *Response)
RegenOutgoingHookToken regenerate the outgoing webhook token.
func (*Client4) RegenerateOAuthAppSecret ¶ added in v3.9.0
RegenerateOAuthAppSecret regenerates the client secret for a registered OAuth 2.0 client application.
func (*Client4) ReloadConfig ¶ added in v3.8.0
ReloadConfig will reload the server configuration.
func (*Client4) RemoveTeamMember ¶ added in v3.8.0
RemoveTeamMember will remove a user from a team.
func (*Client4) RemoveUserFromChannel ¶ added in v3.7.0
RemoveUserFromChannel will delete the channel member object for a user, effectively removing the user from a channel.
func (*Client4) ResetPassword ¶ added in v3.7.0
ResetPassword uses a recovery code to update reset a user's password.
func (*Client4) RestoreChannel ¶ added in v3.10.0
RestoreChannel restores a previously deleted channel. Any missing fields are not updated.
func (*Client4) RevokeSession ¶ added in v3.7.0
RevokeSession revokes a user session based on the provided user id and session id strings.
func (*Client4) SaveReaction ¶ added in v3.9.0
SaveReaction saves an emoji reaction for a post. Returns the saved reaction if successful, otherwise an error will be returned.
func (*Client4) SearchChannels ¶ added in v3.8.0
func (c *Client4) SearchChannels(teamId string, search *ChannelSearch) ([]*Channel, *Response)
SearchChannels returns the channels on a team matching the provided search term.
func (*Client4) SearchPosts ¶ added in v3.7.0
SearchPosts returns any posts with matching terms string.
func (*Client4) SearchTeams ¶ added in v3.8.0
func (c *Client4) SearchTeams(search *TeamSearch) ([]*Team, *Response)
SearchTeams returns teams matching the provided search term.
func (*Client4) SearchUsers ¶ added in v3.8.0
func (c *Client4) SearchUsers(search *UserSearch) ([]*User, *Response)
SearchUsers returns a list of users based on some search criteria.
func (*Client4) SendPasswordResetEmail ¶ added in v3.7.0
SendPasswordResetEmail will send a link for password resetting to a user with the provided email.
func (*Client4) SendVerificationEmail ¶ added in v3.8.0
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) SetOAuthToken ¶ added in v3.7.0
func (*Client4) SetProfileImage ¶ added in v3.7.0
SetProfileImage sets profile image of the user
func (*Client4) SoftDeleteTeam ¶ added in v3.8.0
SoftDeleteTeam deletes the team softly (archive only, not permanent delete).
func (*Client4) SwitchAccountType ¶ added in v3.9.0
func (c *Client4) SwitchAccountType(switchRequest *SwitchRequest) (string, *Response)
SwitchAccountType changes a user's login type from one type to another.
func (*Client4) SyncLdap ¶ added in v3.8.0
SyncLdap will force a sync with the configured LDAP server.
func (*Client4) TeamExists ¶ added in v3.8.0
TeamExists returns true or false if the team exist or not.
func (*Client4) TestEmail ¶ added in v3.8.0
TestEmail will attempt to connect to the configured SMTP server.
func (*Client4) TestLdap ¶ added in v3.8.0
TestLdap will attempt to connect to the configured LDAP server and return OK if configured correctly.
func (*Client4) UnpinPost ¶ added in v3.8.0
UnpinPost unpin a post based on provided post id string.
func (*Client4) UpdateChannel ¶ added in v3.8.0
UpdateChannel update a channel based on the provided channel struct.
func (*Client4) UpdateChannelNotifyProps ¶ added in v3.8.0
func (c *Client4) UpdateChannelNotifyProps(channelId, userId string, props map[string]string) (bool, *Response)
UpdateChannelNotifyProps will update the notification properties on a channel for a user.
func (*Client4) UpdateChannelRoles ¶ added in v3.7.0
UpdateChannelRoles will update the roles on a channel for a user.
func (*Client4) UpdateCommand ¶ added in v3.9.0
UpdateCommand updates a command based on the provided Command struct
func (*Client4) UpdateConfig ¶ added in v3.8.0
UpdateConfig will update the server configuration
func (*Client4) UpdateIncomingWebhook ¶ added in v3.8.0
func (c *Client4) UpdateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response)
UpdateIncomingWebhook updates an incoming webhook for a channel.
func (*Client4) UpdateOutgoingWebhook ¶ added in v3.8.0
func (c *Client4) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response)
UpdateOutgoingWebhook creates an outgoing webhook for a team or channel.
func (*Client4) UpdatePost ¶ added in v3.7.0
UpdatePost updates a post based on the provided post struct.
func (*Client4) UpdatePreferences ¶ added in v3.7.0
func (c *Client4) UpdatePreferences(userId string, preferences *Preferences) (bool, *Response)
UpdatePreferences saves the user's preferences.
func (*Client4) UpdateTeam ¶ added in v3.8.0
UpdateTeam will update a team.
func (*Client4) UpdateTeamMemberRoles ¶ added in v3.7.0
UpdateTeamMemberRoles will update the roles on a team for a user.
func (*Client4) UpdateUser ¶ added in v3.7.0
UpdateUser updates a user in the system based on the provided user struct.
func (*Client4) UpdateUserActive ¶ added in v3.9.0
UpdateUserActive updates status of a user whether active or not.
func (*Client4) UpdateUserMfa ¶ added in v3.8.0
UpdateUserMfa activates multi-factor authentication for a user if activate is true and a valid code is provided. If activate is false, then code is not required and multi-factor authentication is disabled for the user.
func (*Client4) UpdateUserPassword ¶ added in v3.7.0
UpdateUserPassword updates a user's password. Must be logged in as the user or be a system administrator.
func (*Client4) UpdateUserRoles ¶ added in v3.7.0
UpdateUserRoles updates a user's roles in the system. A user can have "system_user" and "system_admin" roles.
func (*Client4) UpdateUserStatus ¶ added in v3.8.0
UpdateUserStatus sets a user's status based on the provided user id string.
func (*Client4) UploadBrandImage ¶ added in v3.8.0
UploadBrandImage sets the brand image for the system.
func (*Client4) UploadFile ¶ added in v3.7.0
func (c *Client4) UploadFile(data []byte, channelId string, filename string) (*FileUploadResponse, *Response)
UploadFile will upload a file to a channel, to be later attached to a post.
func (*Client4) UploadSamlIdpCertificate ¶ added in v3.8.0
UploadSamlIdpCertificate will upload an IDP certificate for SAML and set the config to use it.
func (*Client4) UploadSamlPrivateCertificate ¶ added in v3.8.0
UploadSamlPrivateCertificate will upload a private key for SAML and set the config to use it.
func (*Client4) UploadSamlPublicCertificate ¶ added in v3.8.0
UploadSamlPublicCertificate will upload a public certificate for SAML and set the config to use it.
func (*Client4) VerifyUserEmail ¶ added in v3.7.0
VerifyUserEmail will verify a user's email using the supplied token.
func (*Client4) ViewChannel ¶ added in v3.7.0
func (c *Client4) ViewChannel(userId string, view *ChannelView) (bool, *Response)
ViewChannel performs a view action for a user. Synonymous with switching channels or marking channels as read by a user.
type ClusterInfo ¶ added in v3.3.0
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"` Alive int32 `json:"is_alive"` Mutex sync.RWMutex `json:"-"` }
func ClusterInfoFromJson ¶ added in v3.3.0
func ClusterInfoFromJson(data io.Reader) *ClusterInfo
func ClusterInfosFromJson ¶ added in v3.3.0
func ClusterInfosFromJson(data io.Reader) []*ClusterInfo
func (*ClusterInfo) Copy ¶ added in v3.8.0
func (me *ClusterInfo) Copy() *ClusterInfo
func (*ClusterInfo) HaveEstablishedInitialContact ¶ added in v3.3.0
func (me *ClusterInfo) HaveEstablishedInitialContact() bool
func (*ClusterInfo) IdEqualTo ¶ added in v3.8.0
func (me *ClusterInfo) IdEqualTo(in string) bool
func (*ClusterInfo) IsAlive ¶ added in v3.3.0
func (me *ClusterInfo) IsAlive() bool
func (*ClusterInfo) SetAlive ¶ added in v3.8.0
func (me *ClusterInfo) SetAlive(alive bool)
func (*ClusterInfo) ToJson ¶ added in v3.3.0
func (me *ClusterInfo) ToJson() string
type ClusterSettings ¶ added in v3.3.0
type ClusterStats ¶ added in v3.6.0
type ClusterStats struct { Id string `json:"id"` TotalWebsocketConnections int `json:"total_websocket_connections"` TotalReadDbConnections int `json:"total_read_db_connections"` TotalMasterDbConnections int `json:"total_master_db_connections"` }
func ClusterStatsFromJson ¶ added in v3.6.0
func ClusterStatsFromJson(data io.Reader) *ClusterStats
func (*ClusterStats) ToJson ¶ added in v3.6.0
func (me *ClusterStats) ToJson() string
type Command ¶
type Command struct { Id string `json:"id"` Token string `json:"token"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` CreatorId string `json:"creator_id"` TeamId string `json:"team_id"` Trigger string `json:"trigger"` Method string `json:"method"` Username string `json:"username"` IconURL string `json:"icon_url"` AutoComplete bool `json:"auto_complete"` AutoCompleteDesc string `json:"auto_complete_desc"` AutoCompleteHint string `json:"auto_complete_hint"` DisplayName string `json:"display_name"` Description string `json:"description"` URL string `json:"url"` }
func CommandFromJson ¶
func CommandListFromJson ¶
type CommandArgs ¶ added in v3.6.0
type CommandArgs struct { UserId string `json:"user_id"` ChannelId string `json:"channel_id"` TeamId string `json:"team_id"` RootId string `json:"root_id"` ParentId string `json:"parent_id"` Command string `json:"command"` SiteURL string `json:"-"` T goi18n.TranslateFunc `json:"-"` Session Session `json:"-"` }
func CommandArgsFromJson ¶ added in v3.6.0
func CommandArgsFromJson(data io.Reader) *CommandArgs
func (*CommandArgs) ToJson ¶ added in v3.6.0
func (o *CommandArgs) ToJson() string
type CommandResponse ¶
type CommandResponse struct { ResponseType string `json:"response_type"` Text string `json:"text"` Username string `json:"username"` IconURL string `json:"icon_url"` GotoLocation string `json:"goto_location"` Attachments []*SlackAttachment `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 AnnouncementSettings AnnouncementSettings GitLabSettings SSOSettings GoogleSettings SSOSettings Office365Settings SSOSettings LdapSettings LdapSettings ComplianceSettings ComplianceSettings LocalizationSettings LocalizationSettings SamlSettings SamlSettings NativeAppSettings NativeAppSettings ClusterSettings ClusterSettings MetricsSettings MetricsSettings AnalyticsSettings AnalyticsSettings WebrtcSettings WebrtcSettings ElasticSearchSettings ElasticSearchSettings DataRetentionSettings DataRetentionSettings }
func ConfigFromJson ¶
func (*Config) GetSSOService ¶
func (o *Config) GetSSOService(service string) *SSOSettings
func (*Config) GetSanitizeOptions ¶
func (*Config) SetDefaults ¶
func (o *Config) SetDefaults()
type DataRetentionSettings ¶ added in v3.10.0
type DataRetentionSettings struct {
Enable *bool
}
type ElasticSearchSettings ¶ added in v3.10.0
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 SendPushNotifications *bool PushNotificationServer *string PushNotificationContents *string EnableEmailBatching *bool EmailBatchingBufferSize *int EmailBatchingInterval *int SkipServerCertificateVerification *bool }
type Emoji ¶ added in v3.2.0
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 ¶ added in v3.2.0
func EmojiListFromJson ¶ added in v3.2.0
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"` Metrics *bool `json:"metrics"` CustomBrand *bool `json:"custom_brand"` MHPNS *bool `json:"mhpns"` SAML *bool `json:"saml"` PasswordRequirements *bool `json:"password_requirements"` ElasticSearch *bool `json:"elastic_search"` Announcement *bool `json:"announcement"` // 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 ¶
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 ¶
func FileInfosFromJson ¶ added in v3.5.0
type FileSettings ¶
type FileSettings struct { EnableFileAttachments *bool 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 AmazonS3SignV2 *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 ¶ added in v3.5.0
type GatewayResponse struct {
Status string `json:"janus"`
}
func GatewayResponseFromJson ¶ added in v3.5.0
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 ¶
type IncomingWebhookRequest struct { Text string `json:"text"` Username string `json:"username"` IconURL string `json:"icon_url"` ChannelName string `json:"channel"` Props StringInterface `json:"props"` Attachments []*SlackAttachment `json:"attachments"` Type string `json:"type"` }
func IncomingWebhookRequestFromJson ¶
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 JobStatus ¶ added in v3.10.0
type JobStatus struct { Id string `json:"id"` Type string `json:"type"` StartAt int64 `json:"start_at"` LastActivityAt int64 `json:"last_activity_at"` LastRunStartedAt int64 `json:"last_run_started_at"` LastRunCompletedAt int64 `json:"last_run_completed_at"` Status string `json:"status"` Data map[string]interface{} `json:"data"` }
func JobStatusFromJson ¶ added in v3.10.0
func JobStatusesFromJson ¶ added in v3.10.0
type LdapSettings ¶
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 PositionAttribute *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 ¶ added in v3.1.0
type LogSettings ¶
type MetricsSettings ¶ added in v3.6.0
type MfaSecret ¶ added in v3.8.0
func MfaSecretFromJson ¶ added in v3.8.0
type NativeAppSettings ¶ added in v3.3.0
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 ¶ added in v3.3.0
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 ¶
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 ¶
func OutgoingWebhookFromJson(data io.Reader) *OutgoingWebhook
func OutgoingWebhookListFromJson ¶
func OutgoingWebhookListFromJson(data io.Reader) []*OutgoingWebhook
func (*OutgoingWebhook) HasTriggerWord ¶
func (o *OutgoingWebhook) HasTriggerWord(word string) bool
func (*OutgoingWebhook) IsValid ¶
func (o *OutgoingWebhook) IsValid() *AppError
func (*OutgoingWebhook) PreSave ¶
func (o *OutgoingWebhook) PreSave()
func (*OutgoingWebhook) PreUpdate ¶
func (o *OutgoingWebhook) PreUpdate()
func (*OutgoingWebhook) ToJson ¶
func (o *OutgoingWebhook) ToJson() string
func (*OutgoingWebhook) TriggerWordStartsWith ¶ added in v3.3.0
func (o *OutgoingWebhook) TriggerWordStartsWith(word string) bool
type OutgoingWebhookPayload ¶ added in v3.1.0
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 ¶ added in v3.1.0
func (o *OutgoingWebhookPayload) ToFormValues() string
func (*OutgoingWebhookPayload) ToJSON ¶ added in v3.1.0
func (o *OutgoingWebhookPayload) ToJSON() string
type PasswordSettings ¶ added in v3.2.0
type Permission ¶ added in v3.5.0
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_GROUP_CHANNEL *Permission
var PERMISSION_CREATE_POST *Permission
var PERMISSION_CREATE_PRIVATE_CHANNEL *Permission
var PERMISSION_CREATE_PUBLIC_CHANNEL *Permission
var PERMISSION_CREATE_TEAM *Permission
var PERMISSION_DELETE_OTHERS_POSTS *Permission
var PERMISSION_DELETE_POST *Permission
var PERMISSION_DELETE_PRIVATE_CHANNEL *Permission
var PERMISSION_DELETE_PUBLIC_CHANNEL *Permission
var PERMISSION_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_LIST_USERS_WITHOUT_TEAM *Permission
var PERMISSION_MANAGE_CHANNEL_ROLES *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_TEAM_ROLES *Permission
var PERMISSION_MANAGE_WEBHOOKS *Permission
var PERMISSION_PERMANENT_DELETE_USER *Permission
var PERMISSION_READ_CHANNEL *Permission
var PERMISSION_READ_PUBLIC_CHANNEL *Permission
var PERMISSION_REMOVE_USER_FROM_TEAM *Permission
var PERMISSION_UPLOAD_FILE *Permission
var PERMISSION_USE_SLASH_COMMANDS *Permission
var PERMISSION_VIEW_TEAM *Permission
type Post ¶
type Post struct { Id string `json:"id"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` EditAt int64 `json:"edit_at"` DeleteAt int64 `json:"delete_at"` IsPinned bool `json:"is_pinned"` UserId string `json:"user_id"` ChannelId string `json:"channel_id"` RootId string `json:"root_id"` ParentId string `json:"parent_id"` OriginalId string `json:"original_id"` Message string `json:"message"` 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:"-"` HasReactions bool `json:"has_reactions,omitempty"` }
func PostFromJson ¶
func (*Post) IsSystemMessage ¶
func (*Post) MakeNonNil ¶
func (o *Post) MakeNonNil()
type PostList ¶
func NewPostList ¶ added in v3.7.0
func NewPostList() *PostList
func PostListFromJson ¶
func (*PostList) IsChannelId ¶
func (*PostList) MakeNonNil ¶
func (o *PostList) MakeNonNil()
type PostPatch ¶ added in v3.8.0
type PostPatch struct { IsPinned *bool `json:"is_pinned"` Message *string `json:"message"` Props *StringInterface `json:"props"` FileIds *StringArray `json:"file_ids"` HasReactions *bool `json:"has_reactions"` }
func PostPatchFromJson ¶ added in v3.8.0
type Preference ¶
type Preference struct { UserId string `json:"user_id"` Category string `json:"category"` Name string `json:"name"` Value string `json:"value"` }
func PreferenceFromJson ¶
func PreferenceFromJson(data io.Reader) *Preference
func (*Preference) IsValid ¶
func (o *Preference) IsValid() *AppError
func (*Preference) PreUpdate ¶ added in v3.3.0
func (o *Preference) PreUpdate()
func (*Preference) ToJson ¶
func (o *Preference) ToJson() string
type Preferences ¶
type Preferences []Preference
func PreferencesFromJson ¶
func PreferencesFromJson(data io.Reader) (Preferences, error)
func (*Preferences) ToJson ¶
func (o *Preferences) ToJson() string
type PrivacySettings ¶
type PushNotification ¶
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"` TeamId string `json:"team_id"` ChannelId string `json:"channel_id"` ChannelName string `json:"channel_name"` Type string `json:"type"` SenderId string `json:"sender_id"` OverrideUsername string `json:"override_username"` OverrideIconUrl string `json:"override_icon_url"` FromWebhook string `json:"from_webhook"` }
func PushNotificationFromJson ¶
func PushNotificationFromJson(data io.Reader) *PushNotification
func (*PushNotification) SetDeviceIdAndPlatform ¶ added in v3.4.0
func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string)
func (*PushNotification) ToJson ¶
func (me *PushNotification) ToJson() string
type PushResponse ¶ added in v3.7.0
func NewErrorPushResponse ¶ added in v3.7.0
func NewErrorPushResponse(message string) PushResponse
func NewOkPushResponse ¶ added in v3.7.0
func NewOkPushResponse() PushResponse
func NewRemovePushResponse ¶ added in v3.7.0
func NewRemovePushResponse() PushResponse
func PushResponseFromJson ¶ added in v3.7.0
func PushResponseFromJson(data io.Reader) PushResponse
func (*PushResponse) ToJson ¶ added in v3.7.0
func (me *PushResponse) ToJson() string
type RateLimitSettings ¶
type Reaction ¶ added in v3.6.0
type Reaction struct { UserId string `json:"user_id"` PostId string `json:"post_id"` EmojiName string `json:"emoji_name"` CreateAt int64 `json:"create_at"` }
func ReactionFromJson ¶ added in v3.6.0
func ReactionsFromJson ¶ added in v3.6.0
type Response ¶ added in v3.7.0
type Response struct { StatusCode int Error *AppError RequestId string Etag string ServerVersion string }
func BuildResponse ¶ added in v3.7.0
type ResponseMetadata ¶ added in v3.6.0
type Role ¶ added in v3.5.0
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 ¶ added in v3.2.0
type SamlCertificateStatus ¶ added in v3.8.0
type SamlCertificateStatus struct { IdpCertificateFile bool `json:"idp_certificate_file"` PrivateKeyFile bool `json:"private_key_file"` PublicCertificateFile bool `json:"public_certificate_file"` }
func SamlCertificateStatusFromJson ¶ added in v3.8.0
func SamlCertificateStatusFromJson(data io.Reader) *SamlCertificateStatus
func (*SamlCertificateStatus) ToJson ¶ added in v3.8.0
func (s *SamlCertificateStatus) ToJson() string
type SamlSettings ¶ added in v3.2.0
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 PositionAttribute *string LoginButtonText *string }
type ScheduledTask ¶ added in v3.1.0
type ScheduledTask struct { Name string `json:"name"` Interval time.Duration `json:"interval"` Recurring bool `json:"recurring"` // contains filtered or unexported fields }
func CreateRecurringTask ¶ added in v3.1.0
func CreateRecurringTask(name string, function TaskFunc, interval time.Duration) *ScheduledTask
func CreateTask ¶ added in v3.1.0
func CreateTask(name string, function TaskFunc, timeToExecution time.Duration) *ScheduledTask
func GetTaskByName ¶ added in v3.2.0
func GetTaskByName(name string) *ScheduledTask
func (*ScheduledTask) Cancel ¶ added in v3.1.0
func (task *ScheduledTask) Cancel()
func (*ScheduledTask) Execute ¶ added in v3.3.0
func (task *ScheduledTask) Execute()
Executes the task immediatly. A recurring task will be run regularally after interval.
func (*ScheduledTask) String ¶ added in v3.1.0
func (task *ScheduledTask) String() string
type SearchParams ¶
type SearchParams struct { Terms string IsHashtag bool InChannels []string FromUsers []string OrTerms bool }
func ParseSearchParams ¶
func ParseSearchParams(text string) []*SearchParams
func (*SearchParams) ToJson ¶ added in v3.9.0
func (o *SearchParams) ToJson() string
type SecurityBulletin ¶
type SecurityBulletin struct { Id string `json:"id"` AppliesToVersion string `json:"applies_to_version"` }
func SecurityBulletinFromJson ¶
func SecurityBulletinFromJson(data io.Reader) *SecurityBulletin
func (*SecurityBulletin) ToJson ¶
func (me *SecurityBulletin) ToJson() string
type SecurityBulletins ¶
type SecurityBulletins []SecurityBulletin
func SecurityBulletinsFromJson ¶
func SecurityBulletinsFromJson(data io.Reader) SecurityBulletins
func (SecurityBulletins) ToJson ¶
func (me SecurityBulletins) ToJson() string
type ServiceSettings ¶
type ServiceSettings struct { SiteURL *string LicenseFileLocation *string ListenAddress string ConnectionSecurity *string TLSCertFile *string TLSKeyFile *string UseLetsEncrypt *bool LetsEncryptCertificateCacheFile *string Forward80To443 *bool ReadTimeout *int WriteTimeout *int MaximumLoginAttempts int GoroutineHealthThreshold *int GoogleDeveloperKey string EnableOAuthServiceProvider bool EnableIncomingWebhooks bool EnableOutgoingWebhooks bool EnableCommands *bool EnableOnlyAdminIntegrations *bool EnablePostUsernameOverride bool EnablePostIconOverride bool EnableLinkPreviews *bool EnableTesting bool EnableDeveloper *bool EnableSecurityFixAlert *bool EnableInsecureOutgoingConnections *bool EnableMultifactorAuthentication *bool EnforceMultifactorAuthentication *bool AllowCorsFrom *string SessionLengthWebInDays *int SessionLengthMobileInDays *int SessionLengthSSOInDays *int SessionCacheInMinutes *int WebsocketSecurePort *int WebsocketPort *int WebserverMode *string EnableCustomEmoji *bool RestrictCustomEmojiCreation *string RestrictPostDelete *string AllowEditPost *string PostEditTimeLimit *int TimeBetweenUserTypingUpdatesMilliseconds *int64 EnablePostSearch *bool EnableUserTypingMessages *bool EnableUserStatuses *bool ClusterLogTimeoutMilliseconds *int }
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 ¶ added in v3.5.0
func (*Session) IsMobileApp ¶ added in v3.4.0
func (*Session) SetExpireInDays ¶
type SlackAttachment ¶ added in v3.7.0
type SlackAttachment struct { Id int64 `json:"id"` Fallback string `json:"fallback"` Color string `json:"color"` Pretext string `json:"pretext"` AuthorName string `json:"author_name"` AuthorLink string `json:"author_link"` AuthorIcon string `json:"author_icon"` Title string `json:"title"` TitleLink string `json:"title_link"` Text string `json:"text"` Fields []*SlackAttachmentField `json:"fields"` ImageURL string `json:"image_url"` ThumbURL string `json:"thumb_url"` Timestamp interface{} `json:"ts"` // This is either a string or an int64 }
type SlackAttachmentField ¶ added in v3.7.0
type SqlSettings ¶
type Status ¶ added in v3.3.0
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:"-" db:"-"` }
func StatusFromJson ¶ added in v3.3.0
func StatusListFromJson ¶ added in v3.8.0
type StringArray ¶
type StringArray []string
type StringInterface ¶
type StringInterface map[string]interface{}
type StringMap ¶
func GetDefaultChannelNotifyProps ¶
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 ¶
type SwitchRequest ¶ added in v3.9.0
type SwitchRequest struct { CurrentService string `json:"current_service"` NewService string `json:"new_service"` Email string `json:"email"` Password string `json:"current_password"` NewPassword string `json:"new_password"` MfaCode string `json:"mfa_code"` LdapId string `json:"ldap_id"` }
func SwitchRequestFromJson ¶ added in v3.9.0
func SwitchRequestFromJson(data io.Reader) *SwitchRequest
func (*SwitchRequest) EmailToLdap ¶ added in v3.9.0
func (o *SwitchRequest) EmailToLdap() bool
func (*SwitchRequest) EmailToOAuth ¶ added in v3.9.0
func (o *SwitchRequest) EmailToOAuth() bool
func (*SwitchRequest) LdapToEmail ¶ added in v3.9.0
func (o *SwitchRequest) LdapToEmail() bool
func (*SwitchRequest) OAuthToEmail ¶ added in v3.9.0
func (o *SwitchRequest) OAuthToEmail() bool
func (*SwitchRequest) ToJson ¶ added in v3.9.0
func (o *SwitchRequest) ToJson() string
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"` Description string `json:"description"` Email string `json:"email"` Type string `json:"type"` CompanyName string `json:"company_name"` AllowedDomains string `json:"allowed_domains"` InviteId string `json:"invite_id"` AllowOpenInvite bool `json:"allow_open_invite"` }
func TeamFromJson ¶
func TeamListFromJson ¶ added in v3.7.0
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 ¶ added in v3.5.0
func (o *TeamMember) GetRoles() []string
func (*TeamMember) IsValid ¶
func (o *TeamMember) IsValid() *AppError
func (*TeamMember) PreUpdate ¶ added in v3.5.0
func (o *TeamMember) PreUpdate()
func (*TeamMember) ToJson ¶
func (o *TeamMember) ToJson() string
type TeamPatch ¶ added in v3.8.0
type TeamPatch struct { DisplayName *string `json:"display_name"` Description *string `json:"description"` CompanyName *string `json:"company_name"` InviteId *string `json:"invite_id"` AllowOpenInvite *bool `json:"allow_open_invite"` }
func TeamPatchFromJson ¶ added in v3.8.0
type TeamSearch ¶ added in v3.8.0
type TeamSearch struct {
Term string `json:"term"`
}
func TeamSearchFromJson ¶ added in v3.8.0
func TeamSearchFromJson(data io.Reader) *TeamSearch
TeamSearchFromJson decodes the input and returns a TeamSearch
func (*TeamSearch) ToJson ¶ added in v3.8.0
func (c *TeamSearch) ToJson() string
ToJson convert a TeamSearch to json 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 RestrictPublicChannelCreation *string RestrictPrivateChannelCreation *string RestrictPublicChannelDeletion *string RestrictPrivateChannelDeletion *string RestrictPrivateChannelManageMembers *string UserStatusAwayTimeout *int64 MaxChannelsPerTeam *int64 MaxNotificationsPerChannel *int64 }
type TeamStats ¶ added in v3.5.0
type TeamStats struct { TeamId string `json:"team_id"` TotalMemberCount int64 `json:"total_member_count"` ActiveMemberCount int64 `json:"active_member_count"` }
func TeamStatsFromJson ¶ added in v3.5.0
type TeamUnread ¶ added in v3.6.0
type TeamUnread struct { TeamId string `json:"team_id"` MsgCount int64 `json:"msg_count"` MentionCount int64 `json:"mention_count"` }
func TeamUnreadFromJson ¶ added in v3.8.0
func TeamUnreadFromJson(data io.Reader) *TeamUnread
func TeamsUnreadFromJson ¶ added in v3.6.0
func TeamsUnreadFromJson(data io.Reader) []*TeamUnread
func (*TeamUnread) ToJson ¶ added in v3.8.0
func (o *TeamUnread) ToJson() string
type User ¶
type User struct { Id string `json:"id"` CreateAt int64 `json:"create_at,omitempty"` UpdateAt int64 `json:"update_at,omitempty"` DeleteAt int64 `json:"delete_at"` Username string `json:"username"` Password string `json:"password,omitempty"` AuthData *string `json:"auth_data,omitempty"` AuthService string `json:"auth_service"` Email string `json:"email"` EmailVerified bool `json:"email_verified,omitempty"` Nickname string `json:"nickname"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Position string `json:"position"` Roles string `json:"roles"` AllowMarketing bool `json:"allow_marketing,omitempty"` Props StringMap `json:"props,omitempty"` NotifyProps StringMap `json:"notify_props,omitempty"` LastPasswordUpdate int64 `json:"last_password_update,omitempty"` LastPictureUpdate int64 `json:"last_picture_update,omitempty"` FailedAttempts int `json:"failed_attempts,omitempty"` Locale string `json:"locale"` 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 ¶ added in v3.5.0
func (*User) AddNotifyProp ¶
func (*User) ClearNonProfileFields ¶
func (u *User) ClearNonProfileFields()
func (*User) GetDisplayName ¶
func (*User) GetDisplayNameForPreference ¶ added in v3.4.0
func (*User) GetFullName ¶
func (*User) GetRawRoles ¶ added in v3.5.0
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 ¶ added in v3.4.0
func (*User) SetDefaultNotifications ¶
func (u *User) SetDefaultNotifications()
func (*User) UpdateMentionKeysFromUsername ¶
type UserAutocomplete ¶ added in v3.8.0
type UserAutocomplete struct { Users []*User `json:"users"` OutOfChannel []*User `json:"out_of_channel,omitempty"` }
func UserAutocompleteFromJson ¶ added in v3.8.0
func UserAutocompleteFromJson(data io.Reader) *UserAutocomplete
func (*UserAutocomplete) ToJson ¶ added in v3.8.0
func (o *UserAutocomplete) ToJson() string
type UserAutocompleteInChannel ¶ added in v3.5.0
type UserAutocompleteInChannel struct { InChannel []*User `json:"in_channel"` OutOfChannel []*User `json:"out_of_channel"` }
func UserAutocompleteInChannelFromJson ¶ added in v3.5.0
func UserAutocompleteInChannelFromJson(data io.Reader) *UserAutocompleteInChannel
func (*UserAutocompleteInChannel) ToJson ¶ added in v3.5.0
func (o *UserAutocompleteInChannel) ToJson() string
type UserAutocompleteInTeam ¶ added in v3.5.0
type UserAutocompleteInTeam struct {
InTeam []*User `json:"in_team"`
}
func UserAutocompleteInTeamFromJson ¶ added in v3.5.0
func UserAutocompleteInTeamFromJson(data io.Reader) *UserAutocompleteInTeam
func (*UserAutocompleteInTeam) ToJson ¶ added in v3.5.0
func (o *UserAutocompleteInTeam) ToJson() string
type UserPatch ¶ added in v3.7.0
type UserPatch struct { Username *string `json:"username"` Nickname *string `json:"nickname"` FirstName *string `json:"first_name"` LastName *string `json:"last_name"` Position *string `json:"position"` Email *string `json:"email"` Props StringMap `json:"props,omitempty"` NotifyProps StringMap `json:"notify_props,omitempty"` Locale *string `json:"locale"` }
func UserPatchFromJson ¶ added in v3.7.0
type UserSearch ¶ added in v3.5.0
type UserSearch struct { Term string `json:"term"` TeamId string `json:"team_id"` NotInTeamId string `json:"not_in_team_id"` InChannelId string `json:"in_channel_id"` NotInChannelId string `json:"not_in_channel_id"` AllowInactive bool `json:"allow_inactive"` WithoutTeam bool `json:"without_team"` }
func UserSearchFromJson ¶ added in v3.5.0
func UserSearchFromJson(data io.Reader) *UserSearch
UserSearchFromJson will decode the input and return a User
func (*UserSearch) ToJson ¶ added in v3.5.0
func (u *UserSearch) ToJson() string
ToJson convert a User to a json string
type WebSocketClient ¶ added in v3.3.0
type WebSocketClient struct { Url string // The location of the server like "ws://localhost:8065" ApiUrl string // The api location of the server like "ws://localhost:8065/api/v3" ConnectUrl string // The websocket URL to connect to like "ws://localhost:8065/api/v3/path/to/websocket" Conn *websocket.Conn // The WebSocket connection AuthToken string // The token used to open the WebSocket Sequence int64 // The ever-incrementing sequence attached to each WebSocket action EventChannel chan *WebSocketEvent ResponseChannel chan *WebSocketResponse ListenError *AppError }
func (*WebSocketClient) Close ¶ added in v3.3.0
func (wsc *WebSocketClient) Close()
func (*WebSocketClient) Connect ¶ added in v3.3.0
func (wsc *WebSocketClient) Connect() *AppError
func (*WebSocketClient) GetStatuses ¶ added in v3.3.0
func (wsc *WebSocketClient) GetStatuses()
GetStatuses will return a map of string statuses using user id as the key
func (*WebSocketClient) GetStatusesByIds ¶ added in v3.5.0
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 ¶ added in v3.3.0
func (wsc *WebSocketClient) Listen()
func (*WebSocketClient) SendMessage ¶ added in v3.3.0
func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{})
func (*WebSocketClient) UserTyping ¶ added in v3.3.0
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 ¶ added in v3.3.0
type WebSocketEvent struct { Event string `json:"event"` Data map[string]interface{} `json:"data"` Broadcast *WebsocketBroadcast `json:"broadcast"` Sequence int64 `json:"seq"` }
func NewWebSocketEvent ¶ added in v3.3.0
func NewWebSocketEvent(event, teamId, channelId, userId string, omitUsers map[string]bool) *WebSocketEvent
func WebSocketEventFromJson ¶ added in v3.3.0
func WebSocketEventFromJson(data io.Reader) *WebSocketEvent
func (*WebSocketEvent) Add ¶ added in v3.3.0
func (m *WebSocketEvent) Add(key string, value interface{})
func (*WebSocketEvent) EventType ¶ added in v3.6.0
func (o *WebSocketEvent) EventType() string
func (*WebSocketEvent) IsValid ¶ added in v3.3.0
func (o *WebSocketEvent) IsValid() bool
func (*WebSocketEvent) ToJson ¶ added in v3.3.0
func (o *WebSocketEvent) ToJson() string
type WebSocketMessage ¶ added in v3.3.0
type WebSocketRequest ¶ added in v3.3.0
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 ¶ added in v3.3.0
func WebSocketRequestFromJson(data io.Reader) *WebSocketRequest
func (*WebSocketRequest) ToJson ¶ added in v3.3.0
func (o *WebSocketRequest) ToJson() string
type WebSocketResponse ¶ added in v3.3.0
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"` }
func NewWebSocketError ¶ added in v3.3.0
func NewWebSocketError(seqReply int64, err *AppError) *WebSocketResponse
func NewWebSocketResponse ¶ added in v3.3.0
func NewWebSocketResponse(status string, seqReply int64, data map[string]interface{}) *WebSocketResponse
func WebSocketResponseFromJson ¶ added in v3.3.0
func WebSocketResponseFromJson(data io.Reader) *WebSocketResponse
func (*WebSocketResponse) Add ¶ added in v3.3.0
func (m *WebSocketResponse) Add(key string, value interface{})
func (*WebSocketResponse) EventType ¶ added in v3.6.0
func (o *WebSocketResponse) EventType() string
func (*WebSocketResponse) IsValid ¶ added in v3.3.0
func (o *WebSocketResponse) IsValid() bool
func (*WebSocketResponse) ToJson ¶ added in v3.3.0
func (o *WebSocketResponse) ToJson() string
type WebrtcInfoResponse ¶ added in v3.9.0
type WebrtcInfoResponse struct { Token string `json:"token"` GatewayUrl string `json:"gateway_url"` StunUri string `json:"stun_uri,omitempty"` TurnUri string `json:"turn_uri,omitempty"` TurnPassword string `json:"turn_password,omitempty"` TurnUsername string `json:"turn_username,omitempty"` }
func WebrtcInfoResponseFromJson ¶ added in v3.9.0
func WebrtcInfoResponseFromJson(data io.Reader) *WebrtcInfoResponse
func (*WebrtcInfoResponse) ToJson ¶ added in v3.9.0
func (o *WebrtcInfoResponse) ToJson() string
type WebrtcSettings ¶ added in v3.5.0
type WebsocketBroadcast ¶ added in v3.5.0
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
- channel.go
- channel_count.go
- channel_data.go
- channel_list.go
- channel_member.go
- channel_search.go
- channel_stats.go
- channel_view.go
- client.go
- client4.go
- cluster_info.go
- cluster_stats.go
- command.go
- command_args.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
- job_status.go
- ldap.go
- license.go
- mfa_secret.go
- modeltestlib.go
- oauth.go
- outgoing_webhook.go
- post.go
- post_list.go
- preference.go
- preferences.go
- push_notification.go
- push_response.go
- reaction.go
- saml.go
- scheduled_task.go
- search_params.go
- security_bulletin.go
- session.go
- slack_attachment.go
- status.go
- suggest_command.go
- switch_request.go
- system.go
- team.go
- team_member.go
- team_search.go
- team_stats.go
- token.go
- user.go
- user_autocomplete.go
- user_search.go
- utils.go
- version.go
- webrtc.go
- websocket_client.go
- websocket_message.go
- websocket_request.go