ocmd

package
v2.46.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(m map[string]interface{}, log *zerolog.Logger) (global.Service, error)

New returns a new ocmd object, that implements the OCM APIs specified in https://cs3org.github.io/OCM-API/docs.html

Types

type DirectoryService added in v2.40.0

type DirectoryService struct {
	Federation string                   `json:"federation"`
	Servers    []DirectoryServiceServer `json:"servers"`
}

DirectoryService represents a directory service listing per OCM spec Appendix C.

type DirectoryServiceServer added in v2.40.0

type DirectoryServiceServer struct {
	DisplayName string `json:"displayName"`
	URL         string `json:"url"`
	// Added after discovery, not in raw response
	InviteAcceptDialog string `json:"inviteAcceptDialog,omitempty"`
}

DirectoryServiceServer represents a single OCM server in a directory service.

type OCMClient added in v2.40.0

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

OCMClient is the client for an OCM provider.

func NewClient added in v2.40.0

func NewClient(timeout time.Duration, insecure bool) *OCMClient

NewClient returns a new OCMClient.

func (*OCMClient) Discover added in v2.40.0

func (c *OCMClient) Discover(ctx context.Context, endpoint string) (*wellknown.OcmDiscoveryData, error)

Discover returns the OCM discovery information for a remote endpoint. It tries /.well-known/ocm first, then falls back to /ocm-provider (legacy). https://cs3org.github.io/OCM-API/docs.html?branch=develop&repo=OCM-API&user=cs3org#/paths/~1ocm-provider/get

func (*OCMClient) GetDirectoryService added in v2.40.0

func (c *OCMClient) GetDirectoryService(ctx context.Context, directoryURL string) (*DirectoryService, error)

GetDirectoryService fetches a directory service listing from the given URL per OCM spec Appendix C.

type Protocol

type Protocol interface {
	// ToOCMProtocol convert the protocol to a ocm Protocol struct
	ToOCMProtocol() *ocm.Protocol
}

Protocol represents the way of access the resource in the OCM share.

type Protocols

type Protocols []Protocol

Protocols is the list of protocols.

func (Protocols) MarshalJSON

func (p Protocols) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface.

func (*Protocols) UnmarshalJSON

func (p *Protocols) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface.

type WebDAV

type WebDAV struct {
	SharedSecret string   `json:"sharedSecret" validate:"required"`
	Permissions  []string `json:"permissions" validate:"required,dive,required,oneof=read write share"`
	URI          string   `json:"uri" validate:"required"`
}

WebDAV contains the parameters for the WebDAV protocol.

func (*WebDAV) ToOCMProtocol

func (w *WebDAV) ToOCMProtocol() *ocm.Protocol

ToOCMProtocol convert the protocol to a ocm Protocol struct.

func (*WebDAV) UnmarshalJSON added in v2.39.1

func (w *WebDAV) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling for backward compatibility. It supports both "url" (legacy) and "uri" (new) field names.

type Webapp

type Webapp struct {
	URITemplate string `json:"uriTemplate" validate:"required"`
	ViewMode    string `json:"viewMode" validate:"required,dive,required,oneof=view read write"`
}

Webapp contains the parameters for the Webapp protocol.

func (*Webapp) ToOCMProtocol

func (w *Webapp) ToOCMProtocol() *ocm.Protocol

ToOCMProtocol convert the protocol to a ocm Protocol struct.

Jump to

Keyboard shortcuts

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