model

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 12 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 hands a folder of SysML v2 files to a SysML v2 service and opens the parsed model for reading through package sysml (DS-1, DS-2, DS-4). The tool does not parse: the Service parses the model, holds it, and answers the tool's reads.

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
	// API is the address of the SysML v2 service that parses the model and
	// answers the tool's reads (DS-1, DS-3): sysml-grpc, spelled as
	// opensysml.Dial takes it ("localhost:50051", "https://sysml.example.com").
	API 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 handed to the SysML service as the documents of one model.

func (Folder) Load

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

Load dials the service at API, checks it serves what the tool needs, sends every model file as one document of a ParseSources model (DS-2), and opens the result for reading (sysml.Open). The client stays open until Model.Close; the service keeps the model (DS-1): the tool holds the files' paths, the diagnostics, and nothing else of the model here.

type Model

type Model struct {
	// Files are the model files read, in the order they were sent to the
	// service.
	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 Service's warnings, and the model read through package sysml, whose methods it has. Close releases the client; the service keeps running.

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 Service parses; a Source speaks one service kind (DS-3). Today Folder reads a folder of files and speaks sysml-grpc; a SysML v2 REST service (Flexo) is a later Source.

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