mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-09-16 07:12:31 +00:00
Sync with mattermost 3.6.0
This commit is contained in:
35
vendor/github.com/mattermost/platform/model/channel_search.go
generated
vendored
Normal file
35
vendor/github.com/mattermost/platform/model/channel_search.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
)
|
||||
|
||||
type ChannelSearch struct {
|
||||
Term string `json:"term"`
|
||||
}
|
||||
|
||||
// ToJson convert a Channel to a json string
|
||||
func (c *ChannelSearch) ToJson() string {
|
||||
b, err := json.Marshal(c)
|
||||
if err != nil {
|
||||
return ""
|
||||
} else {
|
||||
return string(b)
|
||||
}
|
||||
}
|
||||
|
||||
// ChannelSearchFromJson will decode the input and return a Channel
|
||||
func ChannelSearchFromJson(data io.Reader) *ChannelSearch {
|
||||
decoder := json.NewDecoder(data)
|
||||
var cs ChannelSearch
|
||||
err := decoder.Decode(&cs)
|
||||
if err == nil {
|
||||
return &cs
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user