SetModTime sets the metadata on the object to set the modification date
(ctx context.Context, t time.Time)
| 128 | |
| 129 | // SetModTime sets the metadata on the object to set the modification date |
| 130 | func (o *Object) SetModTime(ctx context.Context, t time.Time) error { |
| 131 | entries, err := o.fs.actionEntries(o.candidates()...) |
| 132 | if err != nil { |
| 133 | return err |
| 134 | } |
| 135 | var wg sync.WaitGroup |
| 136 | errs := Errors(make([]error, len(entries))) |
| 137 | multithread(len(entries), func(i int) { |
| 138 | if o, ok := entries[i].(*upstream.Object); ok { |
| 139 | err := o.SetModTime(ctx, t) |
| 140 | if err != nil { |
| 141 | errs[i] = fmt.Errorf("%s: %w", o.UpstreamFs().Name(), err) |
| 142 | } |
| 143 | } else { |
| 144 | errs[i] = fs.ErrorNotAFile |
| 145 | } |
| 146 | }) |
| 147 | wg.Wait() |
| 148 | return errs.Err() |
| 149 | } |
| 150 | |
| 151 | // GetTier returns storage tier or class of the Object |
| 152 | func (o *Object) GetTier() string { |
nothing calls this directly
no test coverage detected