bufremoteplugin

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PluginsPathName is the path prefix used to signify that
	// a name belongs to a plugin.
	PluginsPathName = "plugins"

	// TemplatesPathName is the path prefix used to signify that
	// a name belongs to a template.
	TemplatesPathName = "templates"
)

Variables

This section is empty.

Functions

func ParsePluginPath

func ParsePluginPath(pluginPath string) (remote string, owner string, name string, _ error)

ParsePluginPath parses a string in the format <buf.build/owner/plugins/name> into remote, owner and name.

func ParsePluginVersionPath

func ParsePluginVersionPath(pluginVersionPath string) (remote string, owner string, name string, version string, _ error)

ParsePluginVersionPath parses a string in the format <buf.build/owner/plugins/name[:version]> into remote, owner, name and version. The version is empty if not specified.

func ParseTemplatePath

func ParseTemplatePath(templatePath string) (remote string, owner string, name string, _ error)

ParseTemplatePath parses a string in the format <buf.build/owner/templates/name> into remote, owner and name.

func TemplateConfigToProtoPluginConfigs

func TemplateConfigToProtoPluginConfigs(templateConfig *TemplateConfig) []*registryv1alpha1.PluginConfig

TemplateConfigToProtoPluginConfigs converts the template config to a slice of proto plugin configs, suitable for use with the Plugin Service CreateTemplate RPC.

func TemplateVersionConfigToProtoPluginVersionMappings

func TemplateVersionConfigToProtoPluginVersionMappings(
	templateVersionConfig *TemplateVersionConfig,
) []*registryv1alpha1.PluginVersionMapping

TemplateVersionConfigToProtoPluginVersionMappings converts the template version config to a slice of Plugin version mappings, suitable for use with the Plugin Service CreateTemplateVersion RPC.

func ValidateTemplateName

func ValidateTemplateName(templateName string) error

ValidateTemplateName validates the format of the template name. This is only used for client side validation and attempts to avoid validation constraints that we may want to change.

Types

type PluginConfig

type PluginConfig struct {
	Owner      string
	Name       string
	Parameters []string
}

PluginConfig is the config used to describe a plugin in a new template.

type PluginVersion

type PluginVersion struct {
	Owner   string
	Name    string
	Version string
}

PluginVersion describes a version of a plugin for use in a template version.

type TemplateConfig

type TemplateConfig struct {
	Plugins []PluginConfig
}

TemplateConfig is the config used to describe the plugins of a new template.

func ParseTemplateConfig

func ParseTemplateConfig(config string) (*TemplateConfig, error)

ParseTemplateConfig parses the input template config as a path or JSON/YAML literal.

type TemplateVersionConfig

type TemplateVersionConfig struct {
	PluginVersions []PluginVersion
}

TemplateVersionConfig is the config used to describe the plugin version of a new template version.

func ParseTemplateVersionConfig

func ParseTemplateVersionConfig(config string) (*TemplateVersionConfig, error)

ParseTemplateVersionConfig parses the input template version config as a path or JSON/YAML literal.

Jump to

Keyboard shortcuts

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