file

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoogleCloudStorage = &gcsProvider{}

GoogleCloudStorage is the provider for Google Cloud Storage (GCS).

View Source
var S3Storage = &s3Provider{}

S3Storage is the provider for Amazon S3.

Functions

This section is empty.

Types

type FilestorePromoter

type FilestorePromoter struct {
	Source *api.Filestore
	Dest   *api.Filestore

	Files []api.File

	// Confirm, if set, will trigger a PRODUCTION artifact promotion.
	Confirm bool

	// UseServiceAccount must be true, for service accounts to be used
	// This gives some protection against a hostile manifest.
	UseServiceAccount bool
}

FilestorePromoter manages the promotion of files.

func (*FilestorePromoter) BuildOperations

func (p *FilestorePromoter) BuildOperations(
	ctx context.Context,
) ([]SyncFileOp, error)

BuildOperations builds the required operations to sync from the Source Filestore to the Dest Filestore.

type Hashes added in v3.4.12

type Hashes struct {
	SHA256 []byte
	SHA512 []byte
	MD5    []byte
	Length int64
}

type ManifestPromoter

type ManifestPromoter struct {
	Manifest *api.Manifest

	// Confirm, if set, will trigger a PRODUCTION artifact promotion.
	Confirm bool

	// UseServiceAccount must be true, for service accounts to be used
	// This gives some protection against a hostile manifest.
	UseServiceAccount bool
}

ManifestPromoter promotes files as described in Manifest.

func (*ManifestPromoter) BuildOperations

func (p *ManifestPromoter) BuildOperations(
	ctx context.Context,
) ([]SyncFileOp, error)

BuildOperations builds the required operations to sync from the Source Filestore to all Dest Filestores in the manifest.

type Provider added in v3.4.12

type Provider interface {
	// Scheme returns the URI scheme we handle.
	Scheme() string

	// OpenFilestore opens a handle to the specified filestore.
	OpenFilestore(ctx context.Context, filestore *api.Filestore, useServiceAccount, confirm bool) (syncFilestore, error)
}

Provider defines a file provider, able to work with GCS or S3.

type SyncFileInfo

type SyncFileInfo struct {
	RelativePath string
	AbsolutePath string

	// Some backends (GCS and S3) expose the MD5 of the content in metadata
	// This can allow skipping unnecessary copies.
	// Note: with multipart uploads or compression, the value is unobvious.
	MD5 string

	Size int64
	// contains filtered or unexported fields
}

SyncFileInfo tracks a file during the synchronization operation.

type SyncFileOp

type SyncFileOp interface {
	Run(ctx context.Context) error
}

SyncFileOp defines a synchronization operation.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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