mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-14 10:19:52 +00:00
23 lines
421 B
Go
23 lines
421 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
|
|
}
|