github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/model/channel_stats.go (about) 1 // Copyright (c) 2015-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 ChannelStats struct { 12 ChannelId string `json:"channel_id"` 13 MemberCount int64 `json:"member_count"` 14 GuestCount int64 `json:"guest_count"` 15 PinnedPostCount int64 `json:"pinnedpost_count"` 16 } 17 18 func (o *ChannelStats) ToJson() string { 19 b, _ := json.Marshal(o) 20 return string(b) 21 } 22 23 func ChannelStatsFromJson(data io.Reader) *ChannelStats { 24 var o *ChannelStats 25 json.NewDecoder(data).Decode(&o) 26 return o 27 }