4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 00:04:04 +00:00

Update dependencies (#1610)

* Update dependencies

* Update module to go 1.17
This commit is contained in:
Wim
2021-10-17 00:47:22 +02:00
committed by GitHub
parent 7ae45c42e7
commit 4dd8bae5c9
494 changed files with 15698 additions and 19720 deletions

View File

@ -37,6 +37,19 @@ type Compliance struct {
type Compliances []Compliance
// ComplianceExportCursor is used for paginated iteration of posts
// for compliance export.
// We need to keep track of the last post ID in addition to the last post
// CreateAt to break ties when two posts have the same CreateAt.
type ComplianceExportCursor struct {
LastChannelsQueryPostCreateAt int64
LastChannelsQueryPostID string
ChannelsQueryCompleted bool
LastDirectMessagesQueryPostCreateAt int64
LastDirectMessagesQueryPostID string
DirectMessagesQueryCompleted bool
}
func (c *Compliance) ToJson() string {
b, _ := json.Marshal(c)
return string(b)
@ -58,6 +71,11 @@ func (c *Compliance) PreSave() {
c.CreateAt = GetMillis()
}
func (c *Compliance) DeepCopy() *Compliance {
copy := *c
return &copy
}
func (c *Compliance) JobName() string {
jobName := c.Type
if c.Type == COMPLIANCE_TYPE_DAILY {
@ -79,7 +97,7 @@ func (c *Compliance) IsValid() *AppError {
return NewAppError("Compliance.IsValid", "model.compliance.is_valid.create_at.app_error", nil, "", http.StatusBadRequest)
}
if len(c.Desc) > 512 || len(c.Desc) == 0 {
if len(c.Desc) > 512 || c.Desc == "" {
return NewAppError("Compliance.IsValid", "model.compliance.is_valid.desc.app_error", nil, "", http.StatusBadRequest)
}
@ -105,11 +123,11 @@ func ComplianceFromJson(data io.Reader) *Compliance {
}
func (c Compliances) ToJson() string {
if b, err := json.Marshal(c); err != nil {
b, err := json.Marshal(c)
if err != nil {
return "[]"
} else {
return string(b)
}
return string(b)
}
func CompliancesFromJson(data io.Reader) Compliances {