github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/pkg/model/v1beta1/storage_spec.go (about)

     1  package v1beta1
     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 of the host data if we are using local directory paths
    24  	SourcePath string `json:"SourcePath,omitempty"`
    25  
    26  	// The path that the spec's data should be mounted on, where it makes
    27  	// sense (for example, in a Docker storage spec this will be a filesystem
    28  	// path).
    29  	// TODO: #668 Replace with "Path" (note the caps) for yaml/json when we update the n.js file
    30  	Path string `json:"path,omitempty"`
    31  
    32  	// Additional properties specific to each driver
    33  	Metadata map[string]string `json:"Metadata,omitempty"`
    34  }
    35  
    36  // PublishedStorageSpec is a wrapper for a StorageSpec that has been published
    37  // by a compute provider - it keeps info about the host, job and shard that
    38  // lead to the given storage spec being published
    39  type PublishedResult struct {
    40  	NodeID     string      `json:"NodeID,omitempty"`
    41  	ShardIndex int         `json:"ShardIndex,omitempty"`
    42  	Data       StorageSpec `json:"Data,omitempty"`
    43  }