cmd/mountlib: convert time.Duration option to fs.Duration

This commit is contained in:
Nick Craig-Wood
2024-07-15 11:09:54 +01:00
parent 7c51b10d15
commit 2c57fe9826
8 changed files with 34 additions and 25 deletions
+6
View File
@@ -283,6 +283,12 @@ func (p Params) GetDuration(key string) (time.Duration, error) {
return duration, nil
}
// GetFsDuration get the duration parameters from in
func (p Params) GetFsDuration(key string) (fs.Duration, error) {
d, err := p.GetDuration(key)
return fs.Duration(d), err
}
// Error creates the standard response for an errored rc call using an
// rc.Param from a path, input Params, error and a suggested HTTP
// response code.