adapters

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsChecksumFile

func IsChecksumFile(path string) bool

IsChecksumFile returns true if path match any patterns supported by registered algorithms. The path must be absolute.

func IsMetaFile

func IsMetaFile(path string) bool

IsMetaFile returns true if path match any patterns supported by registered algorithms. The path must be absolute.

func ParseMetaFile

func ParseMetaFile(log ports.Logger, f ports.FS, metaFileName string) (map[string]string, error)

ParseMetaFile parses meta file via algos and returns key/values map or error

func RegisterChecksumAlgo

func RegisterChecksumAlgo(prio int, pattern string, algo ports.ChecksumAlgo)

func RegisterMetaAlgo

func RegisterMetaAlgo(prio int, pattern string, algo ports.MetaAlgo)

Types

type BasicArtifactStorageAdapter

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

func NewBasicArtifactStorageAdapter

func NewBasicArtifactStorageAdapter(log ports.Logger, f ports.FS) (*BasicArtifactStorageAdapter, error)

func (*BasicArtifactStorageAdapter) Close

func (s *BasicArtifactStorageAdapter) Close()

func (*BasicArtifactStorageAdapter) NewArtifact

func (s *BasicArtifactStorageAdapter) NewArtifact(src ports.FS, input string, artifacts []string, storage string, id models.ArtifactID) (*ports.NewArtifactInfo, error)

func (*BasicArtifactStorageAdapter) OpenFile

func (s *BasicArtifactStorageAdapter) OpenFile(storage string, artifactID models.ArtifactID, filename string) (ports.File, error)

func (*BasicArtifactStorageAdapter) RemoveArtifact

func (s *BasicArtifactStorageAdapter) RemoveArtifact(storage string, artifactID models.ArtifactID) error

type ChecksumAlgoInfo

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

type ChecksumStr

type ChecksumStr = string

func CheckChecksum

func CheckChecksum(log ports.Logger, f ports.FS, checksumFileName string) (ChecksumStr, ports.CheckedFiles, error)

CheckChecksum checks the checksumFileName and all files listed inside the checksumFileName. It returns the checksum of the checksumFileName, good files, broken files and error

type MetaAlgoInfo

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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