Documentation
¶
Overview ¶
Package nextcloud verifies a clientID and clientSecret against a Nextcloud backend.
Index ¶
- func GetNextcloudServerMock(called *[]string) http.Handler
- func New(m map[string]interface{}) (share.Manager, error)
- func NewShareManager(c *ShareManagerConfig, hc *http.Client) (share.Manager, error)
- func TestingHTTPClient(handler http.Handler) (*http.Client, func())
- type Action
- type GranteeAltMap
- type ReceivedShareAltMap
- type Response
- type ShareAltMap
- type ShareManagerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNextcloudServerMock ¶
GetNextcloudServerMock returns a handler that pretends to be a remote Nextcloud server
func NewShareManager ¶
NewShareManager returns a new Nextcloud-based ShareManager
func TestingHTTPClient ¶
TestingHTTPClient thanks to https://itnext.io/how-to-stub-requests-to-remote-hosts-with-go-6c2c1db32bf2 Ideally, this function would live in tests/helpers, but if we put it there, it gets excluded by .dockerignore, and the Docker build fails (see https://github.com/cs3org/reva/issues/1999) So putting it here for now - open to suggestions if someone knows a better way to inject this.
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action describes a REST request to forward to the Nextcloud backend
type GranteeAltMap ¶
type GranteeAltMap struct {
ID *provider.Grantee_UserId `json:"id"`
}
GranteeAltMap is an alternative map to JSON-unmarshal a Grantee Grantees are hard to unmarshal, so unmarshalling into a map[string]interface{} first, see also https://github.com/pondersource/sciencemesh-nextcloud/issues/27
type ReceivedShareAltMap ¶
type ReceivedShareAltMap struct {
}
ReceivedShareAltMap is an alternative map to JSON-unmarshal a ReceivedShare
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response contains data for the Nextcloud mock server to respond and to switch to a new server state
type ShareAltMap ¶
type ShareAltMap struct {
}
ShareAltMap is an alternative map to JSON-unmarshal a Share
type ShareManagerConfig ¶
type ShareManagerConfig struct {
}
ShareManagerConfig contains config for a Nextcloud-based ShareManager