// NewServer returns a server that can serve thrift services over TChannel. func NewServer(registrar tchannel.Registrar) *Server { healthHandler := newHealthHandler() server := &Server{ ch: registrar, log: registrar.Logger(), handlers: make(map[string]handler), healthHandler: healthHandler, } server.Register(newTChanMetaServer(healthHandler)) return server }
// NewServer returns a server that can serve thrift services over TChannel. func NewServer(registrar tchannel.Registrar) *Server { metaHandler := newMetaHandler() server := &Server{ ch: registrar, log: registrar.Logger(), handlers: make(map[string]handler), metaHandler: metaHandler, } server.Register(newTChanMetaServer(metaHandler)) if ch, ok := registrar.(*tchannel.Channel); ok { // Register the meta endpoints on the "tchannel" service name. NewServer(ch.GetSubChannel("tchannel")) } return server }