mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
carddav: add AddressObject.Remove
This commit is contained in:
parent
579a25f989
commit
f8d9f83cbc
@ -24,6 +24,7 @@ type AddressObject interface {
|
||||
Stat() (os.FileInfo, error) // can return nil, nil
|
||||
Card() (vcard.Card, error)
|
||||
SetCard(vcard.Card) error
|
||||
Remove() error
|
||||
}
|
||||
|
||||
type AddressBook interface {
|
||||
|
@ -370,7 +370,17 @@ func (fs *fileSystem) OpenFile(ctx context.Context, name string, flag int, perm
|
||||
}
|
||||
|
||||
func (fs *fileSystem) RemoveAll(ctx context.Context, name string) error {
|
||||
return errNotYetImplemented
|
||||
if name == "/" {
|
||||
return errUnsupported
|
||||
}
|
||||
|
||||
id := fs.addressObjectID(name)
|
||||
ao, err := fs.ab.GetAddressObject(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ao.Remove()
|
||||
}
|
||||
|
||||
func (fs *fileSystem) Rename(ctx context.Context, oldName, newName string) error {
|
||||
|
Loading…
Reference in New Issue
Block a user