ocmd

package
v2.52.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 38 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 NewPublicOnlyClient added in v2.46.9

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

NewPublicOnlyClient returns an OCMClient that only dials public addresses, for discovery of hosts named by an untrusted caller. The check is in the dialer so it also covers redirects and DNS rebinding.

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