base

package
v0.0.0-...-49f93d6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package base implements the basic set of smart tags supported by a smart record.

Index

Constants

This section is empty.

Variables

BaseGrammar is an assembler for the base vocabulary of smart tags supported by a record.

Functions

func TriggerReachable

func TriggerReachable(d *ir.Dict, h host.Host)

TriggerReachable triggers the execution of Reachable verifications over a dict and adds the appropiate flag to Nodes that don't pass the verification.

Types

type Reachable

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

Reachable is a smart node. It detects if the multiaddrs is connected or dialable.

func (Reachable) Disassemble

func (r Reachable) Disassemble() xr.Node

Reachable disassembles to reachable xr.Predicate of the form dialed(address=MULTIADDRESS:STRING) if dial checks connected(address=MULTIADDRESS:STRING) if connected checks. notConnected(address=MULTIADDRESS:STRING) if connected fails. notDialable(address=MULTIADDRESS:STRING) if dial fails.

func (*Reachable) Metadata

func (r *Reachable) Metadata() meta.MetadataInfo

func (*Reachable) UpdateWith

func (r *Reachable) UpdateWith(ctx ir.UpdateContext, with ir.Node) error

func (*Reachable) WritePretty

func (r *Reachable) WritePretty(w io.Writer) error

type ReachableAssembler

type ReachableAssembler struct{}

func (ReachableAssembler) Assemble

func (ReachableAssembler) Assemble(ctx ir.AssemblerContext, srcNode xr.Node, metadata ...meta.Metadata) (ir.Node, error)

Reachable assemble expects a predicate of the form: connectivity(address=MULTIADDRESS) or dialable(address=MULTIADDRESS) See Disassemble() for more info on the resulting predicates after check.

Jump to

Keyboard shortcuts

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