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 ¶
var ErrNoModelFiles = errors.New("no model files")
ErrNoModelFiles is returned when the model folder holds no model files (ER-3).
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 ¶
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 Representation ¶
type Representation = sysml.Representation
The read layer moved to package sysml; these names stay while callers move to it.