storage

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage(log *slog.Logger, root string, cfg Config) (*Storage, error)

func (*Storage) CreateArtifact

func (s *Storage) CreateArtifact(
	artifactID artifact.ID,
	trashTime time.Time,
) (path string, commit, abort func() error, err error)

CreateArtifact Создаёт артефакт с указанным ID Артефакт создаётся во временной директории; path - абсолютный путь временной директории При вызове функции commit() он перемещается в storage При вызове функции abort() он удаляется

func (*Storage) DownloadArtifact

func (s *Storage) DownloadArtifact(
	ctx context.Context,
	endpoint string,
	artifactID artifact.ID,
	trashTime time.Time,
) error

DownloadArtifact Скачивает артефакт ID с указанного endpoint

func (*Storage) GetArtifact

func (s *Storage) GetArtifact(artifactID artifact.ID) (path string, unlock func(), err error)

GetArtifact Возвращает абсолютный путь артефакта Артефакт блокируется в режиме на чтение. Для разблокировки необходимо вызвать unlock()

func (*Storage) GetArtifactMeta

func (s *Storage) GetArtifactMeta(artifactID artifact.ID) (meta models.Meta, err error)

GetArtifactMeta Возвращает метаинформацию об артефакте

func (*Storage) RemoveArtifact

func (s *Storage) RemoveArtifact(artifactID artifact.ID) (err error)

RemoveArtifact Удаляет артефакт

func (*Storage) Shutdown

func (s *Storage) Shutdown()

Jump to

Keyboard shortcuts

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