NFSSVC-27 Add CID to Bucket struct

This is done in order to cache the list of containers in the future
This commit is contained in:
Evgeniy Kulikov 2020-07-28 11:43:42 +03:00
parent 504ef4da91
commit 1db70efd7b

View file

@ -25,6 +25,7 @@ type (
// Bucket container for bucket metadata
Bucket struct {
CID refs.CID `xml:"-"` // ignored by response
Name string
CreationDate string // time string of format "2006-01-02T15:04:05.000Z"
}
@ -72,6 +73,7 @@ func (h *handler) getContainerInfo(ctx context.Context, p cnrInfoParams) (*Bucke
_ = res
return &Bucket{
CID: p.cid,
Name: p.cid.String(),
CreationDate: new(time.Time).Format(time.RFC3339),
}, nil