github.com/nya3jp/tast@v0.0.0-20230601000426-85c8e4d83a9b/src/go.chromium.org/tast/core/internal/runner/rpc.go (about)

     1  // Copyright 2021 The ChromiumOS Authors
     2  // Use of this source code is governed by a BSD-style license that can be
     3  // found in the LICENSE file.
     4  
     5  package runner
     6  
     7  import (
     8  	"io"
     9  
    10  	"google.golang.org/grpc"
    11  
    12  	"go.chromium.org/tast/core/internal/protocol"
    13  	"go.chromium.org/tast/core/internal/rpc"
    14  )
    15  
    16  // runRPCServer runs a runner RPC server.
    17  func runRPCServer(scfg *StaticConfig, r io.Reader, w io.Writer) error {
    18  	return rpc.RunServer(r, w, nil, func(srv *grpc.Server, req *protocol.HandshakeRequest) error {
    19  		protocol.RegisterTestServiceServer(srv, newTestServer(scfg,
    20  			req.GetRunnerInitParams(), req.GetBundleInitParams()))
    21  		return nil
    22  	})
    23  }