ocmd

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProtocolName added in v1.27.0

func GetProtocolName(p Protocol) string

GetProtocolName returns the name of the protocol by reflection.

func New

func New(ctx context.Context, m map[string]interface{}) (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 Datatx added in v0.0.29

type Datatx struct {
	SharedSecret string `json:"sharedSecret" validate:"required"`
	SourceURI    string `json:"srcUri"       validate:"required"`
	Size         uint64 `json:"size"         validate:"required"`
}

Datatx contains the parameters for the Datatx protocol.

func (*Datatx) ToOCMProtocol added in v0.0.29

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

ToOCMProtocol convert the protocol to a ocm Protocol struct.

type Protocol added in v0.0.29

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 added in v0.0.29

type Protocols []Protocol

Protocols is the list of protocols.

func (Protocols) MarshalJSON added in v0.0.29

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

MarshalJSON implements the Marshaler interface.

func (*Protocols) UnmarshalJSON added in v0.0.29

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

UnmarshalJSON implements the Unmarshaler interface.

type WebDAV added in v0.0.29

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

WebDAV contains the parameters for the WebDAV protocol.

func (*WebDAV) ToOCMProtocol added in v0.0.29

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

ToOCMProtocol convert the protocol to a ocm Protocol struct.

type Webapp added in v0.0.29

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 added in v0.0.29

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