resolvers

package
v0.0.0-...-73c7f38 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: MIT Imports: 8 Imported by: 0

README

Content Resolvers

This package utilizes IPShare's append-only DAG synchronization schemes to implement example shared data structures.

The two currently implemented are:

  • String G-Set (Grow-Only Set) CRDT
  • A CID based register with conflict resolution (e.g. IPNS, but where if multiple changes occur contemporaneously all options are available to the user, instead of simply Last-Writer-Wins semantics)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockedIPFS

type LockedIPFS struct {
	Ipfs *ipfsApi.Shell
	// contains filtered or unexported fields
}

LockedIPFS Is a synchronized IPFS Shell

func (*LockedIPFS) Add

func (s *LockedIPFS) Add(r io.Reader, options ...ipfsApi.AddOpts) (string, error)

Add data to IPFS

func (*LockedIPFS) Cat

func (s *LockedIPFS) Cat(path string) (string, error)

Cat Returns data from IPFS at the given path

type NamedMultiWriterStringSetCRDT

type NamedMultiWriterStringSetCRDT struct {
	GraphManager gsync.GossipMultiWriterIPNS
	Set          map[string]struct{}
	Ipfs         *LockedIPFS
	// contains filtered or unexported fields
}

NamedMultiWriterStringSetCRDT Is a string set CRDT that is updated by gossiping about the named structure (e.g. the structure is referenced by UUID or Hash(PublicKey))

func (*NamedMultiWriterStringSetCRDT) AddElem

func (mwSet *NamedMultiWriterStringSetCRDT) AddElem(elem string) error

AddElem adds an element to the set

func (*NamedMultiWriterStringSetCRDT) GetSet

func (mwSet *NamedMultiWriterStringSetCRDT) GetSet() map[string]struct{}

GetSet returns the map containing the set elements. Do not modify the contents.

type OverwriteWithConflicts

type OverwriteWithConflicts struct {
	GraphManager gsync.GossipMultiWriterIPNS
}

OverwriteWithConflicts Allows for gossip based updating of a value where simultaneous updates are preserved as conflicts

func (*OverwriteWithConflicts) GetLatestVersions

func (overwriter *OverwriteWithConflicts) GetLatestVersions() []cid.Cid

GetLatestVersions Returns all of the conflicting values

func (*OverwriteWithConflicts) UpdateVersion

func (overwriter *OverwriteWithConflicts) UpdateVersion(newCid cid.Cid)

UpdateVersion Overwrites the current value with a new one

type StringSetAdd

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

StringSetAdd Is the operation for adding a string to the set

Jump to

Keyboard shortcuts

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