mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-07-18 17:38:07 +08:00
@ -10,6 +10,7 @@ import (
|
||||
"errors"
|
||||
"hash"
|
||||
"io"
|
||||
"iter"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/errs"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -226,3 +227,13 @@ func (hi HashInfo) GetHash(ht *HashType) string {
|
||||
func (hi HashInfo) Export() map[*HashType]string {
|
||||
return hi.h
|
||||
}
|
||||
|
||||
func (hi HashInfo) All() iter.Seq2[*HashType, string] {
|
||||
return func(yield func(*HashType, string) bool) {
|
||||
for hashType, hashValue := range hi.h {
|
||||
if !yield(hashType, hashValue) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user