package buildinfo

import "github.com/moby/buildkit/util/buildinfo"

Index

Constants

const (
	// ExportNone doesn't export build dependencies.
	ExportNone ExportMode = 0
	// ExportImageConfig exports build dependencies to
	// the image config.
	ExportImageConfig = 1 << iota
	// ExportMetadata exports build dependencies as metadata to
	// the exporter response.
	ExportMetadata
	// ExportAll exports build dependencies as metadata and
	// image config.
	ExportAll = -1
)
const ExportDefault = ExportAll

ExportDefault is the default export mode for buildinfo opt.

Functions

func Decode

func Decode(enc string) (bi binfotypes.BuildInfo, _ error)

Decode decodes a base64 encoded build info.

func Encode

func Encode(ctx context.Context, buildInfo []byte, buildSources map[string]string) ([]byte, error)

Encode encodes build info.

func Format

func Format(dt []byte, format FormatOpts) (_ []byte, err error)

Format formats build info.

func GetMetadata

func GetMetadata(metadata map[string][]byte, key string, reqFrontend string, reqAttrs map[string]string) ([]byte, error)

GetMetadata returns buildinfo metadata for the specified key. If the key is already there, result will be merged.

Types

type ExportMode

type ExportMode int

ExportMode represents the export mode for buildinfo opt.

func ParseExportMode

func ParseExportMode(s string) (ExportMode, error)

ParseExportMode returns the export mode matching a string.

type FormatOpts

type FormatOpts struct {
	RemoveAttrs bool
}

FormatOpts holds build info format options.

Source Files

buildinfo.go export.go

Directories

PathSynopsis
util/buildinfo/types
Version
v0.10.0-rc1
Published
Feb 14, 2022
Platform
js/wasm
Imports
10 packages
Last checked
1 minute ago

Tools for package owners.