core

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 22 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 core serves parsing, validation diagnostics and symbol facts without protobuf, Connect or execution dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

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

Core serves the validation RPCs sequentially and is not safe for concurrent use.

func New

func New() (*Core, error)

New builds a core server over the frozen standard-library snapshot.

func NewWithLibrary

func NewWithLibrary(index *symbols.Index, library libs.Source, maxModels int) (*Core, error)

NewWithLibrary builds a core server over a shared standard-library snapshot. A nonpositive maxModels disables automatic eviction.

func (*Core) Call

func (c *Core) Call(ctx context.Context, method string, params []byte) (result []byte, err error)

Call runs a supported SysMLService method against params, the protojson-shaped request body, and returns the protojson-shaped response body.

func (*Core) Evict

func (c *Core) Evict(hash string)

Evict removes a cached model; absent hashes are ignored.

func (*Core) Serve

func (c *Core) Serve(ctx context.Context, r io.Reader, w io.Writer) error

Serve answers Content-Length-delimited JSON-RPC frames until r reaches its end.

type F64

type F64 float64

F64 is a protojson double, including protojson's non-finite spellings.

func (F64) MarshalJSON

func (v F64) MarshalJSON() ([]byte, error)

MarshalJSON writes a number, or protojson's string for a non-finite value.

type I64

type I64 int64

I64 is an int64 encoded as the protojson decimal string.

func (I64) MarshalJSON

func (v I64) MarshalJSON() ([]byte, error)

MarshalJSON writes the decimal string protojson writes for an int64.

type JAttributeInfo

type JAttributeInfo struct {
	Name  string  `json:"name,omitempty"`
	Type  string  `json:"type,omitempty"`
	Value *JValue `json:"value,omitempty"`
	Unit  string  `json:"unit,omitempty"`
}

JAttributeInfo is the protojson-shaped attribute facts message.

type JDiagnostic

type JDiagnostic = fsyntax.Diagnostic

JDiagnostic is the Diagnostic message shared with the syntax frontend.

type JDiagnosticsRequest

type JDiagnosticsRequest struct {
	ModelHash string `json:"modelHash,omitempty"`
}

JDiagnosticsRequest is the protojson-shaped GetDiagnostics request.

type JDiagnosticsResponse

type JDiagnosticsResponse struct {
	Diagnostics []*JDiagnostic `json:"diagnostics,omitempty"`
	Error       string         `json:"error,omitempty"`
}

JDiagnosticsResponse is the protojson-shaped GetDiagnostics response.

type JGetSymbolRequest

type JGetSymbolRequest struct {
	ModelHash string `json:"modelHash,omitempty"`
	SymbolId  string `json:"symbolId,omitempty"`
}

JGetSymbolRequest is the protojson-shaped GetSymbol request.

type JMultiplicityInfo

type JMultiplicityInfo struct {
	Lower string `json:"lower,omitempty"`
	Upper string `json:"upper,omitempty"`
}

JMultiplicityInfo contains protojson-shaped lower and upper bounds.

type JParseFileRequest

type JParseFileRequest struct {
	FilePath          *string `json:"filePath,omitempty"`
	Content           *string `json:"content,omitempty"`
	ContentHash       string  `json:"contentHash,omitempty"`
	Language          string  `json:"language,omitempty"`
	StrictConformance bool    `json:"strictConformance,omitempty"`
}

JParseFileRequest is the protojson-shaped ParseFile request.

func (*JParseFileRequest) UnmarshalJSON

func (r *JParseFileRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON rejects a ParseFile request naming both source arms.

type JParseFileResponse

type JParseFileResponse struct {
	ModelHash   string         `json:"modelHash,omitempty"`
	Root        *JSymbolInfo   `json:"root,omitempty"`
	Diagnostics []*JDiagnostic `json:"diagnostics,omitempty"`
	Error       string         `json:"error,omitempty"`
}

JParseFileResponse is the protojson-shaped ParseFile response.

type JParseSourcesRequest

type JParseSourcesRequest struct {
	Documents         []*JSourceDocument `json:"documents,omitempty"`
	StrictConformance bool               `json:"strictConformance,omitempty"`
}

JParseSourcesRequest is the protojson-shaped ParseSources request.

type JParseSourcesResponse

type JParseSourcesResponse struct {
	ModelHash   string         `json:"modelHash,omitempty"`
	Roots       []*JSymbolInfo `json:"roots,omitempty"`
	Diagnostics []*JDiagnostic `json:"diagnostics,omitempty"`
	Error       string         `json:"error,omitempty"`
}

JParseSourcesResponse is the protojson-shaped ParseSources response.

type JRational

type JRational struct {
	Numerator   string `json:"numerator,omitempty"`
	Denominator string `json:"denominator,omitempty"`
}

JRational is an exact Rational in lowest terms, its denominator positive.

type JSourceDocument

type JSourceDocument struct {
	FilePath *string `json:"filePath,omitempty"`
	Content  *string `json:"content,omitempty"`
	Language string  `json:"language,omitempty"`
	Name     string  `json:"name,omitempty"`
}

JSourceDocument is one document of a ParseSources request.

func (*JSourceDocument) UnmarshalJSON

func (d *JSourceDocument) UnmarshalJSON(data []byte) error

UnmarshalJSON rejects a document naming both source arms.

type JSpecialization

type JSpecialization struct {
	Kind       string `json:"kind,omitempty"`
	Declared   string `json:"declared,omitempty"`
	TargetId   string `json:"targetId,omitempty"`
	TargetKind string `json:"targetKind,omitempty"`
}

JSpecialization is one protojson-shaped generalization relationship.

type JSymbolInfo

type JSymbolInfo struct {
	Id                        string             `json:"id,omitempty"`
	Name                      string             `json:"name,omitempty"`
	Kind                      string             `json:"kind,omitempty"`
	Metadata                  map[string]string  `json:"metadata,omitempty"`
	ChildIds                  []string           `json:"childIds,omitempty"`
	Attributes                []*JAttributeInfo  `json:"attributes,omitempty"`
	TypeInfo                  *JTypeInfo         `json:"typeInfo,omitempty"`
	Multiplicity              *JMultiplicityInfo `json:"multiplicity,omitempty"`
	Specializations           []*JSpecialization `json:"specializations,omitempty"`
	WithheldLibraryAttributes int32              `json:"withheldLibraryAttributes,omitempty"`
}

JSymbolInfo is the protojson-shaped symbol facts message.

type JSymbolResponse

type JSymbolResponse struct {
	Symbol *JSymbolInfo `json:"symbol,omitempty"`
	Error  string       `json:"error,omitempty"`
}

JSymbolResponse is the protojson-shaped GetSymbol response.

type JTypeInfo

type JTypeInfo struct {
	Declared        string `json:"declared,omitempty"`
	ResolvedId      string `json:"resolvedId,omitempty"`
	ResolvedKind    string `json:"resolvedKind,omitempty"`
	Primitive       string `json:"primitive,omitempty"`
	PrimitiveSource string `json:"primitiveSource,omitempty"`
	Quantity        bool   `json:"quantity,omitempty"`
	Unit            string `json:"unit,omitempty"`
}

JTypeInfo is the protojson-shaped static type message.

type JValue

type JValue struct {
	IntValue    *I64    `json:"intValue,omitempty"`
	RealValue   *F64    `json:"realValue,omitempty"`
	BoolValue   *bool   `json:"boolValue,omitempty"`
	StringValue *string `json:"stringValue,omitempty"`
	Null        *string `json:"null,omitempty"`
	Infinity    *bool   `json:"infinity,omitempty"`
	// RationalValue is an exact Rational binary64 does not hold exactly.
	RationalValue *JRational `json:"rationalValue,omitempty"`
}

JValue holds the constant attribute value arms the core can derive.

Jump to

Keyboard shortcuts

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