model

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package model loads a SysML v2 model from a folder of files: it parses them in-process as one model, reports the parser's diagnostics, and opens the result for reading through package sysml (DS-2, DS-4).

Index

Constants

This section is empty.

Variables

View Source
var ErrNoModelFiles = errors.New("no model files")

ErrNoModelFiles is returned when the model folder holds no model files (ER-3).

View Source
var ErrNoSuchElement = sysml.ErrNoSuchElement

ErrNoSuchElement is sysml.ErrNoSuchElement.

Functions

This section is empty.

Types

type DiagnosticsError

type DiagnosticsError struct {
	// Errors are the error diagnostics, each as "file:line:col: error: message".
	Errors []string
}

DiagnosticsError reports a model with errors (ER-2).

func (*DiagnosticsError) Error

func (e *DiagnosticsError) Error() string

type Folder

type Folder struct {
	Dir string
	// Logger receives debug records (stage durations); nil uses slog.Default.
	Logger *slog.Logger
}

Folder is a folder of *.sysml and *.kerml files, searched recursively and parsed in-process as one model.

func (Folder) Load

func (f Folder) Load(ctx context.Context) (*Model, error)

Load parses every model file under the folder as one model and opens it for reading (sysml.Open). The engine stays open until Model.Close.

type Model

type Model struct {
	// Files are the model files parsed, in the order given to the parser.
	Files []string
	// Warnings are the parser's diagnostics below error severity, each as
	// "file:line:col: severity: message".
	Warnings []string
	*sysml.Model
}

Model is a loaded model: the files it came from, the parser's warnings, and the model read through package sysml, whose methods it has. Close releases the engine.

type Props

type Props = sysml.Props

The read layer moved to package sysml; these names stay while callers move to it.

type Ref

type Ref = sysml.Ref

The read layer moved to package sysml; these names stay while callers move to it.

type Representation

type Representation = sysml.Representation

The read layer moved to package sysml; these names stay while callers move to it.

type Source

type Source interface {
	Load(ctx context.Context) (*Model, error)
}

Source is where a model comes from. The MVP reads a folder of files; a SysML v2 API service is a later Source (requirements DS-1, DS-3).

type Stats

type Stats = sysml.Stats

The read layer moved to package sysml; these names stay while callers move to it.

Jump to

Keyboard shortcuts

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