mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-20 03:52:32 -05:00
* refactor some pkg/jmap and groupware methods to make more sense from an API point-of-view * add path parameter documentation, but automate it by injecting their definition into the OpenAPI YAML tree that is extracted from the source code using go-swagger as it is too cumbersome, repetitive and error-prine to document them in the source code; wrote a TypeScript file apidoc-process.ts to do so * add generating an offline HTML file for the OpenAPI documentation using redocly, and injecting a favicon into the resulting HTML; wrote a TypeScript file apidoc-postprocess-html.ts to do so
36 lines
986 B
Go
36 lines
986 B
Go
package jmap
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
"net/url"
|
|
|
|
"github.com/opencloud-eu/opencloud/pkg/log"
|
|
)
|
|
|
|
type ApiClient interface {
|
|
Command(ctx context.Context, logger *log.Logger, session *Session, request Request) ([]byte, Error)
|
|
io.Closer
|
|
}
|
|
|
|
type SessionClient interface {
|
|
GetSession(baseurl *url.URL, username string, logger *log.Logger) (SessionResponse, Error)
|
|
}
|
|
|
|
type BlobClient interface {
|
|
UploadBinary(ctx context.Context, logger *log.Logger, session *Session, uploadUrl string, endpoint string, contentType string, content io.Reader) (UploadedBlob, Error)
|
|
DownloadBinary(ctx context.Context, logger *log.Logger, session *Session, downloadUrl string, endpoint string) (*BlobDownload, Error)
|
|
}
|
|
|
|
const (
|
|
logOperation = "operation"
|
|
logMailboxId = "mailbox-id"
|
|
logFetchBodies = "fetch-bodies"
|
|
logOffset = "offset"
|
|
logLimit = "limit"
|
|
logDownloadUrl = "download-url"
|
|
logBlobId = "blob-id"
|
|
logUploadUrl = "download-url"
|
|
logSinceState = "since-state"
|
|
)
|