glyph

package
v0.0.0-...-dab88e5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoGlyphDir = errors.New("no glyph dir")
)

Functions

This section is empty.

Types

type Glyph

type Glyph struct {
	Log      *slog.Logger
	LogLevel *slog.LevelVar
	Path     string
	VM       *VM
	Repo     *git.Repository
	Cache    *cache.Cache
	Config   *store.Store
}

func Init

func Init() (*Glyph, error)

func (*Glyph) Eval

func (glyph *Glyph) Eval(code string) (string, error)

func (*Glyph) EvalFile

func (glyph *Glyph) EvalFile(file *os.File, args ...string) error

func (*Glyph) GetModules

func (glyph *Glyph) GetModules() ([]Module, error)

func (*Glyph) GetScripts

func (glyph *Glyph) GetScripts() ([]Script, error)

func (*Glyph) Repl

func (glyph *Glyph) Repl() error

type Logger

type Logger struct {
	Level *slog.LevelVar
	// contains filtered or unexported fields
}

Logger implements slog.Logger

func (Logger) Enabled

func (l Logger) Enabled(_ context.Context, level slog.Level) bool

func (Logger) Handle

func (l Logger) Handle(_ context.Context, record slog.Record) error

func (Logger) WithAttrs

func (l Logger) WithAttrs(attrs []slog.Attr) slog.Handler

func (Logger) WithGroup

func (l Logger) WithGroup(name string) slog.Handler

type Module

type Module struct {
	Name         string
	Description  string // TODO load description from .main.json?
	Path         string
	Branch       *git.Branch
	Head         *git.Reference
	Remote       *git.Remote
	RemoteBranch *git.Branch
}

func (*Module) Exec

func (module *Module) Exec(glyph *Glyph, args []string) error

type Script

type Script struct {
	Name        string
	Description string
	Modified    bool
}

func (*Script) Exec

func (script *Script) Exec(glyph *Glyph, args []string) error

type VM

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

func InitVM

func InitVM(glyph *Glyph) (*VM, error)

func (*VM) Eval

func (vm *VM) Eval(code string) (string, error)

func (*VM) Repl

func (vm *VM) Repl() error

type Wiki

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

func (*Wiki) EnsureDB

func (wiki *Wiki) EnsureDB() error

func (*Wiki) ParseFile

func (wiki *Wiki) ParseFile(filePath string) (WikiFile, error)

func (*Wiki) Search

func (wiki *Wiki) Search(query string) ([]string, error)

func (*Wiki) UpdateDB

func (wiki *Wiki) UpdateDB() error

type WikiFile

type WikiFile struct {
	Path     string
	Title    string
	Parsed   ast.Node
	Content  []byte
	Metadata interface{}
}

Jump to

Keyboard shortcuts

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