github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/pkg/model/v1alpha1/storage_spec.go (about) 1 package v1alpha1 2 3 // StorageSpec represents some data on a storage engine. Storage engines are 4 // specific to particular execution engines, as different execution engines 5 // will mount data in different ways. 6 type StorageSpec struct { 7 // StorageSource is the abstract source of the data. E.g. a storage source 8 // might be a URL download, but doesn't specify how the execution engine 9 // does the download or what it will do with the downloaded data. 10 StorageSource StorageSourceType `json:"StorageSource,omitempty"` 11 12 // Name of the spec's data, for reference. 13 Name string `json:"Name,omitempty" example:"job-9304c616-291f-41ad-b862-54e133c0149e-shard-0-host-QmdZQ7ZbhnvWY1J12XYKGHApJ6aufKyLNSvf8jZBrBaAVL"` //nolint:lll 14 15 // The unique ID of the data, where it makes sense (for example, in an 16 // IPFS storage spec this will be the data's CID). 17 // NOTE: The below is capitalized to match IPFS & IPLD (even though it's out of golang fmt) 18 CID string `json:"CID,omitempty" example:"QmTVmC7JBD2ES2qGPqBNVWnX1KeEPNrPGb7rJ8cpFgtefe"` 19 20 // Source URL of the data 21 URL string `json:"URL,omitempty"` 22 23 // The path that the spec's data should be mounted on, where it makes 24 // sense (for example, in a Docker storage spec this will be a filesystem 25 // path). 26 // TODO: #668 Replace with "Path" (note the caps) for yaml/json when we update the n.js file 27 Path string `json:"path,omitempty"` 28 29 // Additional properties specific to each driver 30 Metadata map[string]string `json:"Metadata,omitempty"` 31 } 32 33 // PublishedStorageSpec is a wrapper for a StorageSpec that has been published 34 // by a compute provider - it keeps info about the host, job and shard that 35 // lead to the given storage spec being published 36 type PublishedResult struct { 37 NodeID string `json:"NodeID,omitempty"` 38 ShardIndex int `json:"ShardIndex,omitempty"` 39 Data StorageSpec `json:"Data,omitempty"` 40 }