build

package
v0.0.0-...-778180f Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package build defines methods for building a v1.Image reference from a Go binary reference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caching

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

Caching wraps a builder implementation in a layer that shares build results for the same inputs using a simple "future" implementation. Cached results may be invalidated by calling Invalidate with the same input passed to Build.

func NewCaching

func NewCaching(inner Interface) (*Caching, error)

NewCaching wraps the provided build.Interface in an implementation that shares build results for a given path until the result has been invalidated.

func (*Caching) Build

func (c *Caching) Build(base, dir string) (v1.Image, error)

Build implements Interface

func (*Caching) Invalidate

func (c *Caching) Invalidate(base, dir string)

Invalidate removes a path's cached results.

func (*Caching) IsSupportedReference

func (c *Caching) IsSupportedReference(base, dir string) *string

IsSupportedReference implements Interface

type GetBase

type GetBase func(string, string) (v1.Image, error)

GetBase takes an filepath and returns a base v1.Image.

type Interface

type Interface interface {
	// IsSupportedReference determines whether the given reference is to an filepath reference
	// that Kone supports building. Return the nodejs package name if supported.
	IsSupportedReference(base, s string) *string

	// Build turns the given filepath reference into a v1.Image containing the nodejs app.
	Build(base, s string) (v1.Image, error)
}

Interface abstracts different methods for turning a supported filepath reference into a v1.Image.

func NewGo

func NewGo(options ...Option) (Interface, error)

NewGo returns a build.Interface implementation that:

  1. builds go binaries named by importpath,
  2. containerizes the binary on a suitable base,

type Option

type Option func(*gobuildOpener) error

Option is a functional option for NewGo.

func WithBaseImages

func WithBaseImages(gb GetBase) Option

WithBaseImages is a functional option for overriding the base images that are used for different images.

func WithCreationTime

func WithCreationTime(t v1.Time) Option

WithCreationTime is a functional option for overriding the creation time given to images.

type Package

type Package struct {
	Name string `json:"name"`
}

type Recorder

type Recorder struct {
	Paths   []string
	Builder Interface
	// contains filtered or unexported fields
}

Recorder composes with another Interface to record the built nodejs apps.

func (*Recorder) Build

func (r *Recorder) Build(base, dir string) (v1.Image, error)

Build implements Interface

func (*Recorder) IsSupportedReference

func (r *Recorder) IsSupportedReference(base, dir string) *string

IsSupportedReference implements Interface

Jump to

Keyboard shortcuts

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