Documentation ¶
Index ¶
- Constants
- func Init(name string, pool bass.RuntimePool, config *bass.Scope) (bass.Runtime, error)
- func NewBass(pool bass.RuntimePool) bass.Runtime
- func NewBuildkit(_ bass.RuntimePool, cfg *bass.Scope) (bass.Runtime, error)
- func NewScope(parent *bass.Scope, state RunState) *bass.Scope
- func RegisterRuntime(name string, init InitFunc)
- func RunTest(ctx context.Context, t *testing.T, pool bass.RuntimePool, file string, ...) (bass.Value, error)
- func Suite(t *testing.T, pool bass.RuntimePool)
- type Assoc
- type Bass
- func (runtime *Bass) Export(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (runtime *Bass) ExportPath(ctx context.Context, w io.Writer, path bass.ThunkPath) error
- func (runtime *Bass) Load(ctx context.Context, thunk bass.Thunk) (*bass.Scope, error)
- func (runtime *Bass) Prune(ctx context.Context, opts bass.PruneOpts) error
- func (runtime *Bass) Resolve(ctx context.Context, ref bass.ThunkImageRef) (bass.ThunkImageRef, error)
- func (runtime *Bass) Run(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- type Buildkit
- func (runtime *Buildkit) Export(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (runtime *Buildkit) ExportPath(ctx context.Context, w io.Writer, tp bass.ThunkPath) error
- func (runtime *Buildkit) Load(ctx context.Context, thunk bass.Thunk) (*bass.Scope, error)
- func (runtime *Buildkit) Prune(ctx context.Context, opts bass.PruneOpts) error
- func (runtime *Buildkit) Resolve(ctx context.Context, imageRef bass.ThunkImageRef) (bass.ThunkImageRef, error)
- func (runtime *Buildkit) Run(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- type BuildkitConfig
- type Command
- type CommandMount
- type InitFunc
- type NoRuntimeError
- type Pool
- type RunState
- type StrThunk
- type UnknownRuntimeError
Constants ¶
const BuildkitName = "buildkit"
const Ext = ".bass"
Ext is the canonical file extension for Bass source code.
const NoExt = ""
Variables ¶
This section is empty.
Functions ¶
func NewBuildkit ¶
func RegisterRuntime ¶
Register installs a runtime under a given name.
It should be called in a runtime's init() function with the runtime's constructor.
Types ¶
type Bass ¶
type Bass struct { External bass.RuntimePool // contains filtered or unexported fields }
func (*Bass) ExportPath ¶
func (*Bass) Resolve ¶
func (runtime *Bass) Resolve(ctx context.Context, ref bass.ThunkImageRef) (bass.ThunkImageRef, error)
type Buildkit ¶
type Buildkit struct { Config BuildkitConfig Client *kitdclient.Client Platform ocispecs.Platform }
func (*Buildkit) ExportPath ¶
func (*Buildkit) Resolve ¶
func (runtime *Buildkit) Resolve(ctx context.Context, imageRef bass.ThunkImageRef) (bass.ThunkImageRef, error)
type BuildkitConfig ¶
type BuildkitConfig struct { BuildkitAddr string `json:"buildkit_addr,omitempty"` Data string `json:"data,omitempty"` DisableCache bool `json:"disable_cache,omitempty"` }
func (BuildkitConfig) Cleanup ¶
func (config BuildkitConfig) Cleanup(id string) error
func (BuildkitConfig) ResponseDir ¶
func (config BuildkitConfig) ResponseDir(id string) string
func (BuildkitConfig) ResponsePath ¶
func (config BuildkitConfig) ResponsePath(id string) string
type Command ¶
type Command struct { Args []string `json:"args"` Stdin []byte `json:"stdin"` Env []string `json:"env"` Dir *string `json:"dir"` Mounts []CommandMount `json:"-"` // doesn't need to be marshaled // contains filtered or unexported fields }
Command is a helper type constructed by a runtime by Resolving a Thunk.
It contains the direct values to be provided for the process running in the container.
func NewCommand ¶
Resolve traverses the Thunk, resolving logical path values to their concrete paths in the container, and collecting the requisite mount points along the way.
type CommandMount ¶
type CommandMount struct { Source bass.ThunkMountSource Target string }
CommandMount configures a thunk path to mount to the command's container.
type NoRuntimeError ¶
NoRuntimeError is returned when a platform has no runtime associated to it.
func (NoRuntimeError) Error ¶
func (err NoRuntimeError) Error() string
type Pool ¶
Pool is the full set of platform <-> runtime pairs configured by the user.
type StrThunk ¶
StrThunk contains a list of values to be resolved to strings and concatenated together to form a single string.
It is used to concatenate path thunks with literal strings.
type UnknownRuntimeError ¶
type UnknownRuntimeError struct {
Name string
}
UnknownRuntimeError is returned when an unknown runtime is configured.
func (UnknownRuntimeError) Error ¶
func (err UnknownRuntimeError) Error() string