stdiorpc

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: 14 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 stdiorpc serves SysMLService over a pair of pipes rather than a socket. The header framing is the one cmd/sysml-lsp already speaks (Content-Length, then the body) and carries two body encodings: a JSON-RPC 2.0 envelope, and a raw protobuf body whose method and id travel in headers. It is an evaluation prototype; see docs/internals/design/transport-evaluation.md.

Index

Constants

View Source
const (
	ContentTypeJSON     = "application/json"
	ContentTypeProtobuf = "application/proto"
)

Content types a frame may carry. JSON wraps the message in a JSON-RPC envelope; protobuf carries the same wire bytes gRPC carries as the whole body, so the framing is not measured as if it were the encoding.

View Source
const (
	HeaderMethod  = "Sysml-Method"
	HeaderID      = "Sysml-Id"
	HeaderCode    = "Sysml-Status-Code"
	HeaderMessage = "Sysml-Status-Message"
)

Headers a protobuf frame uses in place of the JSON envelope's fields, and the header a failed protobuf call is answered under.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server answers calls read from one reader on one writer.

func NewServer

func NewServer(impl pb.SysMLServiceServer) *Server

NewServer builds a server dispatching to impl. The method table is read from the generated service descriptor, so every RPC of SysMLService is served and none can be forgotten when one is added.

func (*Server) Serve

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

Serve reads frames from r and writes answers to w until r reaches its end. Calls are handled concurrently and answered as they finish, so a slow call does not hold up the ones behind it; a client correlates answers by id.

Jump to

Keyboard shortcuts

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