bacheca/endpoints.go
2019-07-16 18:03:16 +02:00

18 lines
396 B
Go

package bacheca
import (
"context"
proto "git.abbiamoundominio.org/hamcha/bacheca/proto"
"github.com/go-kit/kit/endpoint"
)
func getFeedEndpoint(svc Service) endpoint.Endpoint {
return func(ctx context.Context, request interface{}) (interface{}, error) {
req := request.(proto.GetFeedRequest)
rsp := proto.GetFeedResponse{}
err := svc.GetFeed(ctx, &req, &rsp)
return rsp, err
}
}