{"modulePath":"github.com/nhatthm/plugin-registry","version":"v0.4.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\nPackage plugin provides functionalities for reading plugin configuration.\n\n## Constants\n\n```go\nconst (\n\t// MetadataFile is the plugin metadata file.\n\tMetadataFile = \".plugin.registry.yaml\"\n)\n```\n\n## Variables\n\n```go\nvar ErrPluginNotExist = errors.New(\"plugin does not exist\")\n```\nErrPluginNotExist indicates that the plugin does not exist.\n\n## Types\n\n```go\ntype Artifact struct {\n\tFile string `yaml:\"file\"`\n}\n```\nArtifact represents all information about an artifact of a plugin.\n\n```go\ntype ArtifactIdentifier struct {\n\tOS   string\n\tArch string\n}\n```\nArtifactIdentifier represents information to identify an artifact.\n\n```go\nfunc NewArtifactIdentifier(os, arch string) ArtifactIdentifier\n```\nNewArtifactIdentifier creates a new ArtifactIdentifier.\n\n```go\nfunc RuntimeArtifactIdentifier() ArtifactIdentifier\n```\nRuntimeArtifactIdentifier returns the system's identifier.\n\n```go\nfunc RuntimeArtifactIdentifierWithoutArch() ArtifactIdentifier\n```\nRuntimeArtifactIdentifierWithoutArch returns the system's identifier without arch.\n\n```go\nfunc (a ArtifactIdentifier) String() string\n```\nString satisfies fmt.Stringer.\n\n```go\nfunc (a *ArtifactIdentifier) UnmarshalYAML(value *yaml.Node) error\n```\nUnmarshalYAML satisfies yaml.Unmarshaler.\n\n```go\ntype Artifacts map[ArtifactIdentifier]Artifact\n```\nArtifacts is a map of Artifact, identified by os and arch.\n\n```go\nfunc (a *Artifacts) Has(id ArtifactIdentifier) bool\n```\nHas checks whether the artifact is in the list.\n\n```go\nfunc (a Artifacts) MarshalYAML() (interface{}, error)\n```\nMarshalYAML satisfies yaml.Marshaler.\n\n```go\ntype Plugin struct {\n\tName        string    `yaml:\"name\"`\n\tURL         string    `yaml:\"url\"`\n\tVersion     string    `yaml:\"version\"`\n\tDescription string    `yaml:\"description\"`\n\tEnabled     bool      `yaml:\"enabled\"`\n\tHidden      bool      `yaml:\"hidden\"`\n\tArtifacts   Artifacts `yaml:\"artifacts\"`\n\tTags        Tags      `yaml:\"tags\"`\n}\n```\nPlugin represents metadata of a plugin.\n\n```go\nfunc Load(fs afero.Fs, path string) (*Plugin, error)\n```\nLoad loads plugin metadata.\n\n```go\nfunc (p *Plugin) ResolveArtifact(a Artifact) Artifact\n```\nResolveArtifact replaces all placeholders in artifact definition by real values.\n\n```go\nfunc (p *Plugin) RuntimeArtifact() Artifact\n```\nRuntimeArtifact returns the artifact of current arch.\n\n```go\nfunc (p *Plugin) UnmarshalYAML(value *yaml.Node) error\n```\nUnmarshalYAML satisfies yaml.Unmarshaler.\n\n```go\ntype Plugins map[string]Plugin\n```\nPlugins is a map of plugins.\n\n```go\nfunc (p Plugins) FilterByTag(tag string) Plugins\n```\nFilterByTag filter the plugins by tags.\n\n```go\nfunc (p Plugins) Has(name string) bool\n```\nHas checks whether the plugin is in the map or not.\n\n```go\ntype Tags []string\n```\nTags is a list of string tag.\n\n```go\nfunc (t Tags) Contains(tag string) bool\n```\nContains checks whether a tag is in the list or not.\n\n","path":"github.com/nhatthm/plugin-registry/plugin","name":"plugin","synopsis":"Package plugin provides functionalities for reading plugin configuration.","isRedistributable":true}
