codec

package
v0.0.0-...-4966005 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WeldLeft   = "←" // https://en.wikipedia.org/wiki/List_of_Unicode_characters#Arrows
	WeldRight  = "→"
	WeldAttach = "↑"
	WeldAnchor = "↓"
	Payload    = "Ⓟ" // https://en.wikipedia.org/wiki/Enclosed_Alphanumerics
	Action     = "Ⓐ"
	Signature  = "Ⓢ"
	Epoch      = "Ⓔ"
	Txt        = "⒯"
)

coding for IPLD link, labels, and any.Any dataURL

Variables

View Source
var NodeWithData = mdag.NodeWithData

reference mdag func

Functions

func NewUuid

func NewUuid() uuid.UUID

construct new UUID with single return

func ParseUuid

func ParseUuid(s string) uuid.UUID

load UUID from string with single return

Types

type EventTree

type EventTree struct {
	Msg     *ProtoNode
	Action  *ProtoNode
	Payload *ProtoNode
}

IPLD node implementation of an event

func (*EventTree) Node

func (t *EventTree) Node() (n *ProtoNode)

type LinkID

type LinkID = uuid.UUID

link between parent<-event nodes

func NewLinkID

func NewLinkID() LinkID

generate new LinkID

type ObjectID

type ObjectID = uuid.UUID

reference to an object or object-hierarchy Oid should not allow any inbound arcs

func NewObjectID

func NewObjectID() ObjectID

generate new ObjectID

type ProtoEvent

type ProtoEvent struct {
	Schema  Schema      `json:"schema"`
	Oid     ObjectID    `json:"oid"`
	Parent  LinkID      `json:"parent"`
	Event   LinkID      `json:"eventId"`
	Multi   uint64      `json:"multi"`
	Command Raw         `json:"-"`
	Payload Raw         `json:"-"`
	State   StateVector `json:"-"`
}

transitional datatype for converting between protobuf <-> IPLD Node

func (*ProtoEvent) EventTree

func (pe *ProtoEvent) EventTree() (sub *EventTree, err error)

convert Event to IPLD nodes

type ProtoEventFactory

type ProtoEventFactory interface {
	ProtoEvent() *ProtoEvent
}

type ProtoNode

type ProtoNode = mdag.ProtoNode

type Raw

type Raw = []byte

application specific data uses proto3 Any.any data

type Ref

type Ref struct {
	Cid   string `json:"cid"`
	Depth uint64 `json:"depth,omitempty"`
	Epoch uint64 `json:"epoch,omitempty"`
}

func (Ref) Node

func (a Ref) Node() *ProtoNode

func (*Ref) ToNode

func (a *Ref) ToNode() *ProtoNode

convert anchor to IPLD Node

type Schema

type Schema = string

type StateVector

type StateVector []uint64

persisted state

func (StateVector) ToVector

func (v StateVector) ToVector() Vector

allow conversion to []int64

type Vector

type Vector []int64

state transformation delta

func (Vector) ToStateVector

func (v Vector) ToStateVector() StateVector

allow conversion to []uint64

Jump to

Keyboard shortcuts

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