document

package
v0.0.0-...-b1bb88e Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: LGPL-2.1 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const Error_Arguments = "arguments_wrong" // arguments are invalid (e.g. wrong number, wrong type)
View Source
const Error_Filesytem = "filesystem" // Problems with filesystem
View Source
const Error_Invalid_Data = "data_invalid" // For all kind of wrong data errors
View Source
const Error_Operation_Invalid = "operation_invalid" // User operation not possible with current application state
View Source
const Error_Process = "process_failed" // For all kind of proccesses or operations
View Source
const Error_Setup = "setup_invalid" // The datastructures are not setup correctly

Variables

This section is empty.

Functions

func NewRawDmlObject

func NewRawDmlObject(rntm *dml.Runtime) (dml.Object, error)

Types

type Datastructure

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

Async datastructure which encapsulates synchronous DML runtime and a datastore. It works operation based: All operations are carried out ordered

func NewDatastructure

func NewDatastructure(path string, prefix string, client *nxclient.Client) (Datastructure, error)

Creates a new shared dml datastructure and exposes it to wamp. * - The dml folder needs to be found in "path", and the datastore will be * created there too. * - Prefix is the wamp URI prefix the datastructure uses. After this prefix all * datastrucutre events are created in /events/... and all methods in /methods/...

func (Datastructure) Close

func (self Datastructure) Close()

func (Datastructure) CloseView

func (self Datastructure) CloseView(session wamp.ID) error

func (Datastructure) GetState

func (self Datastructure) GetState() p2p.State

func (Datastructure) HasView

func (self Datastructure) HasView(session wamp.ID) bool

func (Datastructure) OpenView

func (self Datastructure) OpenView(session wamp.ID) error

func (Datastructure) Start

func (self Datastructure) Start(s *p2p.Swarm)
Bookepping functions

*****************************************************************************

type Document

type Document struct {
	ID string
	// contains filtered or unexported fields
}

func NewDocument

func NewDocument(ctx context.Context, router *connection.Router, host *p2p.Host, dml utils.Cid, id string, join bool, logger hclog.Logger) (Document, error)

func (Document) Close

func (self Document) Close(ctx context.Context)

type DocumentAPI

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

A p2p RPC API that allows querying some document details

func (DocumentAPI) DocumentDML

func (self DocumentAPI) DocumentDML(ctx context.Context, val string, ret *utils.Cid) error

Allows to query the DML cid for a document ID

func (DocumentAPI) Invite

func (self DocumentAPI) Invite(ctx context.Context, docId string, ret *bool) error

Allows to send an invitation to us for a document ID

func (DocumentAPI) Uninvite

func (self DocumentAPI) Uninvite(ctx context.Context, docId string, ret *bool) error

Allows to send an invitation to us for a document ID

type DocumentHandler

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

func NewDocumentHandler

func NewDocumentHandler(router *connection.Router, host *p2p.Host, logger hclog.Logger) (*DocumentHandler, error)

func (*DocumentHandler) Close

func (self *DocumentHandler) Close(ctx context.Context)

func (*DocumentHandler) CloseDocument

func (self *DocumentHandler) CloseDocument(ctx context.Context, docID string) error

func (*DocumentHandler) CreateDocument

func (self *DocumentHandler) CreateDocument(ctx context.Context, path string) (Document, error)

func (*DocumentHandler) Invitations

func (self *DocumentHandler) Invitations() []string

func (*DocumentHandler) ListDocuments

func (self *DocumentHandler) ListDocuments() []string

func (*DocumentHandler) OpenDocument

func (self *DocumentHandler) OpenDocument(ctx context.Context, docID string) error

type Operation

type Operation struct {
	User        dml.User
	Path        string
	Arguments   []interface{}
	KWArguments map[string]interface{}

	Node    p2p.PeerID
	Session wamp.ID
}

func (Operation) ApplyTo

func (self Operation) ApplyTo(rntm *dml.Runtime, ds *datastore.Datastore) (interface{}, []dml.EmmitedEvent)

func (Operation) GetSession

func (self Operation) GetSession() (p2p.PeerID, wamp.ID)

func (Operation) ToData

func (self Operation) ToData() ([]byte, error)

type Raw

type Raw struct {
	*dml.DataImpl
}

Raw dml type: stores data identifiers and allows some information gathering

func (*Raw) Clear

func (self *Raw) Clear(id dml.Identifier) error

adds the path, either file or directory, to the Raw object

func (*Raw) Get

func (self *Raw) Get(id dml.Identifier) (string, error)

adds the path, either file or directory, to the Raw object

func (*Raw) IsSet

func (self *Raw) IsSet(id dml.Identifier) (bool, error)

adds the path, either file or directory, to the Raw object

func (*Raw) Set

func (self *Raw) Set(id dml.Identifier, cidstr string) error

adds the path, either file or directory, to the Raw object

Jump to

Keyboard shortcuts

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