go-webdav/carddav/backend.go

33 lines
543 B
Go
Raw Normal View History

2017-09-03 19:11:36 +01:00
package carddav
// TODO: add context support
import (
"errors"
"os"
2017-09-03 19:11:36 +01:00
"github.com/emersion/go-vcard"
)
var (
ErrNotFound = errors.New("carddav: not found")
)
2017-09-09 15:45:31 +01:00
type AddressBookInfo struct {
Name string
Description string
MaxResourceSize int
}
2017-09-03 19:11:36 +01:00
type AddressObject interface {
ID() string
Card() (vcard.Card, error)
Stat() (os.FileInfo, error) // can return nil, nil
2017-09-03 19:11:36 +01:00
}
type AddressBook interface {
2017-09-09 15:45:31 +01:00
Info() (*AddressBookInfo, error)
2017-09-03 19:11:36 +01:00
GetAddressObject(id string) (AddressObject, error)
ListAddressObjects() ([]AddressObject, error)
}