github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/cmn/objlist.go (about) 1 // Package cmn provides common constants, types, and utilities for AIS clients 2 // and AIStore. 3 /* 4 * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved. 5 */ 6 package cmn 7 8 import ( 9 "github.com/NVIDIA/aistore/cmn/cos" 10 ) 11 12 const MsgpLsoBufSize = 32 * cos.KiB 13 14 // 15 // NOTE: changes in this source MAY require re-running `msgp` code generation - see docs/msgp.md for details. 16 // NOTE: all json tags except `Flags` must belong to the (apc.GetPropsName, apc.GetPropsSize, etc.) enumeration 17 // 18 19 type ( 20 // a single entry in LsoRes.Entries (below); contains list-objects results 21 // for the corresponding (listed) object or archived file; 22 // `Flags` is a bit field where `EntryStatusBits` bits [0-4] are reserved for object status 23 // (all statuses are mutually exclusive) 24 LsoEnt struct { 25 Name string `json:"name" msg:"n"` // object name 26 Checksum string `json:"checksum,omitempty" msg:"cs,omitempty"` // checksum 27 Atime string `json:"atime,omitempty" msg:"a,omitempty"` // last access time; formatted as ListObjsMsg.TimeFormat 28 Version string `json:"version,omitempty" msg:"v,omitempty"` // e.g., GCP int64 generation, AWS version (string), etc. 29 Location string `json:"location,omitempty" msg:"t,omitempty"` // [tnode:mountpath] 30 Custom string `json:"custom-md,omitempty" msg:"m,omitempty"` // custom metadata: ETag, MD5, CRC, user-defined ... 31 Size int64 `json:"size,string,omitempty" msg:"s,omitempty"` // size in bytes 32 Copies int16 `json:"copies,omitempty" msg:"c,omitempty"` // ## copies (NOTE: for non-replicated object copies == 1) 33 Flags uint16 `json:"flags,omitempty" msg:"f,omitempty"` // enum { EntryIsCached, EntryIsDir, EntryInArch, ...} 34 } 35 36 LsoEntries []*LsoEnt 37 38 // `api.ListObjects` and `Backend.ListObjects` results 39 LsoRes struct { 40 UUID string `json:"uuid"` 41 ContinuationToken string `json:"continuation_token"` 42 Entries LsoEntries `json:"entries"` 43 Flags uint32 `json:"flags"` 44 } 45 )