blob: 38a529c0c706a084f06994179a33949b6d47dbec [file] [log] [blame]
// Copyright 2017 The Goma Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package exec implements exec service for goma httprpc.
package exec
// TODO: go generate from proto?
import (
pb ""
execpb ""
// Handler returns exec service handler.
func Handler(s execpb.ExecServiceServer, opts ...httprpc.HandlerOption) http.Handler {
return httprpc.Handler(
&pb.ExecReq{}, &pb.ExecResp{},
func(ctx context.Context, req proto.Message) (proto.Message, error) {
resp, err := s.Exec(ctx, req.(*pb.ExecReq))
return resp, err
}, opts...)