directmsg

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Path Path
	ID   owldag.Ref

	Author    owldag.PeerID
	Timestamp tai64.TAI64N

	Type string
	Body json.RawMessage
}

type MessageParams

type MessageParams struct {
	Author    owldag.PeerID
	Timestamp tai64.TAI64N

	Type string
	Body json.RawMessage
}

type Operator

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

func New

func New() Operator

func (*Operator) Append

func (o *Operator) Append(ctx context.Context, s cadata.Store, x State, mp MessageParams) (*State, error)

func (*Operator) Merge

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

func (*Operator) NewEmpty

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

func (*Operator) Read

func (o *Operator) Read(ctx context.Context, s cadata.Store, x State, begin Path, buf []Message) (int, error)

func (*Operator) Sync

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

func (*Operator) Validate

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

func (*Operator) ValidateStep

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

type Path

type Path = cflog.Path

type Scheme

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

func NewScheme

func NewScheme(getPeers func(ctx context.Context) ([]owldag.PeerID, error)) *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) ([]owldag.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 = cflog.Root

Jump to

Keyboard shortcuts

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