Documentation ¶
Index ¶
- Constants
- func IsAzureBlobPath(loc string) bool
- func NewAzureBlobClient(l logger.Logger, storageAccountName string) (*service.Client, error)
- func NewS3Client(l logger.Logger, bucket string) (*s3.S3, error)
- func ParseArtifactoryDestination(destination string) (repo string, path string)
- func ParseGSDestination(destination string) (name string, path string)
- func ParseS3Destination(destination string) (string, string)
- type APIClient
- type ArtifactoryDownloader
- type ArtifactoryDownloaderConfig
- type ArtifactoryUploader
- type ArtifactoryUploaderConfig
- type AzureBlobDownloader
- type AzureBlobDownloaderConfig
- type AzureBlobLocation
- type AzureBlobUploader
- type AzureBlobUploaderConfig
- type BKUploader
- type BKUploaderConfig
- type BatchCreator
- type BatchCreatorConfig
- type Download
- type DownloadConfig
- type Downloader
- type DownloaderConfig
- type Error
- type GSDownloader
- type GSDownloaderConfig
- type GSUploader
- type GSUploaderConfig
- type S3Downloader
- type S3DownloaderConfig
- type S3Uploader
- type S3UploaderConfig
- type Searcher
- type Uploader
- type UploaderConfig
Constants ¶
const ( ArtifactPathDelimiter = ";" ArtifactFallbackMimeType = "binary/octet-stream" )
Variables ¶
This section is empty.
Functions ¶
func IsAzureBlobPath ¶
IsAzureBlobPath reports if the location is an Azure Blob Storage path.
func NewAzureBlobClient ¶
NewAzureBlobClient creates a new Azure Blob Storage client.
func NewS3Client ¶ added in v3.82.0
func ParseArtifactoryDestination ¶ added in v3.82.0
func ParseGSDestination ¶ added in v3.82.0
func ParseS3Destination ¶ added in v3.82.0
Types ¶
type APIClient ¶ added in v3.82.0
type APIClient interface { CreateArtifacts(context.Context, string, *api.ArtifactBatch) (*api.ArtifactBatchCreateResponse, *api.Response, error) SearchArtifacts(context.Context, string, *api.ArtifactSearchOptions) ([]*api.Artifact, *api.Response, error) UpdateArtifacts(context.Context, string, []api.ArtifactState) (*api.Response, error) }
APIClient describes the Agent REST API methods used by the artifact package.
type ArtifactoryDownloader ¶ added in v3.82.0
type ArtifactoryDownloader struct {
// contains filtered or unexported fields
}
func NewArtifactoryDownloader ¶ added in v3.82.0
func NewArtifactoryDownloader(l logger.Logger, c ArtifactoryDownloaderConfig) *ArtifactoryDownloader
func (ArtifactoryDownloader) RepositoryFileLocation ¶ added in v3.82.0
func (d ArtifactoryDownloader) RepositoryFileLocation() string
func (ArtifactoryDownloader) RepositoryName ¶ added in v3.82.0
func (d ArtifactoryDownloader) RepositoryName() string
func (ArtifactoryDownloader) RepositoryPath ¶ added in v3.82.0
func (d ArtifactoryDownloader) RepositoryPath() string
type ArtifactoryDownloaderConfig ¶ added in v3.82.0
type ArtifactoryDownloaderConfig struct { // The Artifactory repository name and the path, for example, rt://my-repo-name/foo/bar Repository string // The root directory of the download Destination string // The relative path that should be preserved in the download folder, // also its location in the repo Path string // How many times should it retry the download before giving up Retries int // If failed responses should be dumped to the log DebugHTTP bool TraceHTTP bool DisableHTTP2 bool }
type ArtifactoryUploader ¶ added in v3.82.0
type ArtifactoryUploader struct { // The artifactory bucket path set from the destination Path string // The artifactory bucket name set from the destination Repository string // contains filtered or unexported fields }
func NewArtifactoryUploader ¶ added in v3.82.0
func NewArtifactoryUploader(l logger.Logger, c ArtifactoryUploaderConfig) (*ArtifactoryUploader, error)
func (*ArtifactoryUploader) CreateWork ¶ added in v3.83.0
func (u *ArtifactoryUploader) CreateWork(artifact *api.Artifact) ([]workUnit, error)
type ArtifactoryUploaderConfig ¶ added in v3.82.0
type AzureBlobDownloader ¶
type AzureBlobDownloader struct {
// contains filtered or unexported fields
}
AzureBlobDownloader downloads files from Azure Blob storage.
func NewAzureBlobDownloader ¶
func NewAzureBlobDownloader(l logger.Logger, c AzureBlobDownloaderConfig) *AzureBlobDownloader
NewAzureBlobDownloader creates a new AzureBlobDownloader.
type AzureBlobDownloaderConfig ¶
type AzureBlobDownloaderConfig struct { Path string Repository string Destination string Retries int DebugHTTP bool TraceHTTP bool }
AzureBlobUploaderConfig configures AzureBlobDownloader.
type AzureBlobLocation ¶
AzureBlobLocation specifies the location of a blob in Azure Blob Storage.
func ParseAzureBlobLocation ¶
func ParseAzureBlobLocation(loc string) (*AzureBlobLocation, error)
ParseAzureBlobLocation parses a URL into an Azure Blob Storage location.
func (*AzureBlobLocation) String ¶
func (l *AzureBlobLocation) String() string
String returns the location as a URL string.
func (*AzureBlobLocation) URL ¶
func (l *AzureBlobLocation) URL(blob string) string
URL returns an Azure Blob Storage URL for the blob.
type AzureBlobUploader ¶
type AzureBlobUploader struct {
// contains filtered or unexported fields
}
AzureBlobUploader uploads artifacts to Azure Blob Storage.
func NewAzureBlobUploader ¶
func NewAzureBlobUploader(l logger.Logger, c AzureBlobUploaderConfig) (*AzureBlobUploader, error)
NewAzureBlobUploader creates a new AzureBlobUploader.
func (*AzureBlobUploader) CreateWork ¶ added in v3.83.0
func (u *AzureBlobUploader) CreateWork(artifact *api.Artifact) ([]workUnit, error)
type AzureBlobUploaderConfig ¶
type AzureBlobUploaderConfig struct { // The destination which includes the storage account name and the path. // For example, "https://my-storage-account.blob.core.windows.net/my-container/my-virtual-directory/artifacts-go-here/" Destination string }
AzureBlobUploaderConfig configures AzureBlobUploader.
type BKUploader ¶ added in v3.83.0
type BKUploader struct {
// contains filtered or unexported fields
}
BKUploader uploads artifacts to Buildkite itself.
func NewBKUploader ¶ added in v3.83.0
func NewBKUploader(l logger.Logger, c BKUploaderConfig) *BKUploader
NewBKUploader creates a new Buildkite uploader.
func (*BKUploader) CreateWork ¶ added in v3.83.0
func (u *BKUploader) CreateWork(artifact *api.Artifact) ([]workUnit, error)
CreateWork checks the artifact size, then creates one worker.
type BKUploaderConfig ¶ added in v3.83.0
type BatchCreator ¶ added in v3.82.0
type BatchCreator struct {
// contains filtered or unexported fields
}
func NewArtifactBatchCreator ¶ added in v3.82.0
func NewArtifactBatchCreator(l logger.Logger, ac APIClient, c BatchCreatorConfig) *BatchCreator
type BatchCreatorConfig ¶ added in v3.82.0
type BatchCreatorConfig struct { // The ID of the Job that these artifacts belong to JobID string // All the artifacts that need to be created Artifacts []*api.Artifact // Where the artifacts are being uploaded to on the command line UploadDestination string // CreateArtifactsTimeout, sets a context.WithTimeout around the CreateArtifacts API. // If it's zero, there's no context timeout and the default HTTP timeout will prevail. CreateArtifactsTimeout time.Duration // Whether to allow multipart uploads to the BK-hosted bucket. AllowMultipart bool }
type Download ¶ added in v3.82.0
type Download struct {
// contains filtered or unexported fields
}
func NewDownload ¶ added in v3.82.0
type DownloadConfig ¶ added in v3.82.0
type DownloadConfig struct { // The actual URL to get the file from URL string // The root directory of the download Destination string // Optional Headers to append to the request Headers map[string]string // The relative path that should be preserved in the download folder Path string // How many times should it retry the download before giving up Retries int // Hexadecimal(SHA256(content)) used to verify the downloaded contents, if not empty WantSHA256 string // If failed responses should be dumped to the log // Standard HTTP options. DebugHTTP bool TraceHTTP bool }
type Downloader ¶ added in v3.82.0
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶ added in v3.82.0
func NewDownloader(l logger.Logger, ac APIClient, c DownloaderConfig) Downloader
type DownloaderConfig ¶ added in v3.82.0
type DownloaderConfig struct { // The ID of the Build BuildID string // The query used to find the artifacts Query string // Which step should we look at for the jobs Step string // Whether to include artifacts from retried jobs in the search IncludeRetriedJobs bool // Where we'll be downloading artifacts to Destination string // Standard HTTP options DebugHTTP bool TraceHTTP bool DisableHTTP2 bool }
type Error ¶ added in v3.82.0
type Error struct { Status int `json:"status"` // Error code Message string `json:"message"` // Message describing the error. }
An Error reports more details on an individual error in an ErrorResponse.
type GSDownloader ¶ added in v3.82.0
type GSDownloader struct {
// contains filtered or unexported fields
}
func NewGSDownloader ¶ added in v3.82.0
func NewGSDownloader(l logger.Logger, c GSDownloaderConfig) *GSDownloader
func (GSDownloader) BucketFileLocation ¶ added in v3.82.0
func (d GSDownloader) BucketFileLocation() string
func (GSDownloader) BucketName ¶ added in v3.82.0
func (d GSDownloader) BucketName() string
func (GSDownloader) BucketPath ¶ added in v3.82.0
func (d GSDownloader) BucketPath() string
type GSDownloaderConfig ¶ added in v3.82.0
type GSDownloaderConfig struct { // The name of the bucket Bucket string // The root directory of the download Destination string // The relative path that should be preserved in the download folder, // also its location in the bucket Path string // How many times should it retry the download before giving up Retries int // If failed responses should be dumped to the log DebugHTTP bool TraceHTTP bool }
type GSUploader ¶ added in v3.82.0
type GSUploader struct { // The gs bucket path set from the destination BucketPath string // The gs bucket name set from the destination BucketName string // contains filtered or unexported fields }
func NewGSUploader ¶ added in v3.82.0
func NewGSUploader(ctx context.Context, l logger.Logger, c GSUploaderConfig) (*GSUploader, error)
func (*GSUploader) CreateWork ¶ added in v3.83.0
func (u *GSUploader) CreateWork(artifact *api.Artifact) ([]workUnit, error)
type GSUploaderConfig ¶ added in v3.82.0
type GSUploaderConfig struct { // The destination which includes the GS bucket name and the path. // gs://my-bucket-name/foo/bar Destination string }
type S3Downloader ¶ added in v3.82.0
type S3Downloader struct {
// contains filtered or unexported fields
}
func NewS3Downloader ¶ added in v3.82.0
func NewS3Downloader(l logger.Logger, c S3DownloaderConfig) *S3Downloader
func (S3Downloader) BucketFileLocation ¶ added in v3.82.0
func (d S3Downloader) BucketFileLocation() string
func (S3Downloader) BucketName ¶ added in v3.82.0
func (d S3Downloader) BucketName() string
func (S3Downloader) BucketPath ¶ added in v3.82.0
func (d S3Downloader) BucketPath() string
type S3DownloaderConfig ¶ added in v3.82.0
type S3DownloaderConfig struct { // The client for interacting with S3 S3Client *s3.S3 // The S3 bucket name and the path, for example, s3://my-bucket-name/foo/bar S3Path string // The root directory of the download Destination string // The relative path that should be preserved in the download folder, // also its location in the bucket Path string // How many times should it retry the download before giving up Retries int // If failed responses should be dumped to the log DebugHTTP bool TraceHTTP bool DisableHTTP2 bool }
type S3Uploader ¶ added in v3.82.0
type S3Uploader struct { // The s3 bucket path set from the destination BucketPath string // The s3 bucket name set from the destination BucketName string // contains filtered or unexported fields }
func NewS3Uploader ¶ added in v3.82.0
func NewS3Uploader(l logger.Logger, c S3UploaderConfig) (*S3Uploader, error)
func (*S3Uploader) CreateWork ¶ added in v3.83.0
func (u *S3Uploader) CreateWork(artifact *api.Artifact) ([]workUnit, error)
type S3UploaderConfig ¶ added in v3.82.0
type S3UploaderConfig struct { // The destination which includes the S3 bucket name and the path. // For example, s3://my-bucket-name/foo/bar Destination string }
type Searcher ¶ added in v3.82.0
type Searcher struct {
// contains filtered or unexported fields
}
func NewSearcher ¶ added in v3.82.0
type Uploader ¶ added in v3.82.0
type Uploader struct {
// contains filtered or unexported fields
}
func NewUploader ¶ added in v3.82.0
func NewUploader(l logger.Logger, ac APIClient, c UploaderConfig) *Uploader
type UploaderConfig ¶ added in v3.82.0
type UploaderConfig struct { // The ID of the Job JobID string // The path of the uploads Paths string // Where we'll be uploading artifacts Destination string // A specific Content-Type to use for all artifacts ContentType string // Standard HTTP options. DebugHTTP bool TraceHTTP bool DisableHTTP2 bool // Whether to follow symbolic links when resolving globs GlobResolveFollowSymlinks bool // Whether to not upload symlinks UploadSkipSymlinks bool // Whether to allow multipart uploads to the BK-hosted bucket AllowMultipart bool }