generate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 3

SchemaVersion is the version of the schema used to generate the lock file

Variables

This section is empty.

Functions

func Marshal

func Marshal(pkgs []GoPackage, goPackagePath string, subPackages []string) ([]byte, error)

Marshal marshals the output to a byte slice

func ReadCache

func ReadCache(filePath string) map[string]GoPackage

ReadCache reads the cache file and returns a map of GoPackages

Types

type GoPackage

type GoPackage struct {
	GoPackagePath string `toml:"-"`
	Version       string `toml:"version"`
	Hash          string `toml:"hash"`
	ReplacedPath  string `toml:"replaced,omitempty"`
}

GoPackage is a struct to hold Nix Go module parameters

func GenGolangPackages

func GenGolangPackages(directory string, goMod2NixPath string, numWorkers int) ([]GoPackage, error)

GenGolangPackages generates a list of packages from a go.mod file

type Output

type Output struct {
	SchemaVersion int                  `toml:"schema"`
	Mod           map[string]GoPackage `toml:"mod"`

	// Packages with passed import paths trigger `go install` based on this list
	SubPackages []string `toml:"subPackages,omitempty"`

	// Packages with passed import paths has a "default package" which pname & version is inherit from
	GoPackagePath string `toml:"goPackagePath,omitempty"`
}

Output is the output of the generator

type ParallellExecutor

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

ParallellExecutor - Execute callback functions in parallell

func NewParallellExecutor

func NewParallellExecutor(maxWorkers int) *ParallellExecutor

NewParallellExecutor - Create a new ParallellExecutor

func (*ParallellExecutor) Add

func (e *ParallellExecutor) Add(fn func() error)

Add - Add a new callback function to the executor

func (*ParallellExecutor) Wait

func (e *ParallellExecutor) Wait() error

Wait - Wait for all callbacks to finish and return the first error

Jump to

Keyboard shortcuts

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