...

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  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package controllers
    15  
    16  import (
    17  	"go.uber.org/fx"
    18  
    19  	"github.com/chaos-mesh/chaos-mesh/controllers/chaosimpl"
    20  	"github.com/chaos-mesh/chaos-mesh/controllers/pipeline"
    21  	"github.com/chaos-mesh/chaos-mesh/controllers/podhttpchaos"
    22  	"github.com/chaos-mesh/chaos-mesh/controllers/podiochaos"
    23  	"github.com/chaos-mesh/chaos-mesh/controllers/podnetworkchaos"
    24  	"github.com/chaos-mesh/chaos-mesh/controllers/schedule"
    25  	"github.com/chaos-mesh/chaos-mesh/controllers/utils/chaosdaemon"
    26  	"github.com/chaos-mesh/chaos-mesh/controllers/utils/recorder"
    27  	wfcontrollers "github.com/chaos-mesh/chaos-mesh/pkg/workflow/controllers"
    28  )
    29  
    30  var Module = fx.Options(
    31  	fx.Provide(
    32  		pipeline.AllSteps,
    33  		fx.Annotated{
    34  			Group:  "controller",
    35  			Target: pipeline.NewController,
    36  		},
    37  		fx.Annotated{
    38  			Group:  "controller",
    39  			Target: podnetworkchaos.NewController,
    40  		},
    41  		fx.Annotated{
    42  			Group:  "controller",
    43  			Target: podhttpchaos.NewController,
    44  		},
    45  		fx.Annotated{
    46  			Group:  "controller",
    47  			Target: podiochaos.NewController,
    48  		},
    49  
    50  		chaosdaemon.New,
    51  		recorder.NewRecorderBuilder,
    52  	),
    53  	fx.Invoke(wfcontrollers.BootstrapWorkflowControllers),
    54  	schedule.Module,
    55  	chaosimpl.AllImpl)
    56