uploadasset

package
v0.0.0-...-2669ccc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UploadAsset

type UploadAsset struct {
	Name     string
	ModTime  time.Time
	FilePath string
	Hash     []byte
}

func GetAsset

func GetAsset(assetLocation string) (asset UploadAsset, err error)

GetAsset takes a string as argument which must be in the format `<assetformat>=<filename>`.

The function will return an `UploadAsset` object or an error.

The supported formats are `file`, `zip` and `tgz`.

For `file` assets, the function will open the file in read only mode and create an `UploadAsset` object with the file and the file info.

For `zip` and `tgz` assets, the function will use the `createZipFile` and `createTgzFile` functions to create the asset.

An error will be returned if the asset format is not supported or if an error occurs while creating the asset.

func (*UploadAsset) New

func (ua *UploadAsset) New(name string, file *os.File) (err error)

Jump to

Keyboard shortcuts

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