Documentation
¶
Index ¶
- Constants
- func ParsePluginPath(pluginPath string) (remote string, owner string, name string, _ error)
- func ParsePluginVersionPath(pluginVersionPath string) (remote string, owner string, name string, version string, _ error)
- func ParseTemplatePath(templatePath string) (remote string, owner string, name string, _ error)
- func TemplateConfigToProtoPluginConfigs(templateConfig *TemplateConfig) []*registryv1alpha1.PluginConfig
- func TemplateVersionConfigToProtoPluginVersionMappings(templateVersionConfig *TemplateVersionConfig) []*registryv1alpha1.PluginVersionMapping
- func ValidateTemplateName(templateName string) error
- type File
- type MergedPluginResult
- type PluginConfig
- type PluginResponse
- type PluginVersion
- type TemplateConfig
- type TemplateVersionConfig
Constants ¶
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 ¶
ParsePluginPath parses a string in the format <buf.build/owner/plugins/name> into remote, owner and name.
func ParsePluginVersionPath ¶ added in v0.55.0
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 ¶
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 ¶
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 File ¶ added in v0.55.0
File represents a generated file, and tracks the plugin that originally generated it (i.e. if insertion points are applied to this File, the PluginName will be unchanged).
type MergedPluginResult ¶ added in v0.55.0
type MergedPluginResult struct {
Files []*File
}
MergedPluginResult holds the files for a plugin result.
func MergeInsertionPoints ¶ added in v0.54.0
func MergeInsertionPoints(pluginResponses []*PluginResponse) ([]*MergedPluginResult, error)
MergeInsertionPoints traverses the plugin results and merges any insertion points present in any responses. The order of inserts depends on the order of the input plugins. The returned results are in the same order as the input plugin results.
type PluginConfig ¶
PluginConfig is the config used to describe a plugin in a new template.
type PluginResponse ¶
type PluginResponse struct {
Response *pluginpb.CodeGeneratorResponse
PluginName string
}
PluginResponse encapsulates a CodeGeneratorResponse, along with the name of the plugin that created it.
func NewPluginResponse ¶
func NewPluginResponse(response *pluginpb.CodeGeneratorResponse, pluginName string) *PluginResponse
NewPluginResponse retruns a new *PluginResponse.
type PluginVersion ¶
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.