build

package
v0.0.0-...-4381ce5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorkerShim

func WorkerShim[T any](doer Doer[T], jobs <-chan T, done_jobs chan<- CompletedJob[T], cancel chan chan struct{})

Types

type Builder

type Builder interface {
	Build(job Job) error
	Tag(job Job) error
}

TODO: rethink this interface. need a way to send status updates and cancel a build. At face value, I am thinking a status channel and a context.

type BuilderMessage

type BuilderMessage struct {
	ID      string `json:"ID"`
	Payload []byte `json:"payload"`
}

type BuilderPusher

type BuilderPusher interface {
	Builder
	Push() error
}

type CompletedJob

type CompletedJob[T any] struct {
	Job T
	Err error
}

func (CompletedJob[T]) Ok

func (p CompletedJob[T]) Ok() bool

type DefaultBuilder

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

TODO: implement DefaultBuilder and DefaultBuilderPusher

func NewDefaultBuilder

func NewDefaultBuilder(stream chan<- BuilderMessage) DefaultBuilder

func (DefaultBuilder) Build

func (b DefaultBuilder) Build(job Job) error

func (DefaultBuilder) Cancel

func (DefaultBuilder) Cancel(job Job)

func (DefaultBuilder) Do

func (b DefaultBuilder) Do(job Job) error

func (DefaultBuilder) Tag

func (DefaultBuilder) Tag(job Job) error

TODO: implement

type DefaultJob

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

func (DefaultJob) Children

func (j DefaultJob) Children() []Job

func (DefaultJob) FullName

func (j DefaultJob) FullName() string

func (DefaultJob) Path

func (j DefaultJob) Path() string

func (DefaultJob) Tag

func (j DefaultJob) Tag() string

type DefaultJobFactory

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

func NewDefaultJobFactory

func NewDefaultJobFactory(image_map image_map.ImageMapPair, tagger Tagger, registry string) *DefaultJobFactory

func (*DefaultJobFactory) GetChildren

func (f *DefaultJobFactory) GetChildren(img image.ImagePair) []Job

func (DefaultJobFactory) GetFullName

func (d DefaultJobFactory) GetFullName(img image.ImagePair) string

GetFullName returns the registry concatenated to the image name (i.e. {{registry/name}} ). if a registry is not present, only the image name is returned.

func (*DefaultJobFactory) GetTag

func (d *DefaultJobFactory) GetTag(img image.ImagePair) string

func (*DefaultJobFactory) JobsFromPaths

func (f *DefaultJobFactory) JobsFromPaths(paths ...string) []Job

type DefaultTagger

type DefaultTagger struct{}

func (DefaultTagger) Tag

type Doer

type Doer[T any] interface {
	Do(T) error
	Cancel(T)
}

type Job

type Job interface {
	// path to dockerfile
	Path() string
	// registry/image
	FullName() string
	// image tag
	Tag() string
	// Jobs based off _this_ build job
	Children() []Job
}

type Manager

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

func NewManager

func NewManager() Manager

func (Manager) CancelBuilders

func (Manager) CancelBuilders(cancelers []chan chan struct{})

func (Manager) StartBuilders

func (m Manager) StartBuilders(builder Doer[Job], n_builders int) []chan chan struct{}

func (Manager) StartJobs

func (manager Manager) StartJobs(ctx context.Context, inputPaths ...Job)

type Tagger

type Tagger interface {
	Tag(image.ImagePair) string
}

Jump to

Keyboard shortcuts

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