X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a95f899d7ac84f29b3d019aa410d265bb40833e5..5ba9471d651c9f6235988d3ec680461ba4785453:/sdk/go/arvados/collection.go diff --git a/sdk/go/arvados/collection.go b/sdk/go/arvados/collection.go index 71f5247615..157ce16788 100644 --- a/sdk/go/arvados/collection.go +++ b/sdk/go/arvados/collection.go @@ -12,26 +12,33 @@ import ( // Collection is an arvados#collection resource. type Collection struct { UUID string `json:"uuid,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` + TrashAt *time.Time `json:"trash_at,omitempty"` ManifestText string `json:"manifest_text,omitempty"` + UnsignedManifestText string `json:"unsigned_manifest_text,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` ModifiedAt *time.Time `json:"modified_at,omitempty"` PortableDataHash string `json:"portable_data_hash,omitempty"` ReplicationConfirmed *int `json:"replication_confirmed,omitempty"` ReplicationConfirmedAt *time.Time `json:"replication_confirmed_at,omitempty"` ReplicationDesired *int `json:"replication_desired,omitempty"` + DeleteAt *time.Time `json:"delete_at,omitempty"` + IsTrashed bool `json:"is_trashed,omitempty"` } // SizedDigests returns the hash+size part of each data block // referenced by the collection. func (c *Collection) SizedDigests() ([]SizedDigest, error) { - if c.ManifestText == "" && c.PortableDataHash != "d41d8cd98f00b204e9800998ecf8427e+0" { + manifestText := c.ManifestText + if manifestText == "" { + manifestText = c.UnsignedManifestText + } + if manifestText == "" && c.PortableDataHash != "d41d8cd98f00b204e9800998ecf8427e+0" { // TODO: Check more subtle forms of corruption, too return nil, fmt.Errorf("manifest is missing") } var sds []SizedDigest - scanner := bufio.NewScanner(strings.NewReader(c.ManifestText)) - scanner.Buffer(make([]byte, 1048576), len(c.ManifestText)) + scanner := bufio.NewScanner(strings.NewReader(manifestText)) + scanner.Buffer(make([]byte, 1048576), len(manifestText)) for scanner.Scan() { line := scanner.Text() tokens := strings.Split(line, " ")