image

package
v6.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package image contains logic for image selection logic.

Worker supports two ways of selecting the image to use for a compute instance: An APISelector that talks to job-board (https://github.com/travis-ci/job-board) and an ENVSelector that gets the data from environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APISelector

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

func NewAPISelector

func NewAPISelector(u *url.URL) *APISelector

func (*APISelector) Select

func (as *APISelector) Select(ctx gocontext.Context, params *Params) (string, error)

func (*APISelector) SetMaxElapsedTime

func (as *APISelector) SetMaxElapsedTime(maxElapsedTime time.Duration)

func (*APISelector) SetMaxInterval

func (as *APISelector) SetMaxInterval(maxInterval time.Duration)

type EnvSelector

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

EnvSelector implements Selector for environment-based mappings

func NewEnvSelector

func NewEnvSelector(c *config.ProviderConfig) (*EnvSelector, error)

NewEnvSelector builds a new EnvSelector from the given *config.ProviderConfig

func (*EnvSelector) Select

func (es *EnvSelector) Select(ctx gocontext.Context, params *Params) (string, error)

type Params

type Params struct {
	Infra    string
	Language string
	OsxImage string
	Dist     string
	Group    string
	OS       string

	JobID uint64
	Repo  string
}

type Selector

type Selector interface {
	Select(gocontext.Context, *Params) (string, error)
}

Selector is the interface for selecting an image!

Jump to

Keyboard shortcuts

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