plugin

package
v0.0.0-...-adebc45 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(dir string, f func(plugin *Plugin) error) error

Walk loads every buf.plugin.yaml found in the specified root directory and calls the callback function with each plugin. The callback is called in dependency order (all plugin dependencies are printed before the plugin).

Types

type Dependency

type Dependency struct {
	Plugin string `yaml:"plugin"`
}

Dependency represents a dependency one plugin has on another.

type IncludePlugin

type IncludePlugin struct {
	// contains filtered or unexported fields
}

func ParsePluginsEnvVar

func ParsePluginsEnvVar(pluginsEnv string) ([]IncludePlugin, error)

func (IncludePlugin) Matches

func (p IncludePlugin) Matches(pluginName, pluginVersion, latestVersion string) bool

type Plugin

type Plugin struct {
	// Parsed external yaml config
	bufremotepluginconfig.ExternalConfig `yaml:"-"`

	Path    string `yaml:"-"`
	Relpath string `yaml:"-"`
	// Plugin identity (parsed from ExternalConfig.Name).
	Identity bufremotepluginref.PluginIdentity `yaml:"-"`
	// contains filtered or unexported fields
}

Plugin represents metadata (and filesystem path) information about a plugin.

func FilterByBaseRefDiff

func FilterByBaseRefDiff(ctx context.Context, plugins []*Plugin) ([]*Plugin, error)

FilterByBaseRefDiff filters the passed plugins to the ones that changed from a base Git ref to diff against. It calculates the changed files from that ref, and filters the relevant files in the plugins directory(ies) to determine which plugins changed from the ones passed.

func FilterByPluginsEnv

func FilterByPluginsEnv(plugins []*Plugin, pluginsEnv string) ([]*Plugin, error)

FilterByPluginsEnv returns matching plugins based on a space separated list of plugins (and optional versions) to include.

func FindAll

func FindAll(dir string) ([]*Plugin, error)

FindAll returns every plugin found in the specified root directory.

func Load

func Load(path string, basedir string) (*Plugin, error)

Load loads the buf.plugin.yaml at the specified path and returns a structure containing metadata for the plugin.

func (*Plugin) GitCommit

func (p *Plugin) GitCommit(ctx context.Context) string

GitCommit calculates the last git commit for the plugin's directory. This will return an empty string if there are uncommitted changes to the plugin's directory. This is used to label the built Docker image and also avoid unnecessary Docker builds.

func (*Plugin) String

func (p *Plugin) String() string

Jump to

Keyboard shortcuts

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