types

package
v0.0.0-...-b9e25f6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetStatus_pending    = AssetStatus("pending")
	AssetStatus_processing = AssetStatus("processing")
	AssetStatus_done       = AssetStatus("done")
)
View Source
const (
	AssetKeyLen = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	// AssetKey - secret unique identifier of the asset
	AssetKey string `json:"assetKey" db:"asset_key"`

	// Btime - birth time
	Btime time.Time `json:"btime" db:"btime"`

	// Mtime - modify time
	Mtime *time.Time `json:"mtime" db:"mtime"`

	// Dtime - delete time
	Dtime *time.Time `json:"dtime" db:"dtime"`

	// Size - asset size
	Size int64 `json:"size" db:"size"`

	// ContentHash - hash combination of the asset contents
	ContentHash string `json:"contentHash" db:"content_hash"`

	// ContentType - http-style content-type (mime + additional info)
	ContentType string `json:"contentType" db:"content_type"`

	// OriginalName - original asset name (e.g. file name)
	OriginalName string `json:"originalName" db:"original_name"`

	// UserId - owner user identifier
	UserId string `json:"userId" db:"user_id"`

	// OriginalUrl - original external url (for files uploaded via url)
	OriginalUrl string `json:"originalUrl" db:"original_url"`

	// Deleted - deletion flag
	Deleted bool `json:"deleted" db:"deleted"`

	// StorageName - current storage name containing the asset
	StorageName string `json:"storageName" db:"storage_name"`

	// Status - current processing status of the asset (used when downloading by external url)
	Status AssetStatus `json:"status" db:"status"`

	// Info - arbitrary short information: meta, description, etc
	Info string `json:"info" db:"info"`

	// Error - message describing an error occurred while processing the asset
	Error string `json:"error" db:"error"`
}

func NewAsset

func NewAsset() *Asset

func (*Asset) Close

func (a *Asset) Close() error

func (*Asset) GenerateAssetKey

func (a *Asset) GenerateAssetKey()

func (*Asset) TableName

func (a *Asset) TableName() string

type AssetStatus

type AssetStatus string

Jump to

Keyboard shortcuts

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