codegen

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 74 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DebugNone = iota
	DebugStartStop
	DebugContinue
	DebugNext
	DebugRestart
	DebugStep
	DebugStepOut
	DebugTerminate
)
View Source
const (
	// HistoryComment is an indicator in the image history that the history layer
	// was produced by the HLB compiler.
	HistoryComment = "hlb.v0"
)
View Source
const (
	// ModuleFilename is the filename of the HLB module expected to be in the
	// solved filesystem provided to the import declaration.
	ModuleFilename = "module.hlb"
)

Variables

View Source
var (
	PrototypeIn  []reflect.Type
	PrototypeOut []reflect.Type
)
View Source
var (
	Callables = map[ast.Kind]map[string]interface{}{
		ast.Filesystem: {
			"scratch":               Scratch{},
			"image":                 Image{},
			"http":                  HTTP{},
			"git":                   Git{},
			"local":                 Local{},
			"frontend":              Frontend{},
			"run":                   Run{},
			"env":                   Env{},
			"dir":                   Dir{},
			"user":                  User{},
			"mkdir":                 Mkdir{},
			"mkfile":                Mkfile{},
			"rm":                    Rm{},
			"copy":                  Copy{},
			"merge":                 Merge{},
			"diff":                  Diff{},
			"entrypoint":            Entrypoint{},
			"cmd":                   Cmd{},
			"label":                 Label{},
			"expose":                Expose{},
			"volumes":               Volumes{},
			"stopSignal":            StopSignal{},
			"dockerPush":            DockerPush{},
			"dockerLoad":            DockerLoad{},
			"download":              Download{},
			"downloadTarball":       DownloadTarball{},
			"downloadOCITarball":    DownloadOCITarball{},
			"downloadDockerTarball": DownloadDockerTarball{},
		},
		ast.String: {
			"format":    Format{},
			"template":  Template{},
			"manifest":  Manifest{},
			"localArch": LocalArch{},
			"localOs":   LocalOS{},
			"localCwd":  LocalCwd{},
			"localEnv":  LocalEnv{},
			"localRun":  LocalRun{},
		},
		ast.Pipeline: {
			"stage":    Stage{},
			"parallel": Stage{},
		},
		"option::image": {
			"resolve":  Resolve{},
			"platform": Platform{},
		},
		"option::http": {
			"checksum": Checksum{},
			"chmod":    Chmod{},
			"filename": Filename{},
		},
		"option::git": {
			"keepGitDir": KeepGitDir{},
		},
		"option::local": {
			"includePatterns": IncludePatterns{},
			"excludePatterns": ExcludePatterns{},
		},
		"option::frontend": {
			"input": FrontendInput{},
			"opt":   FrontendOpt{},
		},
		"option::run": {
			"readonlyRootfs": ReadonlyRootfs{},
			"env":            RunEnv{},
			"dir":            RunDir{},
			"user":           RunUser{},
			"ignoreCache":    IgnoreCache{},
			"network":        Network{},
			"security":       Security{},
			"shlex":          Shlex{},
			"host":           Host{},
			"ssh":            SSH{},
			"forward":        Forward{},
			"secret":         Secret{},
			"mount":          Mount{},
		},
		"option::ssh": {
			"target":     MountTarget{},
			"uid":        UID{},
			"gid":        GID{},
			"mode":       UtilChmod{},
			"localPaths": LocalPaths{},
		},
		"option::secret": {
			"uid":             UID{},
			"gid":             GID{},
			"mode":            UtilChmod{},
			"includePatterns": IncludePatterns{},
			"excludePatterns": ExcludePatterns{},
		},
		"option::mount": {
			"readonly":   Readonly{},
			"tmpfs":      Tmpfs{},
			"sourcePath": SourcePath{},
			"cache":      Cache{},
		},
		"option::mkdir": {
			"createParents": CreateParents{},
			"chown":         Chown{},
			"createdTime":   CreatedTime{},
		},
		"option::mkfile": {
			"chown":       Chown{},
			"createdTime": CreatedTime{},
		},
		"option::rm": {
			"allowNotFound": AllowNotFound{},
			"allowWildcard": AllowWildcard{},
		},
		"option::copy": {
			"followSymlinks":     FollowSymlinks{},
			"contentsOnly":       ContentsOnly{},
			"unpack":             Unpack{},
			"createDestPath":     CreateDestPath{},
			"allowWildcard":      CopyAllowWildcard{},
			"allowEmptyWildcard": AllowEmptyWildcard{},
			"chown":              UtilChown{},
			"chmod":              UtilChmod{},
			"createdTime":        UtilCreatedTime{},
			"includePatterns":    IncludePatterns{},
			"excludePatterns":    ExcludePatterns{},
		},
		"option::localRun": {
			"ignoreError":   IgnoreError{},
			"onlyStderr":    OnlyStderr{},
			"includeStderr": IncludeStderr{},
			"shlex":         Shlex{},
		},
		"option::template": {
			"stringField": StringField{},
		},
		"option::manifest": {
			"platform": Platform{},
		},
		"option::dockerPush": {
			"stargz": Stargz{},
		},
	}
)
View Source
var (
	// DefaultFilename is the default filename for a HLB module.
	DefaultFilename = "build.hlb"
)
View Source
var (
	// ErrDebugExit is a special error to early exit from a program.
	ErrDebugExit = errors.Errorf("exiting debugger")
)

Functions

func Arg

func Arg(ctx context.Context, n int) ast.Node

func Binding

func Binding(ctx context.Context) *ast.Binding

func CheckPrototype

func CheckPrototype(callable interface{}) error

func DefaultPlatform

func DefaultPlatform(ctx context.Context) specs.Platform

func ExecWithFS

func ExecWithFS(ctx context.Context, cln *client.Client, fs Filesystem, opts Option, stdin io.Reader, stdout, stderr io.Writer, args ...string) error

func ExecWithSolveErr

func ExecWithSolveErr(ctx context.Context, c gateway.Client, se *solvererrdefs.SolveError, stdin io.ReadCloser, stdout, stderr io.Writer, args ...string) error

func FramesToSources

func FramesToSources(frames []Frame) (sources []*errdefs.Source)

func FramesToSpans

func FramesToSpans(ctx context.Context, frames []Frame) []*diagnostic.SpanError

func GlobalSolveOpts

func GlobalSolveOpts(ctx context.Context) []solver.SolveOption

func ImageResolver

func ImageResolver(ctx context.Context) llb.ImageMetaResolver

func Module

func Module(ctx context.Context) *ast.Module

func ModuleDir

func ModuleDir(ctx context.Context) string

func MultiWriter

func MultiWriter(ctx context.Context) *solver.MultiWriter

func NewCachedImageResolver

func NewCachedImageResolver(cln *client.Client) llb.ImageMetaResolver

func NopWriteCloser

func NopWriteCloser(w io.Writer) io.WriteCloser

func ParseModuleURI

func ParseModuleURI(ctx context.Context, cln *client.Client, dir ast.Directory, uri string) (*ast.Module, error)

ParseModuleURI returns an ast.Module based on the URI provided. The module may live on the local filesystem or remote depending on the scheme.

func ProgramCounter

func ProgramCounter(ctx context.Context) ast.Node

func Progress

func Progress(ctx context.Context) solver.Progress

func ReflectTo

func ReflectTo(v Value, t reflect.Type) (reflect.Value, error)

func ReturnType

func ReturnType(ctx context.Context) ast.Kind

func SessionID

func SessionID(ctx context.Context) string

func ShlexArgs

func ShlexArgs(args []string, shlex bool) ([]string, error)

func SourceMap

func SourceMap(ctx context.Context) (opts []llb.ConstraintsOpt)

func SubtestDebuggerBacktrace

func SubtestDebuggerBacktrace(t *testing.T, d Debugger)

SubtestDebuggerBacktrace tests that the debugger produces correct backtraces.

func SubtestDebuggerBreakpoint

func SubtestDebuggerBreakpoint(t *testing.T, d Debugger)

SubtestDebuggerBreakpoint tests that the debugger create and halt at breakpoints.

func SubtestDebuggerEarlyExit

func SubtestDebuggerEarlyExit(t *testing.T, d Debugger)

SubtestDebuggerEarlyExit tests that the debugger can exit immediately.

func SubtestDebuggerMovement

func SubtestDebuggerMovement(t *testing.T, d Debugger)

SubtestDebuggerMovement tests that the debugger move correctly.

func SubtestDebuggerSourceDefinedBreakpoint

func SubtestDebuggerSourceDefinedBreakpoint(t *testing.T, d Debugger)

SubtestDebuggerSourceDefinedBreakpoint tests that the debugger can parse source defined breakpoints and halt at them.

func SubtestDebuggerSuite

func SubtestDebuggerSuite(t *testing.T, factory DebuggerFactory)

SubtestDebuggerSuite is a suite of tests for debuggers. This was abstracted to share tests between codegen's native debugger and the DAP server.

func WithArg

func WithArg(ctx context.Context, n int, arg ast.Node) context.Context

func WithBacktraceError

func WithBacktraceError(ctx context.Context, err error) error

func WithBinding

func WithBinding(ctx context.Context, binding *ast.Binding) context.Context

func WithCallbackErrgroup

func WithCallbackErrgroup(ctx context.Context, g *errgroup.Group) solver.SolveOption

func WithDebugger

func WithDebugger(ctx context.Context, dbgr Debugger) context.Context

func WithDefaultPlatform

func WithDefaultPlatform(ctx context.Context, platform specs.Platform) context.Context

func WithDockerAPI

func WithDockerAPI(ctx context.Context, cln dockerclient.APIClient, auth imagetools.Auth, err error, moby bool) context.Context

func WithFrame

func WithFrame(ctx context.Context, frame Frame) context.Context

func WithGlobalSolveOpts

func WithGlobalSolveOpts(ctx context.Context, opts ...solver.SolveOption) context.Context

func WithImageResolver

func WithImageResolver(ctx context.Context, resolver llb.ImageMetaResolver) context.Context

func WithMultiWriter

func WithMultiWriter(ctx context.Context, mw *solver.MultiWriter) context.Context

func WithProgramCounter

func WithProgramCounter(ctx context.Context, node ast.Node) context.Context

func WithProgress

func WithProgress(ctx context.Context, p solver.Progress) context.Context

func WithReturnType

func WithReturnType(ctx context.Context, kind ast.Kind) context.Context

func WithSessionID

func WithSessionID(ctx context.Context, sessionID string) context.Context

Types

type AllowEmptyWildcard

type AllowEmptyWildcard struct{}

func (AllowEmptyWildcard) Call

func (aew AllowEmptyWildcard) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type AllowNotFound

type AllowNotFound struct{}

func (AllowNotFound) Call

func (anf AllowNotFound) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type AllowWildcard

type AllowWildcard struct{}

func (AllowWildcard) Call

func (aw AllowWildcard) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Breakpoint

type Breakpoint struct {
	ast.Node

	Index int

	// Disabled is true if the breakpoint should not halt the program.
	Disabled bool

	// SourceDefined is true if the breakpoint is defined by the source.
	SourceDefined bool
}

Breakpoint is an intentional stopping point in a program, put in place by the source or debugger.

func (*Breakpoint) ID

func (bp *Breakpoint) ID() string

func (*Breakpoint) Print

func (bp *Breakpoint) Print(ctx context.Context, w io.Writer, cleared bool)

type Cache

type Cache struct {
	ast.Node
}

func (Cache) Call

func (c Cache) Call(ctx context.Context, cln *client.Client, val Value, opts Option, id, mode string) (Value, error)

type Checksum

type Checksum struct{}

func (Checksum) Call

func (c Checksum) Call(ctx context.Context, cln *client.Client, val Value, opts Option, dgst digest.Digest) (Value, error)

type Chmod

type Chmod struct{}

func (Chmod) Call

func (c Chmod) Call(ctx context.Context, cln *client.Client, val Value, opts Option, mode os.FileMode) (Value, error)

type Chown

type Chown struct{}

func (Chown) Call

func (c Chown) Call(ctx context.Context, cln *client.Client, val Value, opts Option, owner string) (Value, error)

type Cmd

type Cmd struct{}

func (Cmd) Call

func (c Cmd) Call(ctx context.Context, cln *client.Client, val Value, opts Option, cmd ...string) (Value, error)

type CodeGen

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

func New

func New(cln *client.Client, resolver Resolver) *CodeGen

func (*CodeGen) EmitBasicLit

func (cg *CodeGen) EmitBasicLit(ctx context.Context, scope *ast.Scope, lit *ast.BasicLit, ret Register) error

func (*CodeGen) EmitBinding

func (cg *CodeGen) EmitBinding(ctx context.Context, b *ast.Binding, args []Register, ret Register) error

func (*CodeGen) EmitBlock

func (cg *CodeGen) EmitBlock(ctx context.Context, scope *ast.Scope, block *ast.BlockStmt, b *ast.Binding, ret Register) error

func (*CodeGen) EmitBuiltinDecl

func (cg *CodeGen) EmitBuiltinDecl(ctx context.Context, scope *ast.Scope, bd *ast.BuiltinDecl, args []Register, opts Register, b *ast.Binding, val Value) (Value, error)

func (*CodeGen) EmitCallExpr

func (cg *CodeGen) EmitCallExpr(ctx context.Context, scope *ast.Scope, call *ast.CallExpr, ret Register) error

func (*CodeGen) EmitCallStmt

func (cg *CodeGen) EmitCallStmt(ctx context.Context, scope *ast.Scope, call *ast.CallStmt, b *ast.Binding, ret Register) error

func (*CodeGen) EmitExpr

func (cg *CodeGen) EmitExpr(ctx context.Context, scope *ast.Scope, expr *ast.Expr, opts Option, b *ast.Binding, ret Register) error

func (*CodeGen) EmitFuncDecl

func (cg *CodeGen) EmitFuncDecl(ctx context.Context, fd *ast.FuncDecl, args []Register, b *ast.Binding, ret Register) error

func (*CodeGen) EmitFuncLit

func (cg *CodeGen) EmitFuncLit(ctx context.Context, scope *ast.Scope, lit *ast.FuncLit, b *ast.Binding, ret Register) error

func (*CodeGen) EmitHeredoc

func (cg *CodeGen) EmitHeredoc(ctx context.Context, scope *ast.Scope, heredoc *ast.Heredoc, ret Register) error

func (*CodeGen) EmitIdentExpr

func (cg *CodeGen) EmitIdentExpr(ctx context.Context, scope *ast.Scope, ie *ast.IdentExpr, lookup *ast.Ident, args []Register, opts Register, b *ast.Binding, ret Register) error

func (*CodeGen) EmitImport

func (cg *CodeGen) EmitImport(ctx context.Context, mod *ast.Module, id *ast.ImportDecl) (*ast.Module, error)

func (*CodeGen) EmitRawHeredoc

func (cg *CodeGen) EmitRawHeredoc(ctx context.Context, scope *ast.Scope, heredoc *ast.RawHeredoc, ret Register) error

func (*CodeGen) EmitStringLit

func (cg *CodeGen) EmitStringLit(ctx context.Context, scope *ast.Scope, str *ast.StringLit, ret Register) error

func (*CodeGen) Evaluate

func (cg *CodeGen) Evaluate(ctx context.Context, scope *ast.Scope, call ast.CallNode, b *ast.Binding) []Register

func (*CodeGen) Generate

func (cg *CodeGen) Generate(ctx context.Context, mod *ast.Module, targets []Target) (result solver.Request, err error)

type ContentsOnly

type ContentsOnly struct{}

func (ContentsOnly) Call

func (co ContentsOnly) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Copy

type Copy struct{}

func (Copy) Call

func (m Copy) Call(ctx context.Context, cln *client.Client, val Value, opts Option, input Filesystem, src, dest string) (Value, error)

type CopyAllowWildcard

type CopyAllowWildcard struct{}

func (CopyAllowWildcard) Call

func (caw CopyAllowWildcard) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type CreateDestPath

type CreateDestPath struct{}

func (CreateDestPath) Call

func (cdp CreateDestPath) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type CreateParents

type CreateParents struct{}

func (CreateParents) Call

func (cp CreateParents) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type CreatedTime

type CreatedTime struct{}

func (CreatedTime) Call

func (ct CreatedTime) Call(ctx context.Context, cln *client.Client, val Value, opts Option, t time.Time) (Value, error)

type DebugMode

type DebugMode int

DebugMode is a mode of the debugger that affects control flow.

type Debugger

type Debugger interface {
	io.Closer

	// GetState returns the current debugger state.
	// This call blocks until the debugger has stopped for any reason.
	GetState() (*State, error)

	// Restart moves the program back to the start.
	Restart() (*State, error)

	// Continue resumes execution.
	Continue(Direction) (*State, error)

	// Next continues to the next source line, not entering function calls.
	Next(Direction) (*State, error)

	// Step continues to the next source line, entering function calls.
	Step(Direction) (*State, error)

	// StepOut continues to the next source line outside the current function.
	StepOut(Direction) (*State, error)

	// Backtrace returns all the frames in the current call stack.
	Backtrace() ([]Frame, error)

	// Breakpoints gets all breakpoints.
	Breakpoints() ([]*Breakpoint, error)

	// CreateBreakpoint creates a new breakpoint.
	CreateBreakpoint(bp *Breakpoint) (*Breakpoint, error)

	// ClearBreakpoint deletes a breakpoint.
	ClearBreakpoint(bp *Breakpoint) error

	// Terminate sends a signal to end the debugging session.
	Terminate() error

	// Exec starts a process in the current debugging state.
	Exec(ctx context.Context, stdin io.ReadCloser, stdout, stderr io.Writer, args ...string) error
}

Debugger is a source-level debugger that provides controls over the program flow and introspection of state.

func GetDebugger

func GetDebugger(ctx context.Context) Debugger

func NewDebugger

func NewDebugger(cln *client.Client, opts ...DebuggerOption) Debugger

NewDebugger returns a headless debugger.

type DebuggerFactory

type DebuggerFactory func() Debugger

DebuggerFactory is a callback that returns a debugger.

type DebuggerOption

type DebuggerOption func(*debugger)

DebuggerOption is optional configuration for the debugger.

func WithInitialMode

func WithInitialMode(mode DebugMode) DebuggerOption

WithInitialMode overrides the initial debug mode that the debugger starts with.

type Diff

type Diff struct{}

func (Diff) Call

func (d Diff) Call(ctx context.Context, cln *client.Client, val Value, opts Option, input Filesystem) (Value, error)

type Dir

type Dir struct{}

func (Dir) Call

func (d Dir) Call(ctx context.Context, cln *client.Client, val Value, opts Option, wd string) (Value, error)

type Direction

type Direction int8

Direction is the direction of execution.

const (
	// NoneDirection is not a valid direction.
	NoneDirection Direction = iota

	// ForwardDirection executes the target normally.
	ForwardDirection

	// BackwardDirection executes the target in reverse.
	BackwardDirection
)

type DockerAPIClient

type DockerAPIClient struct {
	dockerclient.APIClient
	Auth imagetools.Auth
	Moby bool
	Err  error
}

func DockerAPI

func DockerAPI(ctx context.Context) DockerAPIClient

type DockerLoad

type DockerLoad struct{}

func (DockerLoad) Call

func (dl DockerLoad) Call(ctx context.Context, cln *client.Client, val Value, opts Option, ref string) (Value, error)

type DockerPush

type DockerPush struct{}

func (DockerPush) Call

func (dp DockerPush) Call(ctx context.Context, cln *client.Client, val Value, opts Option, ref string) (Value, error)

type Download

type Download struct{}

func (Download) Call

func (d Download) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPath string) (Value, error)

type DownloadDockerTarball

type DownloadDockerTarball struct{}

func (DownloadDockerTarball) Call

func (dot DownloadDockerTarball) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPath, ref string) (Value, error)

type DownloadOCITarball

type DownloadOCITarball struct{}

func (DownloadOCITarball) Call

func (dot DownloadOCITarball) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPath string) (Value, error)

type DownloadTarball

type DownloadTarball struct{}

func (DownloadTarball) Call

func (dt DownloadTarball) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPath string) (Value, error)

type Entrypoint

type Entrypoint struct{}

func (Entrypoint) Call

func (e Entrypoint) Call(ctx context.Context, cln *client.Client, val Value, opts Option, entrypoint ...string) (Value, error)

type Env

type Env struct{}

func (Env) Call

func (e Env) Call(ctx context.Context, cln *client.Client, val Value, opts Option, key, value string) (Value, error)

type ExcludePatterns

type ExcludePatterns struct{}

func (ExcludePatterns) Call

func (ep ExcludePatterns) Call(ctx context.Context, cln *client.Client, val Value, opts Option, patterns ...string) (Value, error)

type Expose

type Expose struct{}

func (Expose) Call

func (e Expose) Call(ctx context.Context, cln *client.Client, val Value, opts Option, ports ...string) (Value, error)

type Filename

type Filename struct{}

func (Filename) Call

func (f Filename) Call(ctx context.Context, cln *client.Client, val Value, opts Option, filename string) (Value, error)

type Filesystem

type Filesystem struct {
	State       llb.State
	Image       *solver.ImageSpec
	SolveOpts   []solver.SolveOption
	SessionOpts []llbutil.SessionOption
	Platform    specs.Platform
}

func (Filesystem) Digest

func (fs Filesystem) Digest(ctx context.Context) (digest.Digest, error)

func (Filesystem) Tree

func (fs Filesystem) Tree() (treeprint.Tree, error)
type FollowSymlinks struct{}

func (FollowSymlinks) Call

func (fs FollowSymlinks) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Format

type Format struct{}

func (Format) Call

func (f Format) Call(ctx context.Context, cln *client.Client, val Value, opts Option, formatStr string, values ...string) (Value, error)

type Forward

type Forward struct{}

func (Forward) Call

func (f Forward) Call(ctx context.Context, cln *client.Client, val Value, opts Option, src *url.URL, dest string) (Value, error)

type Frame

type Frame struct {
	ast.Node
	Name string
}

func Backtrace

func Backtrace(ctx context.Context) []Frame

func NewFrame

func NewFrame(scope *ast.Scope, node ast.Node) Frame

type Frontend

type Frontend struct{}

func (Frontend) Call

func (f Frontend) Call(ctx context.Context, cln *client.Client, val Value, opts Option, source string) (Value, error)

type FrontendInput

type FrontendInput struct{}

func (FrontendInput) Call

func (fi FrontendInput) Call(ctx context.Context, cln *client.Client, val Value, opts Option, key string, input Filesystem) (Value, error)

type FrontendOpt

type FrontendOpt struct{}

func (FrontendOpt) Call

func (fo FrontendOpt) Call(ctx context.Context, cln *client.Client, val Value, opts Option, key, value string) (Value, error)

type GID

type GID struct{}

func (GID) Call

func (g GID) Call(ctx context.Context, cln *client.Client, val Value, opts Option, gid int) (Value, error)

type Git

type Git struct{}

func (Git) Call

func (g Git) Call(ctx context.Context, cln *client.Client, val Value, opts Option, remote, ref string) (Value, error)

type HTTP

type HTTP struct{}

func (HTTP) Call

func (h HTTP) Call(ctx context.Context, cln *client.Client, val Value, opts Option, url string) (Value, error)

type Host

type Host struct{}

func (Host) Call

func (s Host) Call(ctx context.Context, cln *client.Client, val Value, opts Option, host string, address net.IP) (Value, error)

type IgnoreCache

type IgnoreCache struct{}

func (IgnoreCache) Call

func (ig IgnoreCache) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type IgnoreError

type IgnoreError struct{}

func (IgnoreError) Call

func (ie IgnoreError) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Image

type Image struct{}

func (Image) Call

func (i Image) Call(ctx context.Context, cln *client.Client, val Value, opts Option, ref string) (Value, error)

type IncludePatterns

type IncludePatterns struct{}

func (IncludePatterns) Call

func (ip IncludePatterns) Call(ctx context.Context, cln *client.Client, val Value, opts Option, patterns ...string) (Value, error)

type IncludeStderr

type IncludeStderr struct{}

func (IncludeStderr) Call

func (is IncludeStderr) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type KeepGitDir

type KeepGitDir struct{}

func (KeepGitDir) Call

func (kgd KeepGitDir) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Label

type Label struct{}

func (Label) Call

func (l Label) Call(ctx context.Context, cln *client.Client, val Value, opts Option, key, value string) (Value, error)

type Local

type Local struct{}

func (Local) Call

func (l Local) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPath string) (Value, error)

type LocalArch

type LocalArch struct{}

func (LocalArch) Call

func (la LocalArch) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type LocalCwd

type LocalCwd struct{}

func (LocalCwd) Call

func (lc LocalCwd) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type LocalEnv

type LocalEnv struct{}

func (LocalEnv) Call

func (le LocalEnv) Call(ctx context.Context, cln *client.Client, val Value, opts Option, key string) (Value, error)

type LocalOS

type LocalOS struct{}

func (LocalOS) Call

func (lo LocalOS) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type LocalPaths

type LocalPaths struct{}

func (LocalPaths) Call

func (lp LocalPaths) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPaths ...string) (Value, error)

type LocalRun

type LocalRun struct{}

func (LocalRun) Call

func (lr LocalRun) Call(ctx context.Context, cln *client.Client, val Value, opts Option, args ...string) (Value, error)

type LocalRunOption

type LocalRunOption struct {
	IgnoreError   bool
	OnlyStderr    bool
	IncludeStderr bool
}

type Manifest

type Manifest struct{}

func (Manifest) Call

func (m Manifest) Call(ctx context.Context, cln *client.Client, val Value, opts Option, ref string) (Value, error)

type Merge

type Merge struct{}

func (Merge) Call

func (m Merge) Call(ctx context.Context, cln *client.Client, val Value, opts Option, inputs ...Filesystem) (Value, error)

type Mkdir

type Mkdir struct{}

func (Mkdir) Call

func (m Mkdir) Call(ctx context.Context, cln *client.Client, val Value, opts Option, path string, mode os.FileMode) (Value, error)

type Mkfile

type Mkfile struct{}

func (Mkfile) Call

func (m Mkfile) Call(ctx context.Context, cln *client.Client, val Value, opts Option, path string, mode os.FileMode, content string) (Value, error)

type Mount

type Mount struct {
	Bind  string
	Image *solver.ImageSpec
}

func (Mount) Call

func (m Mount) Call(ctx context.Context, cln *client.Client, val Value, opts Option, input Filesystem, mountpoint string) (Value, error)

type MountTarget

type MountTarget struct{}

func (MountTarget) Call

func (mt MountTarget) Call(ctx context.Context, cln *client.Client, val Value, opts Option, target string) (Value, error)

type Network

type Network struct{}

func (Network) Call

func (n Network) Call(ctx context.Context, cln *client.Client, val Value, opts Option, mode string) (Value, error)

type OnlyStderr

type OnlyStderr struct{}

func (OnlyStderr) Call

func (os OnlyStderr) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Option

type Option []interface{}

type Platform

type Platform struct{}

func (Platform) Call

func (p Platform) Call(ctx context.Context, cln *client.Client, val Value, opts Option, os, arch string) (Value, error)

type Prototype

type Prototype struct{}

func (Prototype) Call

func (p Prototype) Call(ctx context.Context, cln *client.Client, v Value, opts Option) (Value, error)

type Readonly

type Readonly struct{}

func (Readonly) Call

func (r Readonly) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type ReadonlyRootfs

type ReadonlyRootfs struct{}

func (ReadonlyRootfs) Call

func (rr ReadonlyRootfs) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Register

type Register interface {
	Value() Value
	Set(interface{}) error
	SetAsync(func(Value) (Value, error))
}

func NewRegister

func NewRegister(ctx context.Context) Register

type Resolve

type Resolve struct{}

func (Resolve) Call

func (ir Resolve) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Resolver

type Resolver interface {
	// Resolve returns a reader for the HLB module and its compiled LLB.
	Resolve(ctx context.Context, id *ast.ImportDecl, fs Filesystem) (ast.Directory, error)
}

Resolver resolves imports into a reader ready for parsing and checking.

type Rm

type Rm struct{}

func (Rm) Call

func (m Rm) Call(ctx context.Context, cln *client.Client, val Value, opts Option, path string) (Value, error)

type Run

type Run struct{}

func (Run) Call

func (r Run) Call(ctx context.Context, cln *client.Client, val Value, opts Option, args ...string) (Value, error)

type RunDir

type RunDir struct{}

func (RunDir) Call

func (rd RunDir) Call(ctx context.Context, cln *client.Client, val Value, opts Option, path string) (Value, error)

type RunEnv

type RunEnv struct{}

func (RunEnv) Call

func (re RunEnv) Call(ctx context.Context, cln *client.Client, val Value, opts Option, key, value string) (Value, error)

type RunUser

type RunUser struct{}

func (RunUser) Call

func (ru RunUser) Call(ctx context.Context, cln *client.Client, val Value, opts Option, name string) (Value, error)

type SSH

type SSH struct{}

func (SSH) Call

func (s SSH) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Scratch

type Scratch struct{}

func (Scratch) Call

func (s Scratch) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type Secret

type Secret struct{}

func (Secret) Call

func (s Secret) Call(ctx context.Context, cln *client.Client, val Value, opts Option, localPath, mountpoint string) (Value, error)

type Security

type Security struct{}

func (Security) Call

func (s Security) Call(ctx context.Context, cln *client.Client, val Value, opts Option, mode string) (Value, error)

type SetBreakpoint

type SetBreakpoint struct{}

func (SetBreakpoint) Call

func (sb SetBreakpoint) Call(ctx context.Context, cln *client.Client, val Value, opts Option, args ...string) (Value, error)

type Shlex

type Shlex struct{}

func (Shlex) Call

func (s Shlex) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type SourcePath

type SourcePath struct{}

func (SourcePath) Call

func (sp SourcePath) Call(ctx context.Context, cln *client.Client, val Value, opts Option, path string) (Value, error)

type Stage

type Stage struct{}

func (Stage) Call

func (s Stage) Call(ctx context.Context, cln *client.Client, val Value, opts Option, requests ...solver.Request) (Value, error)

type Stargz

type Stargz struct{}

func (Stargz) Call

func (s Stargz) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type State

type State struct {
	Ctx        context.Context
	Scope      *ast.Scope
	Node       ast.Node
	Value      Value
	Options    Option
	StopReason string
	Err        error
}

State is a snapshot of the application state when the debugger has halted for any reason.

type StopSignal

type StopSignal struct{}

func (StopSignal) Call

func (ss StopSignal) Call(ctx context.Context, cln *client.Client, val Value, opts Option, signal string) (Value, error)

type StringField

type StringField struct{}

func (StringField) Call

func (sf StringField) Call(ctx context.Context, cln *client.Client, val Value, opts Option, name, value string) (Value, error)

type Target

type Target struct {
	Name string
}

type Template

type Template struct{}

func (Template) Call

func (t Template) Call(ctx context.Context, cln *client.Client, val Value, opts Option, text string) (Value, error)

type TemplateField

type TemplateField struct {
	Name  string
	Value interface{}
}

type Tmpfs

type Tmpfs struct{}

func (Tmpfs) Call

func (t Tmpfs) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type UID

type UID struct{}

func (UID) Call

func (u UID) Call(ctx context.Context, cln *client.Client, val Value, opts Option, uid int) (Value, error)

type Unpack

type Unpack struct{}

func (Unpack) Call

func (u Unpack) Call(ctx context.Context, cln *client.Client, val Value, opts Option) (Value, error)

type User

type User struct{}

func (User) Call

func (u User) Call(ctx context.Context, cln *client.Client, val Value, opts Option, name string) (Value, error)

type UtilChmod

type UtilChmod struct{}

func (UtilChmod) Call

func (uc UtilChmod) Call(ctx context.Context, cln *client.Client, val Value, opts Option, mode os.FileMode) (Value, error)

type UtilChown

type UtilChown struct{}

func (UtilChown) Call

func (uc UtilChown) Call(ctx context.Context, cln *client.Client, val Value, opts Option, owner string) (Value, error)

type UtilCreatedTime

type UtilCreatedTime struct{}

func (UtilCreatedTime) Call

func (uct UtilCreatedTime) Call(ctx context.Context, cln *client.Client, val Value, opts Option, t time.Time) (Value, error)

type Value

type Value interface {
	Kind() ast.Kind
	Filesystem() (Filesystem, error)
	String() (string, error)
	Int() (int, error)
	Option() (Option, error)
	Request() (solver.Request, error)
	Reflect(reflect.Type) (reflect.Value, error)
}

func NewValue

func NewValue(ctx context.Context, iface interface{}) (Value, error)

func ZeroValue

func ZeroValue(ctx context.Context) Value

type Volumes

type Volumes struct{}

func (Volumes) Call

func (Volumes) Call(ctx context.Context, cln *client.Client, val Value, opts Option, mountpoints ...string) (Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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