imagefacade

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunImageFacade

func RunImageFacade(configPath string, stop <-chan struct{})

RunImageFacade ...

func SetupHTTPServer

func SetupHTTPServer(responder HTTPResponder)

SetupHTTPServer ...

Types

type Config

type Config struct {
	LogLevel    string
	ImageFacade *ImageFacadeConfig
}

Config return the Image Facade configurations

func GetConfig

func GetConfig(configPath string) (*Config, error)

GetConfig returns a configuration object

func (*Config) GetLogLevel

func (config *Config) GetLogLevel() (log.Level, error)

GetLogLevel returns the log level

type DiskMetrics

type DiskMetrics struct {
	FreeBytes      uint64
	AvailableBytes uint64
	TotalBytes     uint64
	UsedBytes      uint64
}

DiskMetrics ...

type HTTPResponder

type HTTPResponder interface {
	PullImage(*common.Image) error
	GetImage(*common.Image) common.ImageStatus
	GetModel() map[string]interface{}
}

HTTPResponder ...

type ImageFacade

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

ImageFacade return the image facade configurations

func NewImageFacade

func NewImageFacade(dockerRegistries []*common.RegistryAuth, createImagesOnly bool, imagePullerType string, stop <-chan struct{}) *ImageFacade

NewImageFacade return the image puller that will used to pull the artifacts

func (*ImageFacade) GetImage

func (imf *ImageFacade) GetImage(image *common.Image) common.ImageStatus

GetImage is used to get to the image status

func (*ImageFacade) GetModel

func (imf *ImageFacade) GetModel() map[string]interface{}

GetModel returns the api model

func (*ImageFacade) PullImage

func (imf *ImageFacade) PullImage(image *common.Image) error

PullImage is used to pull the artifacts into local for scanning

type ImageFacadeConfig

type ImageFacadeConfig struct {
	// These allow images to be pulled from registries that require authentication
	PrivateDockerRegistries []*common.RegistryAuth
	ImagePullerType         string
	CreateImagesOnly        bool
	Port                    int
}

ImageFacadeConfig maps to the ImageFacade config of the input configmap

type Model

type Model struct {
	State  ModelState
	Images map[string]common.ImageStatus
	// contains filtered or unexported fields
}

Model ...

func NewModel

func NewModel(stop <-chan struct{}) *Model

NewModel ...

func (*Model) FinishImagePull

func (model *Model) FinishImagePull(image *common.Image, imagePullError error) error

FinishImagePull ...

func (*Model) GetAPIModel

func (model *Model) GetAPIModel() map[string]interface{}

GetAPIModel ...

func (*Model) GetImageStatus

func (model *Model) GetImageStatus(image *common.Image) common.ImageStatus

GetImageStatus ...

func (*Model) StartImagePull

func (model *Model) StartImagePull(image *common.Image) error

StartImagePull ...

type ModelState

type ModelState int

ModelState ...

const (
	ModelStateReady   ModelState = iota
	ModelStatePulling ModelState = iota
)

...

func (ModelState) String

func (m ModelState) String() string

Jump to

Keyboard shortcuts

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