...

Source file src/github.com/redhat-developer/odo/pkg/apiserver-impl/api_devstate_service.go

Documentation: github.com/redhat-developer/odo/pkg/apiserver-impl

     1  package apiserver_impl
     2  
     3  import (
     4  	"context"
     5  
     6  	openapi "github.com/redhat-developer/odo/pkg/apiserver-gen/go"
     7  	"github.com/redhat-developer/odo/pkg/apiserver-impl/devstate"
     8  	"github.com/redhat-developer/odo/pkg/kclient"
     9  	"github.com/redhat-developer/odo/pkg/podman"
    10  	"github.com/redhat-developer/odo/pkg/preference"
    11  	"github.com/redhat-developer/odo/pkg/state"
    12  )
    13  
    14  // DevstateApiService is a service that implements the logic for the DevstateApiServicer
    15  // This service should implement the business logic for every endpoint for the DevstateApi API.
    16  // Include any external packages or services that will be required by this service.
    17  type DevstateApiService struct {
    18  	cancel           context.CancelFunc
    19  	pushWatcher      chan<- struct{}
    20  	kubeClient       kclient.ClientInterface
    21  	podmanClient     podman.Client
    22  	stateClient      state.Client
    23  	preferenceClient preference.Client
    24  
    25  	devfileState devstate.DevfileState
    26  }
    27  
    28  // NewDevstateApiService creates a devstate api service
    29  func NewDevstateApiService(
    30  	cancel context.CancelFunc,
    31  	pushWatcher chan<- struct{},
    32  	kubeClient kclient.ClientInterface,
    33  	podmanClient podman.Client,
    34  	stateClient state.Client,
    35  	preferenceClient preference.Client,
    36  ) openapi.DevstateApiServicer {
    37  	return &DevstateApiService{
    38  		cancel:           cancel,
    39  		pushWatcher:      pushWatcher,
    40  		kubeClient:       kubeClient,
    41  		podmanClient:     podmanClient,
    42  		stateClient:      stateClient,
    43  		preferenceClient: preferenceClient,
    44  
    45  		devfileState: devstate.NewDevfileState(),
    46  	}
    47  }
    48  

View as plain text