artifacts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package artifacts is responsible for Weles system's job artifact management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewArtifactManager

func NewArtifactManager(db, dir string, notifierCap, workersCount, queueCap int,
) (weles.ArtifactManager, error)

NewArtifactManager returns initialized Storage implementing ArtifactManager interface. If db or dir is empy, default value will be used.

Types

type ArtifactDownloader

type ArtifactDownloader interface {
	// Download starts downloading requested artifact.
	Download(URI weles.ArtifactURI, path weles.ArtifactPath, ch chan weles.ArtifactStatusChange,
	) error

	// CheckInCache checks if file already exists in ArtifactDB.
	CheckInCache(URI weles.ArtifactURI) (weles.ArtifactInfo, error)

	// Close waits for all jobs to finish, and gracefully closes ArtifactDownloader.
	Close()
}

ArtifactDownloader downloads requested file if there is need to.

type Storage

type Storage struct {
	weles.ArtifactManager
	// contains filtered or unexported fields
}

Storage should be used by Weles' subsystems that need access to ArtifactDB or information about artifacts stored there. Storage implements ArtifactManager interface.

func (*Storage) Close

func (s *Storage) Close() error

Close closes Storage's ArtifactDB.

func (*Storage) CreateArtifact

func (s *Storage) CreateArtifact(artifact weles.ArtifactDescription) (weles.ArtifactPath, error)

CreateArtifact is part of implementation of ArtifactManager interface.

func (*Storage) GetArtifactInfo

func (s *Storage) GetArtifactInfo(path weles.ArtifactPath) (weles.ArtifactInfo, error)

GetArtifactInfo is part of implementation of ArtifactManager interface.

func (*Storage) ListArtifact

func (s *Storage) ListArtifact(filter weles.ArtifactFilter, sorter weles.ArtifactSorter,
	paginator weles.ArtifactPagination) ([]weles.ArtifactInfo, weles.ListInfo, error)

ListArtifact is part of implementation of ArtifactManager interface.

func (*Storage) PushArtifact

func (s *Storage) PushArtifact(artifact weles.ArtifactDescription,
	ch chan weles.ArtifactStatusChange) (weles.ArtifactPath, error)

PushArtifact is part of implementation of ArtifactManager interface.

Directories

Path Synopsis
Package database is responsible for Weles system's job artifact storage.
Package database is responsible for Weles system's job artifact storage.
Package downloader is responsible for Weles system's job artifact downloading.
Package downloader is responsible for Weles system's job artifact downloading.

Jump to

Keyboard shortcuts

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