linker

package module
v0.0.0-...-da2c65a Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 10 Imported by: 1

README

tail

Documentation

Index

Constants

View Source
const HEAD int64 = 0
View Source
const HeadKP = "H"
View Source
const HeadNodePre chain.Cid = "LING"
View Source
const TailKP = "T"

Variables

This section is empty.

Functions

func Append

func Append(link chain.Link) (*chain.Lead, *errors.Error)

func Care

func Care(link chain.CreationLink) (bool, *errors.Error)

func DB

func DB() *bolt.DB

func Genesis

func Genesis(link chain.CreationLink) *errors.Error

func InitIfNeeded

func InitIfNeeded(path string) *errors.Error

func InjectSeekerFactory

func InjectSeekerFactory(sf SeekerFactory)

func StoreGet

func StoreGet[T any](bucket *bolt.Bucket, key []byte) (*T, error)

func StorePut

func StorePut(bucket *bolt.Bucket, key []byte, obj interface{}) error

Types

type Line

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

func MustGetLine

func MustGetLine(vn chain.Cid, chainKey chain.Key) *Line

func (*Line) Append

func (line *Line) Append(link chain.Link) (*chain.Lead, *errors.Error)

func (*Line) Genesis

func (line *Line) Genesis(link chain.CreationLink) *errors.Error

func (*Line) Head

func (line *Line) Head() (*NodePack, *errors.Error)

func (*Line) Rectify

func (line *Line) Rectify() *errors.Error

func (*Line) Tail

func (line *Line) Tail() (*NodePack, *errors.Error)

type Node

type Node struct {
	VN    chain.Cid  `bson:"vn" json:"vn"`
	Scope chain.Cid  `bson:"scope" json:"scope"`
	Type  chain.Type `bson:"t" json:"t"`
	Block int64      `bson:"block" json:"block"`
	Data  chain.Cid  `bson:"data" json:"data"`
	Pre   chain.Cid  `bson:"pre" json:"pre"`
}

func HeadNode

func HeadNode(lead scope.Lead, dataCid chain.Cid) *Node

func (Node) GetScope

func (n Node) GetScope() chain.Cid

func (Node) GetType

func (n Node) GetType() chain.Type

func (Node) GetVn

func (n Node) GetVn() chain.Cid

func (Node) IsHead

func (n Node) IsHead() bool

type NodePack

type NodePack struct {
	Cid  chain.Cid `bson:"cid" json:"cid"`
	Node *Node     `bson:"node" json:"node"`
}

func NewNodePack

func NewNodePack(node *Node) (*NodePack, error)

func (NodePack) Next

func (pack NodePack) Next(dataCid chain.Cid) (*NodePack, error)

type Seeker

type Seeker interface {
	GetTail(lead *scope.Lead) (*NodePack, error)
}

type SeekerFactory

type SeekerFactory interface {
	Next() (Seeker, bool)
}

func GetSeekerFactory

func GetSeekerFactory() SeekerFactory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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