github.com/gigforks/mattermost-server@v4.9.1-0.20180619094218-800d97fa55d0+incompatible/model/plugins_response.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 PluginInfo struct {
    12  	Manifest
    13  	Prepackaged bool `json:"prepackaged"`
    14  }
    15  
    16  type PluginsResponse struct {
    17  	Active   []*PluginInfo `json:"active"`
    18  	Inactive []*PluginInfo `json:"inactive"`
    19  }
    20  
    21  func (m *PluginsResponse) ToJson() string {
    22  	b, _ := json.Marshal(m)
    23  	return string(b)
    24  }
    25  
    26  func PluginsResponseFromJson(data io.Reader) *PluginsResponse {
    27  	var m *PluginsResponse
    28  	json.NewDecoder(data).Decode(&m)
    29  	return m
    30  }