mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-05-21 17:02:46 +00:00
added grpc verion and echo apis --------- Co-authored-by: Prashant Dwivedi <prashantdwivedi194@gmail.com>
25 lines
423 B
Go
25 lines
423 B
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
// "log"
|
|
"os"
|
|
|
|
pb "github.com/stefanprodan/podinfo/pkg/api/grpc/panic"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type PanicServer struct {
|
|
pb.UnimplementedPanicServiceServer
|
|
config *Config
|
|
logger *zap.Logger
|
|
|
|
}
|
|
|
|
func (s *PanicServer) Panic(ctx context.Context, req *pb.PanicRequest) (*pb.PanicResponse, error) {
|
|
s.logger.Info("Panic command received")
|
|
os.Exit(225)
|
|
return &pb.PanicResponse{}, nil
|
|
}
|
|
|