asset

package
v0.0.0-...-4b25d55 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAssetDoesNotExist = errors.New("the asset did not exist")
View Source
var ErrAssetTypeDisabled = errors.New("uploading assets of this type is disabled")
View Source
var ErrUnknownBucket = errors.New("the asset is not in the currently managed bucket")

Functions

This section is empty.

Types

type Compressor

type Compressor func(req *uploadRequest,
	next func(req *uploadRequest) (*uploadResponse, error)) (*uploadResponse, error)

type Config

type Config struct {
	// Debug mode forces syz-ci upload artifacts on each syz-manager restart and also forces
	// it to produce more logs.
	Debug bool `json:"debug"`
	// Where to upload artifacts.
	// If "gs://bucket/" is specified, assets will be stored in the corresponding GCS bucket.
	// If "dummy://" is specified, assets will not be actually stored anywhere. May be helpful
	// for debugging.
	UploadTo string `json:"upload_to"`
	// Perform asset deprecation from this instance. If several syz-ci's share a common stoage,
	// it make sense to enable derprecation only on one of them.
	DoDeprecation bool `json:"do_deprecation"`
	// Make assets publicly available (note that it also might require special configuration
	// on the storage backend's side).
	PublicAccess bool `json:"public_access"`
	// Some asset type-specific configurations. By default all asset types are enabled.
	Assets map[dashapi.AssetType]TypeConfig `json:"assets"`
}

func (*Config) IsEmpty

func (c *Config) IsEmpty() bool

func (*Config) IsEnabled

func (c *Config) IsEnabled(assetType dashapi.AssetType) bool

func (*Config) Validate

func (c *Config) Validate() error

type Dashboard

type Dashboard interface {
	AddBuildAssets(req *dashapi.AddBuildAssetsReq) error
	NeededAssetsList() (*dashapi.NeededAssetsResp, error)
}

type DeprecateStats

type DeprecateStats struct {
	Needed   int // The count of assets currently needed in the dashboard.
	Existing int // The number of assets currently stored.
	Deleted  int // How many were deleted during DeprecateAssets().
}

type ExtraUploadArg

type ExtraUploadArg struct {
	// It is assumed that paths constructed with same UniqueTag values
	// always correspond to an asset having the same content.
	UniqueTag string
	// If the asset being uploaded already exists (see above), don't return
	// an error, abort uploading and return the download URL.
	SkipIfExists bool
}

type FileExistsError

type FileExistsError struct {
	// The path gets changed by wrappers, so we need to return it back.
	Path string
}

func (*FileExistsError) Error

func (e *FileExistsError) Error() string

type QueryTypeTitle

type QueryTypeTitle func(*targets.Target) string

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func StorageFromConfig

func StorageFromConfig(cfg *Config, dash Dashboard) (*Storage, error)

func (*Storage) AssetTypeEnabled

func (storage *Storage) AssetTypeEnabled(assetType dashapi.AssetType) bool

func (*Storage) DeprecateAssets

func (storage *Storage) DeprecateAssets() (DeprecateStats, error)

Best way: convert download URLs to paths. We don't want to risk killing all assets after a slight domain change.

func (*Storage) ReportBuildAssets

func (storage *Storage) ReportBuildAssets(build *dashapi.Build, assets ...dashapi.NewAsset) error

func (*Storage) UploadBuildAsset

func (storage *Storage) UploadBuildAsset(reader io.Reader, fileName string, assetType dashapi.AssetType,
	build *dashapi.Build, extra *ExtraUploadArg) (dashapi.NewAsset, error)

func (*Storage) UploadCrashAsset

func (storage *Storage) UploadCrashAsset(reader io.Reader, fileName string, assetType dashapi.AssetType,
	extra *ExtraUploadArg) (dashapi.NewAsset, error)

type StorageBackend

type StorageBackend interface {
	// contains filtered or unexported methods
}

type TypeConfig

type TypeConfig struct {
	Never bool `json:"never"`
}

func (*TypeConfig) Validate

func (tc *TypeConfig) Validate() error

type TypeDescription

type TypeDescription struct {
	AllowMultiple   bool
	GetTitle        QueryTypeTitle
	ContentType     string
	ContentEncoding string
	ReportingPrio   int // the smaller, the higher the asset is on the list during reporting
	NoReporting     bool
	// contains filtered or unexported fields
}

func GetTypeDescription

func GetTypeDescription(assetType dashapi.AssetType) *TypeDescription

Jump to

Keyboard shortcuts

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