From 2628022275ef64fde95545abe4634b4bd7177844 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 15 Sep 2017 08:51:46 -0400 Subject: PLT-7622 Improvements to server handling of webapp plugins (#7445) * Improvements to server handling of webapp plugins * Fix newline * Update manifest function names --- model/manifest.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'model/manifest.go') diff --git a/model/manifest.go b/model/manifest.go index e61ccc8ad..b466660af 100644 --- a/model/manifest.go +++ b/model/manifest.go @@ -12,8 +12,9 @@ import ( type Manifest struct { Id string `json:"id" yaml:"id"` - Name string `json:"name" yaml:"name"` - Description string `json:"description" yaml:"description"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + Version string `json:"version" yaml:"version"` Backend *ManifestBackend `json:"backend,omitempty" yaml:"backend,omitempty"` Webapp *ManifestWebapp `json:"webapp,omitempty" yaml:"webapp,omitempty"` } @@ -66,6 +67,19 @@ func ManifestListFromJson(data io.Reader) []*Manifest { } } +func (m *Manifest) HasClient() bool { + return m.Webapp != nil +} + +func (m *Manifest) ClientManifest() *Manifest { + cm := new(Manifest) + *cm = *m + cm.Name = "" + cm.Description = "" + cm.Backend = nil + return cm +} + // FindManifest will find and parse the manifest in a given directory. // // In all cases other than a does-not-exist error, path is set to the path of the manifest file that was -- cgit v1.2.3-1-g7c22