artefacts

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

* Copyright (C) 2020-2025 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtefactManager

type ArtefactManager[
	M IManager,
	D ILinkData,
	L ILinks[D],
	C ICollection[D, L],
] struct {
	// contains filtered or unexported fields
}

func (*ArtefactManager[M, D, L, C]) DownloadAllJobArtefacts added in v1.8.0

func (m *ArtefactManager[M, D, L, C]) DownloadAllJobArtefacts(ctx context.Context, jobName string, outputDirectory string) error

func (*ArtefactManager[M, D, L, C]) DownloadAllJobArtefactsWithOptions added in v1.18.0

func (m *ArtefactManager[M, D, L, C]) DownloadAllJobArtefactsWithOptions(ctx context.Context, jobName string, outputDirectory string, opts ...DownloadOption) (err error)

func (*ArtefactManager[M, D, L, C]) DownloadAllJobArtefactsWithTree added in v1.10.0

func (m *ArtefactManager[M, D, L, C]) DownloadAllJobArtefactsWithTree(ctx context.Context, jobName string, maintainTreeStructure bool, outputDirectory string) (err error)

func (*ArtefactManager[M, D, L, C]) DownloadJobArtefact

func (m *ArtefactManager[M, D, L, C]) DownloadJobArtefact(ctx context.Context, jobName string, outputDirectory string, artefactManager M) (err error)
func (m *ArtefactManager[M, D, L, C]) DownloadJobArtefactFromLink(ctx context.Context, jobName string, outputDirectory string, artefactManagerItemLink D) error

func (*ArtefactManager[M, D, L, C]) DownloadJobArtefactFromLinkWithTree added in v1.10.0

func (m *ArtefactManager[M, D, L, C]) DownloadJobArtefactFromLinkWithTree(ctx context.Context, jobName string, maintainTreeLocation bool, outputDirectory string, artefactManagerItemLink D) (err error)

func (*ArtefactManager[M, D, L, C]) DownloadJobArtefactWithTree added in v1.10.0

func (m *ArtefactManager[M, D, L, C]) DownloadJobArtefactWithTree(ctx context.Context, jobName string, maintainTreeLocation bool, outputDirectory string, artefactManager M) (err error)

func (*ArtefactManager[M, D, L, C]) ListJobArtefacts added in v1.8.0

func (m *ArtefactManager[M, D, L, C]) ListJobArtefacts(ctx context.Context, jobName string) (pagination.IPaginatorAndPageFetcher, error)

type DownloadOption added in v1.18.0

type DownloadOption func(*DownloadOptions)

func WithLogger added in v1.18.0

func WithLogger(l logs.Loggers) DownloadOption

WithLogger specifies an optional logger that is used to log downloading artefacts or errors encountered while downloading.

func WithMaintainStructure added in v1.18.0

func WithMaintainStructure(maintain bool) DownloadOption

WithMaintainStructure specifies whether to keep the tree structure of the artefacts or not in the output directory.

func WithStopOnFirstError added in v1.18.0

func WithStopOnFirstError(stop bool) DownloadOption

WithStopOnFirstError specifies whether the Arteftact manager will stop downloading artefacts if it encounters an error from one of the artefacts.

type DownloadOptions added in v1.18.0

type DownloadOptions struct {
	StopOnFirstError      bool
	MaintainTreeStructure bool
	Logger                logs.Loggers
}

func NewDownloadOptions added in v1.18.0

func NewDownloadOptions(opts ...DownloadOption) (options *DownloadOptions)

type FollowLinkToArtefactManagersPageFunc added in v1.8.0

type FollowLinkToArtefactManagersPageFunc[D ILinkData, L ILinks[D], C ICollection[D, L]] = func(ctx context.Context, link D) (C, *http.Response, error)

FollowLinkToArtefactManagersPageFunc is a function able to follow a link to an artefact manager page.

type GetArtefactContentFunc added in v1.8.0

type GetArtefactContentFunc = func(ctx context.Context, job, artefactID string) (*os.File, *http.Response, error)

GetArtefactContentFunc is a function able to return the content of any artefact managers.

type GetArtefactManagerFunc added in v1.8.0

type GetArtefactManagerFunc[M IManager] = func(ctx context.Context, job, artefact string) (M, *http.Response, error)

GetArtefactManagerFunc is a function which retrieves information about an artefact manager.

type GetArtefactManagersFirstPageFunc added in v1.8.0

type GetArtefactManagersFirstPageFunc[D ILinkData, L ILinks[D], C ICollection[D, L]] = func(ctx context.Context, job string) (C, *http.Response, error)

GetArtefactManagersFirstPageFunc defines the function which can retrieve the first page of artefact managers.

type IArtefactManager

type IArtefactManager[
	M IManager,
	D ILinkData,
] interface {
	// DownloadJobArtefactFromLink downloads a specific artefact into the output directory from a particular link. The artefact will be placed at the root of the output directory.
	DownloadJobArtefactFromLink(ctx context.Context, jobName string, outputDirectory string, artefactManagerItemLink D) error
	// DownloadJobArtefactFromLinkWithTree downloads a specific artefact into the output directory from a particular link.
	// maintainTreeLocation specifies whether the artefact will be placed in a tree structure or if it will be flat.
	DownloadJobArtefactFromLinkWithTree(ctx context.Context, jobName string, maintainTreeLocation bool, outputDirectory string, artefactManagerItemLink D) error
	// DownloadJobArtefact downloads a specific artefact into the output directory. The artefact will be placed at the root of the output directory.
	DownloadJobArtefact(ctx context.Context, jobName string, outputDirectory string, artefactManager M) error
	// DownloadJobArtefactWithTree downloads a specific artefact into the output directory.
	// maintainTreeLocation specifies whether the artefact will be placed in a tree structure or if it will be flat.
	DownloadJobArtefactWithTree(ctx context.Context, jobName string, maintainTreeLocation bool, outputDirectory string, artefactManager M) error
	// ListJobArtefacts lists all artefact managers associated with a particular job.
	ListJobArtefacts(ctx context.Context, jobName string) (pagination.IPaginatorAndPageFetcher, error)
	// DownloadAllJobArtefacts downloads all the artefacts produced for a particular job and puts them in an output directory as a flat list.
	DownloadAllJobArtefacts(ctx context.Context, jobName string, outputDirectory string) error
	// DownloadAllJobArtefactsWithTree downloads all the artefacts produced for a particular job and puts them in an output directory.
	// maintainTreeStructure specifies whether to keep the tree structure of the artefacts or not in the output directory.
	DownloadAllJobArtefactsWithTree(ctx context.Context, jobName string, maintainTreeStructure bool, outputDirectory string) error
	// DownloadAllJobArtefactsWithOptions downloads all the artefacts produced for a particular job and puts them in an output directory, specify some download option.
	DownloadAllJobArtefactsWithOptions(ctx context.Context, jobName string, outputDirectory string, opts ...DownloadOption) (err error)
}

func NewArtefactManager

func NewArtefactManager[
	M IManager,
	D ILinkData,
	L ILinks[D],
	C ICollection[D, L],
](
	getArtefactManagersFirstPage GetArtefactManagersFirstPageFunc[D, L, C],
	getArtefactsManagersPage FollowLinkToArtefactManagersPageFunc[D, L, C],
	getArtefactManager GetArtefactManagerFunc[M],
	getOutputArtefact GetArtefactContentFunc) IArtefactManager[M, D]

NewArtefactManager returns an artefact manager.

type ICollection added in v1.14.0

type ICollection[D ILinkData, L ILinks[D]] interface {
	comparable
	pagination.IStaticPage
	GetLinksOk() (L, bool)
}

type ILinkData added in v1.14.0

type ILinkData interface {
	comparable
	GetName() string
	GetHref() string
}
type ILinks[D ILinkData] interface {
	comparable
	GetNextP() D
	HasNext() bool
}

type IManager added in v1.14.0

type IManager interface {
	comparable
	GetName() string
	GetTitle() string
	HasTitle() bool
	GetHashOk() (*string, bool)
	GetSizeOk() (*int64, bool)
	GetExtraMetadata() map[string]string
	HasExtraMetadata() bool
}

Jump to

Keyboard shortcuts

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