asset

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package asset provides functionality to manage static assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactBucketUploader added in v1.28.0

type ArtifactBucketUploader struct {
	// FS is the file system to use.
	FS afero.Fs

	// Upload is the function called when uploading a file.
	Upload func(path string, contents io.Reader) error

	// AssetDir is the directory to upload the hashed files to.
	AssetDir string

	// AssetMappingFileDir is the directory to upload the asset mapping file to.
	AssetMappingFileDir string
}

ArtifactBucketUploader uploads local asset files.

func (*ArtifactBucketUploader) UploadFiles added in v1.28.0

func (u *ArtifactBucketUploader) UploadFiles(files []manifest.FileUpload) (string, error)

UploadFiles hashes each of the files specified in files and uploads them to the path "{AssetDir}/{hash}". After, it uploads a JSON file to AssetDir that maps the location of every file in the artifact bucket to its intended destination path in the service bucket. The path to the mapping file is returned along with an error, if any.

Jump to

Keyboard shortcuts

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