artifacts

package
v0.0.0-...-99c2a2b Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BATCH_SIZE int = 10000
View Source
const MAX_BACKLOG int = 10000

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactDownloader

type ArtifactDownloader struct {
	// Resources
	Ctx             context.Context
	GraphqlClient   graphql.Client
	DownloadManager *filetransfer.FileTransferManager
	// Input
	ArtifactID             string
	DownloadRoot           string
	AllowMissingReferences *bool
}

func NewArtifactDownloader

func NewArtifactDownloader(
	ctx context.Context,
	graphQLClient graphql.Client,
	downloadManager *filetransfer.FileTransferManager,
	artifactID string,
	downloadRoot string,
	allowMissingReferences *bool,
) *ArtifactDownloader

func (*ArtifactDownloader) Download

func (ad *ArtifactDownloader) Download() (rerr error)

type ArtifactLinker

type ArtifactLinker struct {
	Ctx           context.Context
	Logger        *observability.NexusLogger
	LinkArtifact  *service.LinkArtifactRecord
	GraphqlClient graphql.Client
}
func (al *ArtifactLinker) Link() error

type ArtifactSaver

type ArtifactSaver struct {
	// Resources.
	Ctx                 context.Context
	GraphqlClient       graphql.Client
	FileTransferManager *filetransfer.FileTransferManager
	// Input.
	Artifact    *service.ArtifactRecord
	HistoryStep int64
	StagingDir  string
}

func NewArtifactSaver

func NewArtifactSaver(
	ctx context.Context,
	graphQLClient graphql.Client,
	uploadManager *filetransfer.FileTransferManager,
	artifact *service.ArtifactRecord,
	historyStep int64,
	stagingDir string,
) ArtifactSaver

func (*ArtifactSaver) Save

func (as *ArtifactSaver) Save() (artifactID string, rerr error)

type Manifest

type Manifest struct {
	Version             int32                    `json:"version"`
	StoragePolicy       string                   `json:"storagePolicy"`
	StoragePolicyConfig StoragePolicyConfig      `json:"storagePolicyConfig"`
	Contents            map[string]ManifestEntry `json:"contents"`
}

func NewManifestFromProto

func NewManifestFromProto(proto *service.ArtifactManifest) (Manifest, error)

func (*Manifest) GetManifestEntryFromArtifactFilePath

func (m *Manifest) GetManifestEntryFromArtifactFilePath(path string) (ManifestEntry, error)

func (*Manifest) WriteToFile

func (m *Manifest) WriteToFile() (filename string, digest string, rerr error)

type ManifestEntry

type ManifestEntry struct {
	Digest          string                 `json:"digest"`
	BirthArtifactID *string                `json:"birthArtifactID"`
	Ref             *string                `json:"ref,omitempty"`
	Size            int64                  `json:"size"`
	Extra           map[string]interface{} `json:"extra,omitempty"`
	LocalPath       *string                `json:"-"`
	DownloadURL     *string                `json:"-"`
}

type StoragePolicyConfig

type StoragePolicyConfig struct {
	StorageLayout string `json:"storageLayout"`
}

Jump to

Keyboard shortcuts

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