// NewServer creates a new server for handling gPRC services.
NewServer creates a new server for handling gPRC services.
// NewServer creates a new server for handling gPRC services .
func NewServer(service Service, opts ...Option) *Server {
	s := &Server{
		gracePeriod: 15 * time.Second,
		logger:      zap.NewNop(),
	}
	for _, opt := range opts {
		opt(s)
	}
	s.services = append(s.services, service)
	if len(s.services) == 0 {
		s.logger.Fatal("at least one service must be specified")
	}
	if err := s.init(); err != nil {
		s.logger.Fatal(err.Error())
	}
	return s
}
func NewServer ( service Service , opts ... Option ) * Server { s := & Server { gracePeriod : 15 * time . Second , logger : zap . NewNop ( ) , } for _ , opt := range opts { opt ( s ) } s . services = append ( s . services , service ) if len ( s . services ) == 0 { s . logger . Fatal ( " " ) } if err := s . init ( ) ; err != nil { s . logger . Fatal ( err . Error ( ) ) } return s }
NewServer creates a new server for handling gPRC services.
NewServer creates a new server for handling gPRC services .