contactset

package
v0.0.0-...-1704659 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Active []PeerID
	Info   json.RawMessage
}

type Operator

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

func New

func New() Operator

func (*Operator) AddPeers

func (o *Operator) AddPeers(ctx context.Context, s cadata.Store, x State, name string, ids []PeerID) (*State, error)

func (*Operator) Create

func (o *Operator) Create(ctx context.Context, s cadata.Store, x State, name string, ids []PeerID) (*State, error)

func (*Operator) Get

func (o *Operator) Get(ctx context.Context, s cadata.Store, x State, name string) (*Contact, error)

func (*Operator) ListNames

func (o *Operator) ListNames(ctx context.Context, s cadata.Store, x State) (ret []string, _ error)

func (*Operator) Lookup

func (o *Operator) Lookup(ctx context.Context, s cadata.Store, x State, name string) (ret *UID, _ error)

func (*Operator) Merge

func (o *Operator) Merge(ctx context.Context, s cadata.Store, xs []State) (*State, error)

func (*Operator) New

func (o *Operator) New(ctx context.Context, s cadata.Store) (*State, error)

func (*Operator) PutInfo

func (o *Operator) PutInfo(ctx context.Context, s cadata.Store, x State, name string, info json.RawMessage) (*State, error)

func (*Operator) RemovePeer

func (o *Operator) RemovePeer(ctx context.Context, s cadata.Store, x State, name string, peer PeerID) (*State, error)

func (*Operator) WhoIs

func (o *Operator) WhoIs(ctx context.Context, s cadata.Store, x State, peer PeerID) (string, error)

type PeerID

type PeerID = owldag.PeerID

type Scheme

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

func NewScheme

func NewScheme(peers []PeerID) *Scheme

func (*Scheme) CanRead

func (p *Scheme) CanRead(ctx context.Context, s cadata.Getter, x State, peer owldag.PeerID) (bool, error)

func (*Scheme) ListPeers

func (p *Scheme) ListPeers(ctx context.Context, s cadata.Getter, x State) ([]PeerID, error)

func (*Scheme) Merge

func (p *Scheme) Merge(ctx context.Context, s cadata.Store, xs []State) (*State, error)

func (*Scheme) Sync

func (p *Scheme) Sync(ctx context.Context, src cadata.Getter, dst cadata.Store, x State) error

func (*Scheme) Validate

func (p *Scheme) Validate(ctx context.Context, s cadata.Getter, consult owldag.ConsultFunc, x State) error

func (*Scheme) ValidateStep

func (p *Scheme) ValidateStep(ctx context.Context, s cadata.Getter, consult owldag.ConsultFunc, prev, next State) error

type State

type State = gotkv.Root

type UID

type UID [16]byte

UID uniquely identifies a contact.

func (UID) MarshalJSON

func (uid UID) MarshalJSON() ([]byte, error)

func (*UID) UnmarshalJSON

func (uid *UID) UnmarshalJSON(x []byte) error

Jump to

Keyboard shortcuts

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