github.com/rajatvaryani/mattermost-server@v5.11.1+incompatible/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  }
    15  
    16  func (o *ChannelStats) ToJson() string {
    17  	b, _ := json.Marshal(o)
    18  	return string(b)
    19  }
    20  
    21  func ChannelStatsFromJson(data io.Reader) *ChannelStats {
    22  	var o *ChannelStats
    23  	json.NewDecoder(data).Decode(&o)
    24  	return o
    25  }