Documentation
¶
Overview ¶
Package artifacts is responsible for Weles system's job artifact management.
Index ¶
- func NewArtifactManager(db, dir string, notifierCap, workersCount, queueCap int) (weles.ArtifactManager, error)
- type ArtifactDownloader
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) CreateArtifact(artifact weles.ArtifactDescription) (weles.ArtifactPath, error)
- func (s *Storage) GetArtifactInfo(path weles.ArtifactPath) (weles.ArtifactInfo, error)
- func (s *Storage) ListArtifact(filter weles.ArtifactFilter, sorter weles.ArtifactSorter, ...) ([]weles.ArtifactInfo, weles.ListInfo, error)
- func (s *Storage) PushArtifact(artifact weles.ArtifactDescription, ch chan weles.ArtifactStatusChange) (weles.ArtifactPath, error)
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) 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. |