Documentation ¶
Overview ¶
Package plugin provides functionalities for reading plugin configuration.
Index ¶
Constants ¶
const (
// MetadataFile is the plugin metadata file.
MetadataFile = ".plugin.registry.yaml"
)
Variables ¶
var ErrPluginNotExist = errors.New("plugin does not exist")
ErrPluginNotExist indicates that the plugin does not exist.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
File string `yaml:"file"`
}
Artifact represents all information about an artifact of a plugin.
type ArtifactIdentifier ¶
ArtifactIdentifier represents information to identify an artifact.
func NewArtifactIdentifier ¶
func NewArtifactIdentifier(os, arch string) ArtifactIdentifier
NewArtifactIdentifier creates a new ArtifactIdentifier.
func RuntimeArtifactIdentifier ¶
func RuntimeArtifactIdentifier() ArtifactIdentifier
RuntimeArtifactIdentifier returns the system's identifier.
func RuntimeArtifactIdentifierWithoutArch ¶
func RuntimeArtifactIdentifierWithoutArch() ArtifactIdentifier
RuntimeArtifactIdentifierWithoutArch returns the system's identifier without arch.
func (ArtifactIdentifier) String ¶
func (a ArtifactIdentifier) String() string
String satisfies fmt.Stringer.
func (*ArtifactIdentifier) UnmarshalYAML ¶
func (a *ArtifactIdentifier) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML satisfies yaml.Unmarshaler.
type Artifacts ¶
type Artifacts map[ArtifactIdentifier]Artifact
Artifacts is a map of Artifact, identified by os and arch.
func (*Artifacts) Has ¶
func (a *Artifacts) Has(id ArtifactIdentifier) bool
Has checks whether the artifact is in the list.
func (Artifacts) MarshalYAML ¶ added in v0.1.6
MarshalYAML satisfies yaml.Marshaler.
type Plugin ¶
type Plugin struct { Name string `yaml:"name"` URL string `yaml:"url"` Version string `yaml:"version"` Description string `yaml:"description"` Enabled bool `yaml:"enabled"` Hidden bool `yaml:"hidden"` Artifacts Artifacts `yaml:"artifacts"` Tags Tags `yaml:"tags"` }
Plugin represents metadata of a plugin.
func (*Plugin) ResolveArtifact ¶
ResolveArtifact replaces all placeholders in artifact definition by real values.
func (*Plugin) RuntimeArtifact ¶
RuntimeArtifact returns the artifact of current arch.
func (*Plugin) UnmarshalYAML ¶
UnmarshalYAML satisfies yaml.Unmarshaler.
type Plugins ¶ added in v0.1.3
Plugins is a map of plugins.
func (Plugins) FilterByTag ¶ added in v0.1.3
FilterByTag filter the plugins by tags.