github.com/vnforks/kid@v5.11.1+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  }
    14  
    15  type PluginsResponse struct {
    16  	Active   []*PluginInfo `json:"active"`
    17  	Inactive []*PluginInfo `json:"inactive"`
    18  }
    19  
    20  func (m *PluginsResponse) ToJson() string {
    21  	b, _ := json.Marshal(m)
    22  	return string(b)
    23  }
    24  
    25  func PluginsResponseFromJson(data io.Reader) *PluginsResponse {
    26  	var m *PluginsResponse
    27  	json.NewDecoder(data).Decode(&m)
    28  	return m
    29  }