weaver

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Conflict = mdl.Conflict

when the definition would contradict existing information: the returned error wraps this tag. errors.Is can be used to detect it.

View Source
const Duplicate = mdl.Duplicate

when the definition would repeat existing information: the returned error wraps this tag. errors.Is can be used to detect it.

View Source
const Missing = mdl.Missing

when the definition can't find some required information: the returned error wraps this tag. errors.Is can be used to detect it.

Variables

This section is empty.

Functions

This section is empty.

Types

type PanicWeaves

type PanicWeaves struct{}

func (*PanicWeaves) AddAspectTraits

func (p *PanicWeaves) AddAspectTraits(aspect string, traits []string) error

AddAspectTraits implements Weaves.

func (*PanicWeaves) AddCheck

func (p *PanicWeaves) AddCheck(name string, value literal.LiteralValue, prog []rt.Execute) error

AddCheck implements Weaves.

func (*PanicWeaves) AddFact

func (p *PanicWeaves) AddFact(key string, partsAndValue ...string) error

AddFact implements Weaves.

func (*PanicWeaves) AddGrammar

func (p *PanicWeaves) AddGrammar(name string, prog *grammar.Directive) error

AddGrammar implements Weaves.

func (*PanicWeaves) AddKind

func (p *PanicWeaves) AddKind(kind string, ancestor string) error

AddKind implements Weaves.

func (*PanicWeaves) AddKindFields

func (p *PanicWeaves) AddKindFields(kind string, fields []mdl.FieldInfo) error

AddKindFields implements Weaves.

func (*PanicWeaves) AddKindTrait

func (p *PanicWeaves) AddKindTrait(kind string, trait string) error

AddKindTrait implements Weaves.

func (*PanicWeaves) AddNounKind

func (p *PanicWeaves) AddNounKind(noun string, kind string) error

AddNounKind implements Weaves.

func (*PanicWeaves) AddNounName

func (p *PanicWeaves) AddNounName(noun string, name string, rank int) error

AddNounName implements Weaves.

func (*PanicWeaves) AddNounPair

func (p *PanicWeaves) AddNounPair(rel string, noun string, otherNoun string) error

AddNounPair implements Weaves.

func (*PanicWeaves) AddNounPath

func (p *PanicWeaves) AddNounPath(noun string, path []string, val literal.LiteralValue) error

AddNounPath implements Weaves.

func (*PanicWeaves) AddNounTrait

func (p *PanicWeaves) AddNounTrait(noun string, trait string) error

AddNounTrait implements Weaves.

func (*PanicWeaves) AddNounValue

func (p *PanicWeaves) AddNounValue(noun string, prop string, val rt.Assignment) error

AddNounValue implements Weaves.

func (*PanicWeaves) AddPattern

func (p *PanicWeaves) AddPattern(mdl.Pattern) error

AddPattern implements Weaves.

func (*PanicWeaves) AddPlural

func (p *PanicWeaves) AddPlural(many string, one string) error

AddPlural implements Weaves.

func (*PanicWeaves) AddRelation

func (p *PanicWeaves) AddRelation(name string, oneKind string, otherKind string, amany bool, bmany bool) error

AddRelation implements Weaves.

func (*PanicWeaves) ExtendPattern

func (p *PanicWeaves) ExtendPattern(mdl.Pattern) error

ExtendPattern implements Weaves.

func (*PanicWeaves) GenerateUniqueName

func (p *PanicWeaves) GenerateUniqueName(category string) string

GenerateUniqueName implements Weaves.

type Phase

type Phase int

Partitions the weave into stages; not entirely clear how much this is needed since missing resources retry helps with domain dependencies, plurals, and some amount of resource sorting

const (
	// the zeroth phase is never explicitly scheduled.
	LanguagePhase   Phase = iota + 1 // definitions of words
	AncestryPhase                    // kinds and their derivation
	PropertyPhase                    // the members of kinds ( after ancestry because fields depend on kind )
	NounPhase                        // generate explicit nouns
	VerbPhase                        // apply existing verbs
	ConnectionPhase                  // pairings and map connections
	FallbackPhase                    // generate kinds for nouns that didn't derive during connections
	ValuePhase                       // apply any collected values
	NextPhase                        // any sub domains
	NumPhases
)

func (Phase) String

func (i Phase) String() string

type Weaves

type Weaves interface {
	// set the possible traits of an aspect
	AddAspectTraits(aspect string, traits []string) error
	AddCheck(name string, value literal.LiteralValue, prog []rt.Execute) error
	AddFact(key string, partsAndValue ...string) error
	AddGrammar(name string, prog *grammar.Directive) error
	AddKind(kind, ancestor string) error
	AddKindFields(kind string, fields []mdl.FieldInfo) error
	// apply a default trait to a kind
	AddKindTrait(kind, trait string) error
	AddNounKind(noun, kind string) error
	AddNounName(noun, name string, rank int) error
	AddNounPair(rel, noun, otherNoun string) error
	AddNounPath(noun string, path []string, val literal.LiteralValue) error
	AddNounTrait(noun, trait string) error
	AddNounValue(noun, prop string, val rt.Assignment) error
	AddPattern(mdl.Pattern) error
	AddPlural(many, one string) error
	AddRelation(name, oneKind, otherKind string, amany bool, bmany bool) error
	ExtendPattern(mdl.Pattern) error
	// generates a unique name with a passed category
	GenerateUniqueName(category string) string
}

Jump to

Keyboard shortcuts

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