...

Source file src/github.com/chaos-mesh/chaos-mesh/controllers/fx.go

Documentation: github.com/chaos-mesh/chaos-mesh/controllers

     1  // Copyright 2021 Chaos Mesh Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  // http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  
    16  package controllers
    17  
    18  import (
    19  	"go.uber.org/fx"
    20  
    21  	"github.com/chaos-mesh/chaos-mesh/controllers/chaosimpl"
    22  	"github.com/chaos-mesh/chaos-mesh/controllers/common"
    23  	"github.com/chaos-mesh/chaos-mesh/controllers/multicluster/clusterregistry"
    24  	"github.com/chaos-mesh/chaos-mesh/controllers/multicluster/remotechaos"
    25  	"github.com/chaos-mesh/chaos-mesh/controllers/multicluster/remotecluster"
    26  	"github.com/chaos-mesh/chaos-mesh/controllers/podhttpchaos"
    27  	"github.com/chaos-mesh/chaos-mesh/controllers/podiochaos"
    28  	"github.com/chaos-mesh/chaos-mesh/controllers/podnetworkchaos"
    29  	"github.com/chaos-mesh/chaos-mesh/controllers/schedule"
    30  	"github.com/chaos-mesh/chaos-mesh/controllers/statuscheck"
    31  	"github.com/chaos-mesh/chaos-mesh/controllers/utils/chaosdaemon"
    32  	"github.com/chaos-mesh/chaos-mesh/controllers/utils/recorder"
    33  	wfcontrollers "github.com/chaos-mesh/chaos-mesh/pkg/workflow/controllers"
    34  )
    35  
    36  var Module = fx.Options(
    37  	fx.Provide(
    38  		chaosdaemon.New,
    39  		recorder.NewRecorderBuilder,
    40  		common.AllSteps,
    41  		clusterregistry.New,
    42  	),
    43  	fx.Invoke(common.Bootstrap),
    44  	fx.Invoke(podhttpchaos.Bootstrap),
    45  	fx.Invoke(podnetworkchaos.Bootstrap),
    46  	fx.Invoke(podiochaos.Bootstrap),
    47  	fx.Invoke(wfcontrollers.BootstrapWorkflowControllers),
    48  	fx.Invoke(statuscheck.Bootstrap),
    49  	fx.Invoke(remotecluster.Bootstrap),
    50  	fx.Invoke(remotechaos.Bootstrap),
    51  
    52  	schedule.Module,
    53  	chaosimpl.AllImpl,
    54  )
    55