blob: 05eea6e6b6886b6a5f7c2ae84eb21251d92eca64 [file] [log] [blame]
// Copyright 2018 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 authdb implements authdb service for goma httprpc.
package authdb
import (
pb ""
func Handler(s pb.AuthDBServiceServer, opts ...httprpc.HandlerOption) http.Handler {
return httprpc.Handler(
&pb.CheckMembershipReq{}, &pb.CheckMembershipResp{},
func(ctx context.Context, req proto.Message) (proto.Message, error) {
resp, err := s.CheckMembership(ctx, req.(*pb.CheckMembershipReq))
return resp, err
}, opts...)
func Register(mux *http.ServeMux, s pb.AuthDBServiceServer, opts ...httprpc.HandlerOption) {
mux.Handle("/authdb/checkMembership", Handler(s, opts...))