packages

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package packages contains utilities for working with Pulumi package lock files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToPackageDescriptors

func ToPackageDescriptors(packages []PackageDecl) (map[tokens.Package]*schema.PackageDescriptor, error)

Types

type PackageDecl

type PackageDecl struct {
	// PackageDeclarationVersion is the version of the package declaration file.
	PackageDeclarationVersion int `yaml:"packageDeclarationVersion"`
	// Name is the name of the plugin.
	Name string `yaml:"name"`
	// Version is the version of the plugin.
	Version string `yaml:"version,omitempty"`
	// PluginDownloadURL is the URL to download the plugin from.
	DownloadURL string `yaml:"downloadUrl,omitempty"`
	// Parameterization is the parameterization of the package.
	Parameterization *ParameterizationDecl `yaml:"parameterization,omitempty"`
}

PackageDecl defines the structure of a package declaration file.

func SearchPackageDecls

func SearchPackageDecls(directory string) ([]PackageDecl, error)

SearchPackageDecls searches the given directory down recursively for package lock .yaml files.

func (*PackageDecl) Validate

func (p *PackageDecl) Validate() (bool, error)

Validate checks if a package declaration is valid. The first return value is a boolean indicating if the package declaration is even a package declaration. The second return value is an error if the package declaration is invalid.

type ParameterizationDecl

type ParameterizationDecl struct {
	// Name is the name of the parameterized package.
	Name string `yaml:"name"`
	// Version is the version of the parameterized package.
	Version string `yaml:"version"`
	// Value is the value of the parameter. Value is a base64 encoded byte array, use SetValue and GetValue to manipulate the actual value.
	Value string `yaml:"value"`
}

ParameterizationDecl defines the structure for the parameterization values of a package.

func (*ParameterizationDecl) GetValue

func (p *ParameterizationDecl) GetValue() ([]byte, error)

GetValue returns the value of the parameter as a byte array. This is just a helper around base64.StdEncoding.

func (*ParameterizationDecl) SetValue

func (p *ParameterizationDecl) SetValue(value []byte)

SetValue sets the value of the parameter as a byte array. This is just a helper around base64.StdEncoding.

Jump to

Keyboard shortcuts

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