manifest

package
v0.0.0-...-ae1e1a0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Manifest *Manifest `yaml:"manifest,omitempty"`
	// Integrity is the hash of the requirements.txt file and the Manifest for
	// ensuring the integrity of the entire gazelle_python.yaml file. This
	// controls the testing to keep the gazelle_python.yaml file up-to-date.
	Integrity string `yaml:"integrity,omitempty"`
}

File represents the gazelle_python.yaml file.

func NewFile

func NewFile(manifest *Manifest) *File

NewFile creates a new File with a given Manifest.

func (*File) Decode

func (f *File) Decode(manifestPath string) error

Decode decodes the manifest file from the given path.

func (*File) EncodeWithIntegrity

func (f *File) EncodeWithIntegrity(w io.Writer, manifestGeneratorHashFile, requirements io.Reader) error

Encode encodes the manifest file to the given writer.

func (*File) EncodeWithoutIntegrity

func (f *File) EncodeWithoutIntegrity(w io.Writer) error

func (*File) VerifyIntegrity

func (f *File) VerifyIntegrity(manifestGeneratorHashFile, requirements io.Reader) (bool, error)

VerifyIntegrity verifies if the integrity set in the File is valid.

type Manifest

type Manifest struct {
	// ModulesMapping is the mapping from importable modules to which Python
	// wheel name provides these modules.
	ModulesMapping ModulesMapping `yaml:"modules_mapping"`
	// PipDepsRepositoryName is the name of the pip_parse repository target.
	// DEPRECATED
	PipDepsRepositoryName string `yaml:"pip_deps_repository_name,omitempty"`
	// PipRepository contains the information for pip_parse or pip_repository
	// target.
	PipRepository *PipRepository `yaml:"pip_repository,omitempty"`
}

Manifest represents the structure of the Gazelle manifest file.

type ModulesMapping

type ModulesMapping map[string]string

ModulesMapping is the type used to map from importable Python modules to the wheel names that provide these modules.

func (ModulesMapping) MarshalYAML

func (m ModulesMapping) MarshalYAML() (interface{}, error)

MarshalYAML makes sure that we sort the module names before marshaling the contents of `ModulesMapping` to a YAML file. This ensures that the file is deterministically generated from the map.

type PipRepository

type PipRepository struct {
	// The name of the pip_parse or pip_repository target.
	Name string
}

Directories

Path Synopsis
generate.go is a program that generates the Gazelle YAML manifest.
generate.go is a program that generates the Gazelle YAML manifest.
test.go is a unit test that asserts the Gazelle YAML manifest is up-to-date in regards to the requirements.txt.
test.go is a unit test that asserts the Gazelle YAML manifest is up-to-date in regards to the requirements.txt.

Jump to

Keyboard shortcuts

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