Documentation
¶
Overview ¶
Package core serves parsing, validation diagnostics and symbol facts without protobuf, Connect or execution dependencies.
Index ¶
- type Core
- type F64
- type I64
- type JAttributeInfo
- type JDiagnostic
- type JDiagnosticsRequest
- type JDiagnosticsResponse
- type JGetSymbolRequest
- type JMultiplicityInfo
- type JParseFileRequest
- type JParseFileResponse
- type JParseSourcesRequest
- type JParseSourcesResponse
- type JRational
- type JSourceDocument
- type JSpecialization
- type JSymbolInfo
- type JSymbolResponse
- type JTypeInfo
- type JValue
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 NewWithLibrary ¶
NewWithLibrary builds a core server over a shared standard-library snapshot. A nonpositive maxModels disables automatic eviction.
func (*Core) Call ¶
Call runs a supported SysMLService method against params, the protojson-shaped request body, and returns the protojson-shaped response body.
type F64 ¶
type F64 float64
F64 is a protojson double, including protojson's non-finite spellings.
func (F64) MarshalJSON ¶
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 ¶
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.