coreexample

package
v0.0.0-...-eabde3b Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Answer = 42

Answer is the Answer to Life, the Universe and Everything.

View Source
const (
	// FlipFlopFuncName is the name this func is registered as.
	FlipFlopFuncName = "flipflop"
)
View Source
const (
	// ModuleName is the prefix given to all the functions in this module.
	ModuleName = "example"
)
View Source
const (
	// VUMeterFuncName is the name this function is registered as.
	VUMeterFuncName = "vumeter"
)

Variables

This section is empty.

Functions

func ErrorBool

func ErrorBool(ctx context.Context, input []types.Value) (types.Value, error)

ErrorBool causes this function to error if you pass it true. Otherwise it returns a string reminding you how to use it.

func Int2Str

func Int2Str(ctx context.Context, input []types.Value) (types.Value, error)

Int2Str takes an int, and returns it as a string.

func Plus

func Plus(ctx context.Context, input []types.Value) (types.Value, error)

Plus returns y + z.

func Str2Int

func Str2Int(ctx context.Context, input []types.Value) (types.Value, error)

Str2Int takes an str, and returns it as an int. If it can't convert it, it returns 0.

func TheAnswerToLifeTheUniverseAndEverything

func TheAnswerToLifeTheUniverseAndEverything(context.Context, []types.Value) (types.Value, error)

TheAnswerToLifeTheUniverseAndEverything returns the Answer to Life, the Universe and Everything.

Types

type FlipFlop

type FlipFlop struct {
	interfaces.Textarea
	// contains filtered or unexported fields
}

FlipFlop is a func which flips a bool repeatedly. This is an example func and is not meant for serious computing. This would be better served by a flip function which you could specify an interval for.

func (*FlipFlop) Call

func (obj *FlipFlop) Call(ctx context.Context, args []types.Value) (types.Value, error)

Call this func and return the value if it is possible to do so at this time.

func (*FlipFlop) Info

func (obj *FlipFlop) Info() *interfaces.Info

Info returns some static info about itself.

func (*FlipFlop) Init

func (obj *FlipFlop) Init(init *interfaces.Init) error

Init runs some startup code for this func.

func (*FlipFlop) Stream

func (obj *FlipFlop) Stream(ctx context.Context) error

Stream starts a mainloop and runs Event when it's time to Call() again.

func (*FlipFlop) String

func (obj *FlipFlop) String() string

String returns a simple name for this func. This is needed so this struct can satisfy the pgraph.Vertex interface.

func (*FlipFlop) Validate

func (obj *FlipFlop) Validate() error

Validate makes sure we've built our struct properly.

type VUMeterFunc

type VUMeterFunc struct {
	interfaces.Textarea
	// contains filtered or unexported fields
}

VUMeterFunc is a gimmic function to display a vu meter from the microphone.

func (*VUMeterFunc) ArgGen

func (obj *VUMeterFunc) ArgGen(index int) (string, error)

ArgGen returns the Nth arg name for this function.

func (*VUMeterFunc) Call

func (obj *VUMeterFunc) Call(ctx context.Context, args []types.Value) (types.Value, error)

Call this function with the input args and return the value if it is possible to do so at this time.

func (*VUMeterFunc) Info

func (obj *VUMeterFunc) Info() *interfaces.Info

Info returns some static info about itself.

func (*VUMeterFunc) Init

func (obj *VUMeterFunc) Init(init *interfaces.Init) error

Init runs some startup code for this function.

func (*VUMeterFunc) Stream

func (obj *VUMeterFunc) Stream(ctx context.Context) error

Stream returns the changing values that this func has over time.

func (*VUMeterFunc) String

func (obj *VUMeterFunc) String() string

String returns a simple name for this function. This is needed so this struct can satisfy the pgraph.Vertex interface.

func (*VUMeterFunc) Validate

func (obj *VUMeterFunc) Validate() error

Validate makes sure we've built our struct properly. It is usually unused for normal functions that users can use directly.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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