diff options
author | Wim <wim@42.be> | 2016-05-21 14:14:08 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2016-05-21 14:14:08 +0200 |
commit | 33844fa60c5b432c4b6a4fb966be6e8f04627165 (patch) | |
tree | a678cbaed822633302e6a502689445ef4231ae69 /vendor/github.com/mattermost/platform/model/compliance_post.go | |
parent | 85faa43145c6419529f8677026394bcdaee2157f (diff) | |
download | matterbridge-msglm-33844fa60c5b432c4b6a4fb966be6e8f04627165.tar.gz matterbridge-msglm-33844fa60c5b432c4b6a4fb966be6e8f04627165.tar.bz2 matterbridge-msglm-33844fa60c5b432c4b6a4fb966be6e8f04627165.zip |
Commit mattermost vendoringv0.4.1
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/compliance_post.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/compliance_post.go | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/platform/model/compliance_post.go b/vendor/github.com/mattermost/platform/model/compliance_post.go new file mode 100644 index 00000000..ce26a366 --- /dev/null +++ b/vendor/github.com/mattermost/platform/model/compliance_post.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package model + +import ( + "time" +) + +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 + PostHashtags string + PostFilenames string +} + +func CompliancePostHeader() []string { + return []string{ + "TeamName", + "TeamDisplayName", + + "ChannelName", + "ChannelDisplayName", + + "UserUsername", + "UserEmail", + "UserNickname", + + "PostId", + "PostCreateAt", + "PostUpdateAt", + "PostDeleteAt", + "PostRootId", + "PostParentId", + "PostOriginalId", + "PostMessage", + "PostType", + "PostProps", + "PostHashtags", + "PostFilenames", + } +} + +func (me *CompliancePost) Row() []string { + + postDeleteAt := "" + if me.PostDeleteAt > 0 { + postDeleteAt = time.Unix(0, me.PostDeleteAt*int64(1000*1000)).Format(time.RFC3339) + } + + postUpdateAt := "" + if me.PostUpdateAt != me.PostCreateAt { + postUpdateAt = time.Unix(0, me.PostUpdateAt*int64(1000*1000)).Format(time.RFC3339) + } + + return []string{ + me.TeamName, + me.TeamDisplayName, + + me.ChannelName, + me.ChannelDisplayName, + + me.UserUsername, + me.UserEmail, + me.UserNickname, + + me.PostId, + time.Unix(0, me.PostCreateAt*int64(1000*1000)).Format(time.RFC3339), + postUpdateAt, + postDeleteAt, + + me.PostRootId, + me.PostParentId, + me.PostOriginalId, + me.PostMessage, + me.PostType, + me.PostProps, + me.PostHashtags, + me.PostFilenames, + } +} |