pkgbuilder

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0, BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReposInfo

type ReposInfo interface {
	ResolveRepoRef(repoRef string) (string, bool)
	ResolveCommitIndex(repoRef string, index int) (string, bool)
}

type RootPkg

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

RootPkg is a package without any parent package.

func NewRootPkg

func NewRootPkg() *RootPkg

NewRootPkg creates a new package for testing.

func (*RootPkg) Build

func (rp *RootPkg) Build(path string, pkgName string, reposInfo ReposInfo) error

Build outputs the current data structure as a set of (nested) package in the provided path.

func (*RootPkg) ExpandPkg

func (rp *RootPkg) ExpandPkg(t *testing.T, reposInfo ReposInfo) string

ExpandPkg writes the provided package to disk. The name of the root package will just be set to "base".

func (*RootPkg) ExpandPkgWithName

func (rp *RootPkg) ExpandPkgWithName(t *testing.T, rootName string, reposInfo ReposInfo) string

ExpandPkgWithName writes the provided package to disk and uses the given rootName to set the value of the package directory and the metadata.name field of the root package.

func (*RootPkg) WithFile

func (rp *RootPkg) WithFile(name, content string) *RootPkg

WithFile configures the package to contain a file with the provided name and the given content.

func (*RootPkg) WithSubPackages

func (rp *RootPkg) WithSubPackages(ps ...*SubPkg) *RootPkg

WithSubPackages adds the provided packages as subpackages to the current package

type SubPkg

type SubPkg struct {
	Name string
	// contains filtered or unexported fields
}

func NewSubPkg

func NewSubPkg(name string) *SubPkg

NewSubPkg returns a new subpackage for testing.

func (*SubPkg) WithFile

func (sp *SubPkg) WithFile(name, content string) *SubPkg

WithFile configures the package to contain a file with the provided name and the given content.

func (*SubPkg) WithSubPackages

func (sp *SubPkg) WithSubPackages(ps ...*SubPkg) *SubPkg

WithSubPackages adds the provided packages as subpackages to the current package

Jump to

Keyboard shortcuts

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