model

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LinuxAmd64   = "linux-amd64"
	DarwinAmd64  = "darwin-amd64"
	WindowsAmd64 = "windows-amd64"
)
View Source
const (
	// AllPerPage signals the store to return all results, avoiding pagination of any kind.
	AllPerPage = -1
)

Variables

View Source
var BetaLabel = Label{
	Name:        "Beta",
	Description: "This plugin is currently in Beta and is not recommended for use in production.",
	URL:         "https://mattermost.com/pl/default-beta-plugins",
}
View Source
var CommunityLabel = Label{
	Name:        "Community",
	Description: "This plugin is maintained by the Open Source Community.",
	URL:         "https://mattermost.com/pl/default-community-plugins",
}
View Source
var EnterpriseLabel = Label{
	Name:        "Professional/Enterprise",
	Description: "This plugin requires a Professional or Enterprise subscription.",
	URL:         "https://mattermost.com/pricing/",
}
View Source
var ExperimentalLabel = Label{
	Name:        "Experimental",
	Description: "This plugin is marked as experimental and not meant for production use. Please use with caution.",
	URL:         "https://mattermost.com/pl/default-experimental-plugins",
}
View Source
var PartnerLabel = Label{
	Name:        "Partner",
	Description: "This plugin is maintained by a Mattermost Partner.",
	URL:         "https://mattermost.com/pl/default-partner-plugins",
}

Functions

func PluginsToWriter

func PluginsToWriter(w io.Writer, plugins []*Plugin) error

PluginsToWriter encodes a json-encoded list of plugins to the given io.Writer.

Types

type AuthorType

type AuthorType string
const (
	Mattermost AuthorType = "mattermost"
	Partner    AuthorType = "partner"
	Community  AuthorType = "community"
)

type HostingType

type HostingType string
const (
	OnPrem HostingType = "on-prem"
	Cloud  HostingType = "cloud"
)

type Label

type Label struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	URL         string `json:"url"`
	Color       string `json:"color"`
}

Label represents a label shown in the Plugin Marketplace UI.

type PlatformBundleMetadata

type PlatformBundleMetadata struct {
	DownloadURL string `json:"download_url,omitempty"`
	Signature   string `json:"signature,omitempty"`
}

PlatformBundleMetadata holds the necessary data to fetch and verify a plugin built for a specific platform

type PlatformBundles

type PlatformBundles struct {
	LinuxAmd64   PlatformBundleMetadata `json:"linux-amd64,omitempty" yaml:"linux-amd64,omitempty"`
	DarwinAmd64  PlatformBundleMetadata `json:"darwin-amd64,omitempty" yaml:"darwin-amd64,omitempty"`
	WindowsAmd64 PlatformBundleMetadata `json:"windows-amd64,omitempty" yaml:"windows-amd64,omitempty"`
}

type Plugin

type Plugin struct {
	HomepageURL     string                    `json:"homepage_url"`
	IconData        string                    `json:"icon_data"` // The base64 encoding of an svg image
	DownloadURL     string                    `json:"download_url"`
	ReleaseNotesURL string                    `json:"release_notes_url"`
	Labels          []Label                   `json:"labels,omitempty"`
	Hosting         HostingType               `json:"hosting"`       // Indicated if the plugin is limited to a certain hosting type
	AuthorType      AuthorType                `json:"author_type"`   // The maintainer of the plugin
	ReleaseStage    ReleaseStage              `json:"release_stage"` // The stage in the software release cycle that the plugin is in
	Enterprise      bool                      `json:"enterprise"`    // Indicated if the plugin is an enterprise plugin
	Signature       string                    `json:"signature"`     // A signature of a plugin saved in base64 encoding.
	RepoName        string                    `json:"repo_name"`
	Manifest        *mattermostModel.Manifest `json:"manifest"`
	Platforms       PlatformBundles           `json:"platforms"`
	UpdatedAt       time.Time                 `json:"updated_at"` // The point in time this release of the plugin was added to the Plugin Marketplace
}

Plugin represents a Mattermost plugin in the Plugin Marketplace.

func PluginFromReader

func PluginFromReader(reader io.Reader) (*Plugin, error)

PluginFromReader decodes a json-encoded cluster from the given io.Reader.

func PluginsFromReader

func PluginsFromReader(reader io.Reader) ([]*Plugin, error)

PluginsFromReader decodes a json-encoded list of plugins from the given io.Reader.

func (*Plugin) AddLabels

func (p *Plugin) AddLabels()

type PluginFilter

type PluginFilter struct {
	Page              int
	PerPage           int
	Filter            string
	ServerVersion     string
	EnterprisePlugins bool
	Cloud             bool
	Platform          string
	ReturnAllVersions bool
	PluginID          string
}

PluginFilter describes the parameters used to constrain a set of plugins.

type ReleaseStage

type ReleaseStage string
const (
	Production   ReleaseStage = "production"
	Beta         ReleaseStage = "beta"
	Experimental ReleaseStage = "experimental"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL