Documentation
¶
Overview ¶
Package nextcloud is a client library for NextCloud. It only supports files via Webdav for the moment.
Index ¶
- Variables
- type File
- func (f *File) Clone() couchdb.Doc
- func (f *File) DocType() string
- func (f *File) ID() string
- func (f *File) Included() []jsonapi.Object
- func (f *File) Links() *jsonapi.LinksList
- func (f *File) Relationships() jsonapi.RelationshipMap
- func (f *File) Rev() string
- func (f *File) SetID(id string)
- func (f *File) SetRev(id string)
- type NextCloud
- func (nc *NextCloud) Copy(oldPath, newPath string) error
- func (nc *NextCloud) Delete(path string) error
- func (nc *NextCloud) DeleteTrash(path string) error
- func (nc *NextCloud) Download(path string) (*webdav.Download, error)
- func (nc *NextCloud) Downstream(path, dirID string, kind OperationKind, cozyMetadata *vfs.FilesCozyMetadata, ...) (*vfs.FileDoc, error)
- func (nc *NextCloud) EmptyTrash() error
- func (nc *NextCloud) ListFiles(path string) ([]jsonapi.Object, error)
- func (nc *NextCloud) ListTrashed(path string) ([]jsonapi.Object, error)
- func (nc *NextCloud) Mkdir(path string) error
- func (nc *NextCloud) Move(oldPath, newPath string) error
- func (nc *NextCloud) Restore(path string) error
- func (nc *NextCloud) Upload(path, mime string, contentLength int64, body io.Reader) error
- func (nc *NextCloud) Upstream(path, from string, kind OperationKind) error
- type OCSPayload
- type OperationKind
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrAccountNotFound is used when the no account can be found with the // given ID. ErrAccountNotFound = errors.New("account not found") // ErrInvalidAccount is used when the account cannot be used to connect to // NextCloud. ErrInvalidAccount = errors.New("invalid NextCloud account") )
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
DocID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Path string `json:"path"`
Size uint64 `json:"size,omitempty"`
Mime string `json:"mime,omitempty"`
Class string `json:"class,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
ETag string `json:"etag,omitempty"`
RestorePath string `json:"restore_path,omitempty"`
// contains filtered or unexported fields
}
func (*File) Relationships ¶
func (f *File) Relationships() jsonapi.RelationshipMap
type NextCloud ¶
type NextCloud struct {
// contains filtered or unexported fields
}
func (*NextCloud) DeleteTrash ¶
func (*NextCloud) Downstream ¶
func (nc *NextCloud) Downstream(path, dirID string, kind OperationKind, cozyMetadata *vfs.FilesCozyMetadata, failOnConflict bool) (*vfs.FileDoc, error)
func (*NextCloud) EmptyTrash ¶
func (*NextCloud) ListTrashed ¶
type OCSPayload ¶
type OCSPayload struct {
OCS struct {
Data struct {
UserID string `json:"userId"`
} `json:"data"`
} `json:"ocs"`
}
type OperationKind ¶
type OperationKind int
const ( MoveOperation OperationKind = iota CopyOperation )
Click to show internal directories.
Click to hide internal directories.