convert

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MPL-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package convert provides LLB converter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalLLB

func MarshalLLB(ctx context.Context, graph *solver.PackageGraph, solver SolverFunc, options *environment.Options) (*llb.Definition, error)

MarshalLLB translates package graph into LLB DAG and marshals it.

Types

type GraphLLB

type GraphLLB struct {
	*solver.PackageGraph

	Options *environment.Options

	BaseImages   map[v1alpha2.Variant]llb.State
	Checksummer  llb.State
	LocalContext llb.State
	// contains filtered or unexported fields
}

GraphLLB wraps PackageGraph to provide LLB conversion.

GraphLLB caches common images used in the build.

func NewGraphLLB

func NewGraphLLB(graph *solver.PackageGraph, solverFn SolverFunc, options *environment.Options) *GraphLLB

NewGraphLLB creates new GraphLLB and initializes shared images.

func (*GraphLLB) Build

func (graph *GraphLLB) Build(ctx context.Context) (llb.State, error)

Build converts package graph to LLB.

func (*GraphLLB) Marshal

func (graph *GraphLLB) Marshal(ctx context.Context) (*llb.Definition, error)

Marshal returns marshaled LLB.

type NodeLLB

type NodeLLB struct {
	*solver.PackageNode

	Graph  *GraphLLB
	Prefix string
}

NodeLLB wraps PackageNode to provide LLB conversion.

func NewNodeLLB

func NewNodeLLB(node *solver.PackageNode, graph *GraphLLB) *NodeLLB

NewNodeLLB wraps PackageNode for LLB conversion.

func (*NodeLLB) Build

func (node *NodeLLB) Build(ctx context.Context) (llb.State, error)

Build converts PackageNode to buildkit LLB.

type SolverFunc

type SolverFunc func(ctx context.Context, platform environment.Platform, target string) (*client.Result, error)

SolverFunc can be called to solve the package into the llb state via buildkit.

Jump to

Keyboard shortcuts

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