Documentation ¶
Overview ¶
Package base implements the basic set of smart tags supported by a smart record.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BaseGrammar = ir.SequenceAssembler{ ReachableAssembler{}, ir.SyntacticGrammar, }
BaseGrammar is an assembler for the base vocabulary of smart tags supported by a record.
Functions ¶
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 ¶
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 ¶
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.