obtain hash for an object
(ctx context.Context, hashType hash.Type)
| 15 | |
| 16 | // obtain hash for an object |
| 17 | func (o *Object) getHash(ctx context.Context, hashType hash.Type) (string, error) { |
| 18 | maxAge := time.Duration(o.f.opt.MaxAge) |
| 19 | if maxAge <= 0 { |
| 20 | return "", nil |
| 21 | } |
| 22 | fp := o.fingerprint(ctx) |
| 23 | if fp == "" { |
| 24 | return "", errors.New("fingerprint failed") |
| 25 | } |
| 26 | return o.f.getRawHash(ctx, hashType, o.Remote(), fp, maxAge) |
| 27 | } |
| 28 | |
| 29 | // obtain hash for a path |
| 30 | func (f *Fs) getRawHash(ctx context.Context, hashType hash.Type, remote, fp string, age time.Duration) (string, error) { |
no test coverage detected