catalogs

package
v0.0.0-...-01875d1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

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

func NewCatalog

func NewCatalog(ideaSet, reprSet sets.IndividualSet, commit *Commit, owner friends.ID) *Catalog

func (*Catalog) AddIdea

func (c *Catalog) AddIdea(id blobs.ID) error

func (*Catalog) AddRepr

func (c *Catalog) AddRepr(id blobs.ID) error

func (*Catalog) Commit

func (c *Catalog) Commit() (*Commit, error)

func (*Catalog) RemoteCommit

func (c *Catalog) RemoteCommit(commit *Commit, inst *Instance) error

func (*Catalog) RemoveIdea

func (c *Catalog) RemoveIdea(id blobs.ID) error

func (*Catalog) RemoveRepr

func (c *Catalog) RemoveRepr(id blobs.ID) error

type Commit

type Commit struct {
	Owner              friends.ID
	Gen                uint64
	IdeaHash, ReprHash [32]byte
	Sig                []byte
}

func (*Commit) NewerThan

func (c *Commit) NewerThan(d *Commit) bool

type Instance

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

func (*Instance) SendCommit

func (inst *Instance) SendCommit(commit *Commit) error

func (*Instance) SendQuery

func (inst *Instance) SendQuery(q *Query) error

func (*Instance) SendRangeInfo

func (inst *Instance) SendRangeInfo(rm *RangeMessage) error

func (*Instance) Serve

func (inst *Instance) Serve(conn f2f.Conn) error

type LocalSet

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

func (*LocalSet) Add

func (ls *LocalSet) Add(item []byte) error

func (*LocalSet) Contains

func (ls *LocalSet) Contains(item []byte) bool

func (*LocalSet) Query

func (ls *LocalSet) Query(prefix []byte) (*RangeInfo, error)

func (*LocalSet) Remove

func (ls *LocalSet) Remove(item []byte) error

type MessageUnion

type MessageUnion struct {
	Query        *Query        `json:",omitempty"`
	RangeMessage *RangeMessage `json:",omitempty"`
	Commit       *Commit       `json:",omitempty"`
}

type MutableSet

type MutableSet interface {
	Set
	Add(item []byte) error
	Remove(item []byte) error
}

type Query

type Query struct {
	Owner  friends.ID
	Name   string
	Prefix []byte
}

type RangeInfo

type RangeInfo struct {
	Prefix []byte

	Count    uint64
	Hash     [32]byte
	Children *[256][32]byte
	Items    [][]byte
}

type RangeMessage

type RangeMessage struct {
	Owner     friends.ID
	Name      string
	RangeInfo *RangeInfo
}

type RemoteSet

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

func (*RemoteSet) Query

func (rs *RemoteSet) Query(prefix []byte) (*RangeInfo, error)

type Server

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

func NewServer

func NewServer(kvs kvstore.SortedStore, self friends.ID) (s *Server, err error)

func (*Server) AddIdea

func (s *Server) AddIdea(item blobs.ID) error

func (*Server) AddRepr

func (s *Server) AddRepr(item blobs.ID) error

func (*Server) Commit

func (s *Server) Commit() error

func (*Server) IdeaSet

func (s *Server) IdeaSet() sets.ObservableSortedSet

func (*Server) ReprSet

func (s *Server) ReprSet() sets.ObservableSortedSet

func (*Server) Serve

func (s *Server) Serve(l f2f.Listener) error

func (*Server) Shutdown

func (s *Server) Shutdown()

type Set

type Set interface {
	Query(prefix []byte) (*RangeInfo, error)
}

type SyncPair

type SyncPair struct {
	Local  LocalSet
	Remote RemoteSet
	// contains filtered or unexported fields
}

func (*SyncPair) Trigger

func (sp *SyncPair) Trigger(gen uint64, rootHash [32]byte)

type SyncResult

type SyncResult struct {
	Adds    uint
	Removes uint
}

Jump to

Keyboard shortcuts

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