mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-19 01:06:37 +00:00
added grpc verion and echo apis --------- Co-authored-by: Prashant Dwivedi <prashantdwivedi194@gmail.com>
22 lines
466 B
Go
22 lines
466 B
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
pb "github.com/stefanprodan/podinfo/pkg/api/grpc/version"
|
|
"github.com/stefanprodan/podinfo/pkg/version"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type VersionServer struct {
|
|
pb.UnimplementedVersionServiceServer
|
|
config *Config
|
|
logger *zap.Logger
|
|
|
|
}
|
|
|
|
func (s *VersionServer) Version(ctx context.Context, req *pb.VersionRequest) (*pb.VersionResponse, error) {
|
|
return &pb.VersionResponse{Version: version.VERSION, Commit: version.REVISION}, nil
|
|
}
|
|
|