github.com/gigforks/mattermost-server@v4.9.1-0.20180619094218-800d97fa55d0+incompatible/model/user_search.go (about) 1 // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package model 5 6 import ( 7 "encoding/json" 8 "io" 9 ) 10 11 type UserSearch struct { 12 Term string `json:"term"` 13 TeamId string `json:"team_id"` 14 NotInTeamId string `json:"not_in_team_id"` 15 InChannelId string `json:"in_channel_id"` 16 NotInChannelId string `json:"not_in_channel_id"` 17 AllowInactive bool `json:"allow_inactive"` 18 WithoutTeam bool `json:"without_team"` 19 } 20 21 // ToJson convert a User to a json string 22 func (u *UserSearch) ToJson() string { 23 b, _ := json.Marshal(u) 24 return string(b) 25 } 26 27 // UserSearchFromJson will decode the input and return a User 28 func UserSearchFromJson(data io.Reader) *UserSearch { 29 var us *UserSearch 30 json.NewDecoder(data).Decode(&us) 31 return us 32 }