qna

package
v0.24.4-1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	StartedScene    func(domains []string)
	EndedScene      func(domains []string)
	ChangedState    func(noun, aspect, oldState, newState string)
	ChangedRelative func(a, b, rel string)
}

Callbacks for important system level changes

type Options

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

uses its own cache to preserve values across domain changes

func NewOptions

func NewOptions() Options

func (Options) Option

func (m Options) Option(opt meta.Options) (ret g.Value, err error)

func (Options) OptionByName

func (m Options) OptionByName(name string) (ret g.Value, err error)

return an existing option.

func (*Options) SetOption

func (m *Options) SetOption(opt meta.Options, v g.Value) (err error)

func (*Options) SetOptionByName

func (m *Options) SetOptionByName(name string, v g.Value) (err error)

change an existing option.

type Randomizer

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

the nil value initialize itself

func (*Randomizer) Random

func (r *Randomizer) Random(inclusiveMin, exclusiveMax int) int

func (*Randomizer) Reset

func (r *Randomizer) Reset(seed int64)

type Runner

type Runner struct {
	Randomizer
	writer.Sink
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(w io.Writer, q query.Query, d decoder.Decoder) *Runner

func NewRuntimeOptions

func NewRuntimeOptions(w io.Writer, q query.Query, d decoder.Decoder, n Notifier, options Options) *Runner

func (*Runner) ActivateDomain

func (run *Runner) ActivateDomain(domain string) (err error)

func (*Runner) Call

func (run *Runner) Call(name string, aff affine.Affinity, keys []string, vals []g.Value) (ret g.Value, err error)

note: this is mirrored/mimicked in package testpat note: in order to generate appropriate defaults ( ex. a record of the right type ) can return both a both meaningful value *and* an error

func (*Runner) GetField

func (run *Runner) GetField(target, rawField string) (ret g.Value, err error)

func (*Runner) GetKindByName

func (run *Runner) GetKindByName(rawName string) (ret *g.Kind, err error)

func (*Runner) PluralOf

func (run *Runner) PluralOf(singular string) (ret string)

func (*Runner) PopScope

func (run *Runner) PopScope()

remove most recently pushed set of variables. ( implements rt.Runtime )

func (*Runner) PushScope

func (run *Runner) PushScope(top rt.Scope)

add the passed set of variables to the pool of current variables ( implements rt.Runtime )

func (*Runner) ReciprocalsOf

func (run *Runner) ReciprocalsOf(b, rel string) (ret g.Value, err error)

func (*Runner) RelateTo

func (run *Runner) RelateTo(a, b, rel string) (err error)

doesnt reformat the names.

func (*Runner) RelativesOf

func (run *Runner) RelativesOf(a, rel string) (ret g.Value, err error)

func (*Runner) SetField

func (run *Runner) SetField(target, rawField string, val g.Value) (err error)

func (*Runner) SingularOf

func (run *Runner) SingularOf(plural string) (ret string)

Directories

Path Synopsis
Package decode unpacks stored programs and values from byte slices
Package decode unpacks stored programs and values from byte slices
Package qdb asks specific questions of the play.db for the package qna runtime.
Package qdb asks specific questions of the play.db for the package qna runtime.

Jump to

Keyboard shortcuts

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