client

package
v0.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidParameters = errors.New("invalid parameters")

ErrInvalidParameters is the error returned by the shares endpoint when the request does not contain required properties.

View Source
var ErrServiceNotTrusted = errors.New("service is not trusted to accept invitations")

ErrServiceNotTrusted is the error returned by the invite-accepted endpoint when the service is not trusted to accept invitations.

View Source
var ErrTokenInvalid = errors.New("the invitation token is invalid")

ErrTokenInvalid is the error returned by the invite-accepted endpoint when the token is not valid.

View Source
var ErrTokenNotFound = errors.New("token not found")

ErrTokenNotFound is the error returned by the invite-accepted endpoint when the request is done using a not existing token.

View Source
var ErrUserAlreadyAccepted = errors.New("user already accepted an invitation token")

ErrUserAlreadyAccepted is the error returned by the invite-accepted endpoint when a user is already know by the remote cloud.

Functions

This section is empty.

Types

type Config

type Config struct {
	Timeout  time.Duration
	Insecure bool
}

Config is the configuration to be used for the OCMClient.

type InviteAcceptedRequest

type InviteAcceptedRequest struct {
	UserID            string `json:"userID"`
	Email             string `json:"email"`
	Name              string `json:"name"`
	RecipientProvider string `json:"recipientProvider"`
	Token             string `json:"token"`
}

InviteAcceptedRequest contains the parameters for accepting an invitation.

type NewShareRequest

type NewShareRequest struct {
	ShareWith         string         `json:"shareWith"`
	Name              string         `json:"name"`
	Description       string         `json:"description"`
	ResourceID        string         `json:"resourceId"`
	Owner             string         `json:"owner"`
	Sender            string         `json:"sender"`
	OwnerDisplayName  string         `json:"ownerDisplayName"`
	SenderDisplayName string         `json:"senderDisplayName"`
	ShareType         string         `json:"shareType"`
	Expiration        uint64         `json:"expiration"`
	ResourceType      string         `json:"resourceType"`
	Protocols         ocmd.Protocols `json:"protocols"`
}

NewShareRequest contains the parameters for creating a new OCM share.

type NewShareResponse

type NewShareResponse struct {
	RecipientDisplayName string `json:"recipientDisplayName"`
}

NewShareResponse is the response returned when creating a new share.

type OCMClient

type OCMClient struct {
	// contains filtered or unexported fields
}

OCMClient is the client for an OCM provider.

func New

func New(c *Config) *OCMClient

New returns a new OCMClient.

func (*OCMClient) InviteAccepted

func (c *OCMClient) InviteAccepted(ctx context.Context, endpoint string, r *InviteAcceptedRequest) (*User, error)

InviteAccepted informs the sender that the invitation was accepted to start sharing https://cs3org.github.io/OCM-API/docs.html?branch=develop&repo=OCM-API&user=cs3org#/paths/~1invite-accepted/post

type User

type User struct {
	UserID string `json:"userID"`
	Email  string `json:"email"`
	Name   string `json:"name"`
}

User contains the remote user's information when accepting an invitation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL