// MockStartServer mocks the StartServer function
497490
func (m *testRPC) MockStartServer(t *testing.T, impl func(ctx context.Context, protocol string, path string, handler interface{}) error) {
	m.currentMocks(t).StartServerMock = impl

}
1341453
func StartServer(s *grpc.Server, ts *topo.Server) {
	vtctlservicepb.RegisterVtctlServer(s, NewVtctlServer(ts))
}
938289
func (mr *MockServerManagerMockRecorder) Start(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockServerManager)(nil).Start), arg0, arg1, arg2, arg3)
}
640704
func InitServer() {
	CurrentEngine.Init(ServerEngineInit)
	initControllerStack()
	startupHooks.Run()

	// Load templates
	MainTemplateLoader = NewTemplateLoader(TemplatePaths)
	if err := MainTemplateLoader.Refresh(); err != nil {
		serverLogger.Debug("InitServer: Main template loader failed to refresh", "error", err)
	}

	// The "watch" config variable can turn on and off all watching.
	// (As a convenient way to control it all together.)
	if Config.BoolDefault("watch", true) {
		MainWatcher = NewWatcher()
		Filters = append([]Filter{WatchFilter}, Filters...)
	}

	// If desired (or by default), create a watcher for templates and routes.
	// The watcher calls Refresh() on things on the first request.
	if MainWatcher != nil && Config.BoolDefault("watch.templates", true) {
		MainWatcher.Listen(MainTemplateLoader, MainTemplateLoader.paths...)
	}

}
1320748
func (e environ) StartInstance(ctx context.ProviderCallContext, args environs.StartInstanceParams) (*environs.StartInstanceResult, error) {
	osString, err := series.GetOSFromSeries(args.Tools.OneSeries())
	if err != nil {
		return nil, errors.Trace(err)
	}
	fwmode := e.Config().FirewallMode()
	if osString == jujuos.Windows && fwmode != config.FwNone {
		return nil, errors.Errorf("rackspace provider doesn't support firewalls for windows instances")

	}
	r, err := e.Environ.StartInstance(ctx, args)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if fwmode != config.FwNone {
		interrupted := make(chan os.Signal, 1)
		timeout := environs.BootstrapDialOpts{
			Timeout:        time.Minute * 5,
			RetryDelay:     time.Second * 5,
			AddressesDelay: time.Second * 20,
		}
		addr, err := waitSSH(
			ioutil.Discard,
			interrupted,
			ssh.DefaultClient,
			common.GetCheckNonceCommand(args.InstanceConfig),
			&common.RefreshableInstance{r.Instance, e},
			ctx,
			timeout,
			common.DefaultHostSSHOptions,
		)
		if err != nil {
			return nil, errors.Trace(err)
		}
		client := newInstanceConfigurator(addr)
		apiPort := 0
		if args.InstanceConfig.Controller != nil {
			apiPort = args.InstanceConfig.Controller.Config.APIPort()
		}
		err = client.DropAllPorts([]int{apiPort, 22}, addr)
		if err != nil {
			common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
			return nil, errors.Trace(err)
		}
	}
	return r, nil
}
425280
func StartServer(s *grpc.Server, wi *worker.Instance) {
	vtworkerservicepb.RegisterVtworkerServer(s, NewVtworkerServer(wi))
}
867269
func (m *MockBroadcastServer) Start(address string) string {
	if m.srv != nil {
		panic("MockBroadcastServer already started")
	}

	// pass in TLS creds if present
	if m.Creds != nil {
		m.srv = grpc.NewServer(grpc.Creds(m.Creds))
	} else {
		m.srv = grpc.NewServer()
	}

	lis, err := net.Listen("tcp", address)
	if err != nil {
		panic(fmt.Sprintf("Error starting BroadcastServer %s", err))
	}
	addr := lis.Addr().String()

	test.Logf("Starting MockEventServer [%s]", addr)
	po.RegisterAtomicBroadcastServer(m.srv, m)
	m.wg.Add(1)
	go func() {
		defer m.wg.Done()
		if err := m.srv.Serve(lis); err != nil {
			test.Logf("StartMockBroadcastServer failed [%s]", err)
		}
	}()

	return addr
}
437797
func (s *Server) Start() error {
	if s.HostPortHTTP == "" {
		s.HostPortHTTP = ":" + common.DefaultServerPortHTTP
	}

	s.eHandler = endtoend.NewHandler(s.AgentHostPort, s.SamplingServerURL)

	mux := http.NewServeMux()
	mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { return }) // health check
	mux.HandleFunc("/start_trace", func(w http.ResponseWriter, r *http.Request) {
		s.handleJSON(w, r, func() interface{} {
			return tracetest.NewStartTraceRequest()
		}, func(ctx context.Context, req interface{}) (interface{}, error) {
			return s.doStartTrace(req.(*tracetest.StartTraceRequest))
		})
	})
	mux.HandleFunc("/join_trace", func(w http.ResponseWriter, r *http.Request) {
		s.handleJSON(w, r, func() interface{} {
			return tracetest.NewJoinTraceRequest()
		}, func(ctx context.Context, req interface{}) (interface{}, error) {
			return s.doJoinTrace(ctx, req.(*tracetest.JoinTraceRequest))
		})
	})
	mux.HandleFunc("/create_traces", s.eHandler.GenerateTraces)

	listener, err := net.Listen("tcp", s.HostPortHTTP)
	if err != nil {
		return err
	}
	s.listener = listener
	s.HostPortHTTP = listener.Addr().String()

	var started sync.WaitGroup
	started.Add(1)
	go func() {
		started.Done()
		http.Serve(listener, mux)
	}()
	started.Wait()
	log.Printf("Started http server at %s\n", s.HostPortHTTP)
	return nil
}
95814
func (m *MockProcessor) Start(ctx context.Context, eventInfo *common.EventInfo) error {
	ret := m.ctrl.Call(m, "Start", ctx, eventInfo)
	ret0, _ := ret[0].(error)
	return ret0
}
1287766
func (m *MockVolumeDriver) CloudMigrateStart(arg0 *api.CloudMigrateStartRequest) (*api.CloudMigrateStartResponse, error) {
	ret := m.ctrl.Call(m, "CloudMigrateStart", arg0)
	ret0, _ := ret[0].(*api.CloudMigrateStartResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
451221
func StartServer(handler http.Handler) *Server {
	ch := make(chan *ReceivedRequest)
	closeSig := make(chan struct{})
	wrapper := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		u := uuid.New()
		w.Header().Add(UUIDHeaderName, u)
		handler.ServeHTTP(w, r)
		flusher := w.(http.Flusher) // TODO: what if you can't convert to a Flusher?
		flusher.Flush()
		req := &ReceivedRequest{Request: r, Time: time.Now(), UUID: u}
		select {
		case <-closeSig:
		case ch <- req:
		}
	})

	s := httptest.NewServer(wrapper)
	return &Server{
		lck:      &sync.Mutex{},
		closed:   0,
		closeSig: closeSig,
		ch:       ch,
		srv:      s,
	}
}
582121
func MockPumpsClient(client binlog.PumpClient) *pumpcli.PumpsClient {
	nodeID := "pump-1"
	pump := &pumpcli.PumpStatus{
		Status: node.Status{
			NodeID: nodeID,
			State:  node.Online,
		},
		Client: client,
	}

	pumpInfos := &pumpcli.PumpInfos{
		Pumps:            make(map[string]*pumpcli.PumpStatus),
		AvaliablePumps:   make(map[string]*pumpcli.PumpStatus),
		UnAvaliablePumps: make(map[string]*pumpcli.PumpStatus),
	}
	pumpInfos.Pumps[nodeID] = pump
	pumpInfos.AvaliablePumps[nodeID] = pump

	pCli := &pumpcli.PumpsClient{
		ClusterID:          1,
		Pumps:              pumpInfos,
		Selector:           pumpcli.NewSelector(pumpcli.Range),
		BinlogWriteTimeout: time.Second,
	}
	pCli.Selector.SetPumps([]*pumpcli.PumpStatus{pump})

	return pCli
}
228581
func (mr *MockRPCServerMockRecorder) StartServer(ctx, protocol, path, handler interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartServer", reflect.TypeOf((*MockRPCServer)(nil).StartServer), ctx, protocol, path, handler)
}
977626
func MockInitialize() {
	ledgermgmt.InitializeTestEnvWithInitializer(
		&ledgermgmt.Initializer{
			CustomTxProcessors: ConfigTxProcessors,
		},
	)
	chains.list = make(map[string]*chain)
	chainInitializer = func(string) { return }
}
44291
func StartServer(s *grpc.Server, cnf *mysqlctl.Mycnf, mysqld *mysqlctl.Mysqld) {
	mysqlctlpb.RegisterMysqlCtlServer(s, &server{cnf: cnf, mysqld: mysqld})
}
865302
func (m *MockTimer) Start() time.Time {
	ret := m.ctrl.Call(m, "Start")
	ret0, _ := ret[0].(time.Time)
	return ret0
}
766094
func (m *MockRPCJob) ServerDiscovery(arg0 string, arg1 map[string]interface{}) (string, error) {
	ret := m.ctrl.Call(m, "ServerDiscovery", arg0, arg1)
	ret0, _ := ret[0].(string)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}