protoconnect

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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

Index

Constants

View Source
const (
	// SysMLServiceGetServerInfoProcedure is the fully-qualified name of the SysMLService's
	// GetServerInfo RPC.
	SysMLServiceGetServerInfoProcedure = "/sysml.SysMLService/GetServerInfo"
	// SysMLServiceParseFileProcedure is the fully-qualified name of the SysMLService's ParseFile RPC.
	SysMLServiceParseFileProcedure = "/sysml.SysMLService/ParseFile"
	// SysMLServiceParseSourcesProcedure is the fully-qualified name of the SysMLService's ParseSources
	// RPC.
	SysMLServiceParseSourcesProcedure = "/sysml.SysMLService/ParseSources"
	// SysMLServiceGetSymbolProcedure is the fully-qualified name of the SysMLService's GetSymbol RPC.
	SysMLServiceGetSymbolProcedure = "/sysml.SysMLService/GetSymbol"
	// SysMLServiceGetDiagnosticsProcedure is the fully-qualified name of the SysMLService's
	// GetDiagnostics RPC.
	SysMLServiceGetDiagnosticsProcedure = "/sysml.SysMLService/GetDiagnostics"
	// SysMLServiceEvaluateProcedure is the fully-qualified name of the SysMLService's Evaluate RPC.
	SysMLServiceEvaluateProcedure = "/sysml.SysMLService/Evaluate"
	// SysMLServiceInstantiateProcedure is the fully-qualified name of the SysMLService's Instantiate
	// RPC.
	SysMLServiceInstantiateProcedure = "/sysml.SysMLService/Instantiate"
	// SysMLServiceExecuteActionProcedure is the fully-qualified name of the SysMLService's
	// ExecuteAction RPC.
	SysMLServiceExecuteActionProcedure = "/sysml.SysMLService/ExecuteAction"
	// SysMLServiceExecuteStateProcedure is the fully-qualified name of the SysMLService's ExecuteState
	// RPC.
	SysMLServiceExecuteStateProcedure = "/sysml.SysMLService/ExecuteState"
	// SysMLServiceConvertProcedure is the fully-qualified name of the SysMLService's Convert RPC.
	SysMLServiceConvertProcedure = "/sysml.SysMLService/Convert"
	// SysMLServiceApplyEditsProcedure is the fully-qualified name of the SysMLService's ApplyEdits RPC.
	SysMLServiceApplyEditsProcedure = "/sysml.SysMLService/ApplyEdits"
	// SysMLServiceVerifyConstraintProcedure is the fully-qualified name of the SysMLService's
	// VerifyConstraint RPC.
	SysMLServiceVerifyConstraintProcedure = "/sysml.SysMLService/VerifyConstraint"
	// SysMLServiceVerifyRequirementProcedure is the fully-qualified name of the SysMLService's
	// VerifyRequirement RPC.
	SysMLServiceVerifyRequirementProcedure = "/sysml.SysMLService/VerifyRequirement"
	// SysMLServiceVerifySatisfactionProcedure is the fully-qualified name of the SysMLService's
	// VerifySatisfaction RPC.
	SysMLServiceVerifySatisfactionProcedure = "/sysml.SysMLService/VerifySatisfaction"
	// SysMLServiceEvaluateCalcProcedure is the fully-qualified name of the SysMLService's EvaluateCalc
	// RPC.
	SysMLServiceEvaluateCalcProcedure = "/sysml.SysMLService/EvaluateCalc"
	// SysMLServiceRunAnalysisProcedure is the fully-qualified name of the SysMLService's RunAnalysis
	// RPC.
	SysMLServiceRunAnalysisProcedure = "/sysml.SysMLService/RunAnalysis"
	// SysMLServiceQueryProcedure is the fully-qualified name of the SysMLService's Query RPC.
	SysMLServiceQueryProcedure = "/sysml.SysMLService/Query"
	// SysMLServiceRunDocumentQueryProcedure is the fully-qualified name of the SysMLService's
	// RunDocumentQuery RPC.
	SysMLServiceRunDocumentQueryProcedure = "/sysml.SysMLService/RunDocumentQuery"
	// SysMLServiceRenderDocumentProcedure is the fully-qualified name of the SysMLService's
	// RenderDocument RPC.
	SysMLServiceRenderDocumentProcedure = "/sysml.SysMLService/RenderDocument"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// SysMLServiceName is the fully-qualified name of the SysMLService service.
	SysMLServiceName = "sysml.SysMLService"
)

Variables

This section is empty.

Functions

func NewSysMLServiceHandler

func NewSysMLServiceHandler(svc SysMLServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewSysMLServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type SysMLServiceClient

type SysMLServiceClient interface {
	// Report what this build of the service can do, so a client can require a
	// capability instead of guessing from a version string. A service that
	// predates this RPC answers UNIMPLEMENTED, which is itself the answer.
	GetServerInfo(context.Context, *connect.Request[proto.ServerInfoRequest]) (*connect.Response[proto.ServerInfoResponse], error)
	// Parse a SysML file and return model hash for subsequent queries
	ParseFile(context.Context, *connect.Request[proto.ParseFileRequest]) (*connect.Response[proto.ParseFileResponse], error)
	// Parse several documents as one model, so a name one document declares
	// resolves in another and an import between them is satisfied. Reported as
	// the "parse_sources" capability.
	ParseSources(context.Context, *connect.Request[proto.ParseSourcesRequest]) (*connect.Response[proto.ParseSourcesResponse], error)
	// Get symbol information by qualified name
	GetSymbol(context.Context, *connect.Request[proto.GetSymbolRequest]) (*connect.Response[proto.SymbolResponse], error)
	// Get all diagnostics for a parsed model
	GetDiagnostics(context.Context, *connect.Request[proto.DiagnosticsRequest]) (*connect.Response[proto.DiagnosticsResponse], error)
	// Runtime operations (Phase 4)
	Evaluate(context.Context, *connect.Request[proto.EvaluateRequest]) (*connect.Response[proto.EvaluateResponse], error)
	Instantiate(context.Context, *connect.Request[proto.InstantiateRequest]) (*connect.Response[proto.InstantiateResponse], error)
	ExecuteAction(context.Context, *connect.Request[proto.ExecuteActionRequest]) (*connect.Response[proto.ExecuteActionResponse], error)
	ExecuteState(context.Context, *connect.Request[proto.ExecuteStateRequest]) (*connect.Response[proto.ExecuteStateResponse], error)
	// Convert a model between the representations OpenSysML writes — SysML
	// textual notation and RDF Turtle — so a client can write a model back out
	// rather than only read it. Reported as the "convert" capability.
	Convert(context.Context, *connect.Request[proto.ConvertRequest]) (*connect.Response[proto.ConvertResponse], error)
	// Apply edits to a parsed model's own source and return the edited notation,
	// so a client can change a model and write it back with its comments and
	// layout intact. Edits are byte ranges the service locates from the parsed
	// spans, and the result is re-parsed and validated before it is returned.
	// Reported as the "apply_edits" capability.
	ApplyEdits(context.Context, *connect.Request[proto.ApplyEditsRequest]) (*connect.Response[proto.ApplyEditsResponse], error)
	// Verification: the answers the REPL's %constraint, %requirement, %satisfy,
	// %calc and %analysis give, so "does this model satisfy its requirements?"
	// can be asked by a script. Each evaluates the same runtime paths the prompt
	// does and returns a verdict rather than formatted lines. Reported as the
	// "verification" capability.
	VerifyConstraint(context.Context, *connect.Request[proto.VerifyConstraintRequest]) (*connect.Response[proto.VerifyConstraintResponse], error)
	VerifyRequirement(context.Context, *connect.Request[proto.VerifyRequirementRequest]) (*connect.Response[proto.VerifyRequirementResponse], error)
	VerifySatisfaction(context.Context, *connect.Request[proto.VerifySatisfactionRequest]) (*connect.Response[proto.VerifySatisfactionResponse], error)
	EvaluateCalc(context.Context, *connect.Request[proto.EvaluateCalcRequest]) (*connect.Response[proto.EvaluateCalcResponse], error)
	RunAnalysis(context.Context, *connect.Request[proto.RunAnalysisRequest]) (*connect.Response[proto.RunAnalysisResponse], error)
	// Run a SysML v2 API & Services Query over a parsed model: scope/select/where
	// as the standard defines them, so a client that speaks that API can filter a
	// model here. Reported as the "query" capability.
	Query(context.Context, *connect.Request[proto.QueryRequest]) (*connect.Response[proto.QueryResponse], error)
	// Run a named document query with parameter bindings, the answer the REPL's
	// %run-query gives, as typed rows rather than formatted lines. Reported as
	// the "document_query" capability.
	RunDocumentQuery(context.Context, *connect.Request[proto.RunDocumentQueryRequest]) (*connect.Response[proto.RunDocumentQueryResponse], error)
	// Render a named document to Markdown, as the CLI's -render-document does.
	// Reported as the "render_document" capability.
	RenderDocument(context.Context, *connect.Request[proto.RenderDocumentRequest]) (*connect.Response[proto.RenderDocumentResponse], error)
}

SysMLServiceClient is a client for the sysml.SysMLService service.

func NewSysMLServiceClient

func NewSysMLServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SysMLServiceClient

NewSysMLServiceClient constructs a client for the sysml.SysMLService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type SysMLServiceHandler

type SysMLServiceHandler interface {
	// Report what this build of the service can do, so a client can require a
	// capability instead of guessing from a version string. A service that
	// predates this RPC answers UNIMPLEMENTED, which is itself the answer.
	GetServerInfo(context.Context, *connect.Request[proto.ServerInfoRequest]) (*connect.Response[proto.ServerInfoResponse], error)
	// Parse a SysML file and return model hash for subsequent queries
	ParseFile(context.Context, *connect.Request[proto.ParseFileRequest]) (*connect.Response[proto.ParseFileResponse], error)
	// Parse several documents as one model, so a name one document declares
	// resolves in another and an import between them is satisfied. Reported as
	// the "parse_sources" capability.
	ParseSources(context.Context, *connect.Request[proto.ParseSourcesRequest]) (*connect.Response[proto.ParseSourcesResponse], error)
	// Get symbol information by qualified name
	GetSymbol(context.Context, *connect.Request[proto.GetSymbolRequest]) (*connect.Response[proto.SymbolResponse], error)
	// Get all diagnostics for a parsed model
	GetDiagnostics(context.Context, *connect.Request[proto.DiagnosticsRequest]) (*connect.Response[proto.DiagnosticsResponse], error)
	// Runtime operations (Phase 4)
	Evaluate(context.Context, *connect.Request[proto.EvaluateRequest]) (*connect.Response[proto.EvaluateResponse], error)
	Instantiate(context.Context, *connect.Request[proto.InstantiateRequest]) (*connect.Response[proto.InstantiateResponse], error)
	ExecuteAction(context.Context, *connect.Request[proto.ExecuteActionRequest]) (*connect.Response[proto.ExecuteActionResponse], error)
	ExecuteState(context.Context, *connect.Request[proto.ExecuteStateRequest]) (*connect.Response[proto.ExecuteStateResponse], error)
	// Convert a model between the representations OpenSysML writes — SysML
	// textual notation and RDF Turtle — so a client can write a model back out
	// rather than only read it. Reported as the "convert" capability.
	Convert(context.Context, *connect.Request[proto.ConvertRequest]) (*connect.Response[proto.ConvertResponse], error)
	// Apply edits to a parsed model's own source and return the edited notation,
	// so a client can change a model and write it back with its comments and
	// layout intact. Edits are byte ranges the service locates from the parsed
	// spans, and the result is re-parsed and validated before it is returned.
	// Reported as the "apply_edits" capability.
	ApplyEdits(context.Context, *connect.Request[proto.ApplyEditsRequest]) (*connect.Response[proto.ApplyEditsResponse], error)
	// Verification: the answers the REPL's %constraint, %requirement, %satisfy,
	// %calc and %analysis give, so "does this model satisfy its requirements?"
	// can be asked by a script. Each evaluates the same runtime paths the prompt
	// does and returns a verdict rather than formatted lines. Reported as the
	// "verification" capability.
	VerifyConstraint(context.Context, *connect.Request[proto.VerifyConstraintRequest]) (*connect.Response[proto.VerifyConstraintResponse], error)
	VerifyRequirement(context.Context, *connect.Request[proto.VerifyRequirementRequest]) (*connect.Response[proto.VerifyRequirementResponse], error)
	VerifySatisfaction(context.Context, *connect.Request[proto.VerifySatisfactionRequest]) (*connect.Response[proto.VerifySatisfactionResponse], error)
	EvaluateCalc(context.Context, *connect.Request[proto.EvaluateCalcRequest]) (*connect.Response[proto.EvaluateCalcResponse], error)
	RunAnalysis(context.Context, *connect.Request[proto.RunAnalysisRequest]) (*connect.Response[proto.RunAnalysisResponse], error)
	// Run a SysML v2 API & Services Query over a parsed model: scope/select/where
	// as the standard defines them, so a client that speaks that API can filter a
	// model here. Reported as the "query" capability.
	Query(context.Context, *connect.Request[proto.QueryRequest]) (*connect.Response[proto.QueryResponse], error)
	// Run a named document query with parameter bindings, the answer the REPL's
	// %run-query gives, as typed rows rather than formatted lines. Reported as
	// the "document_query" capability.
	RunDocumentQuery(context.Context, *connect.Request[proto.RunDocumentQueryRequest]) (*connect.Response[proto.RunDocumentQueryResponse], error)
	// Render a named document to Markdown, as the CLI's -render-document does.
	// Reported as the "render_document" capability.
	RenderDocument(context.Context, *connect.Request[proto.RenderDocumentRequest]) (*connect.Response[proto.RenderDocumentResponse], error)
}

SysMLServiceHandler is an implementation of the sysml.SysMLService service.

type UnimplementedSysMLServiceHandler

type UnimplementedSysMLServiceHandler struct{}

UnimplementedSysMLServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedSysMLServiceHandler) ParseSources added in v0.4.2

func (UnimplementedSysMLServiceHandler) RenderDocument added in v0.4.2

func (UnimplementedSysMLServiceHandler) RunAnalysis added in v0.6.0

func (UnimplementedSysMLServiceHandler) RunDocumentQuery added in v0.4.2

Jump to

Keyboard shortcuts

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