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 ¶
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.
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 ¶
var ErrPeerStalled = errors.New("stdiorpc: the peer stopped reading answers")
ErrPeerStalled is why Serve returns, without waiting for its calls, when the peer stopped reading its answers.
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.