github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/sharedaction/actor.go (about)

     1  // Package sharedaction handles all operations that do not require a cloud
     2  // controller
     3  package sharedaction
     4  
     5  type AuthActor interface {
     6  	IsLoggedIn() bool
     7  }
     8  
     9  // Actor handles all shared actions
    10  type Actor struct {
    11  	Config Config
    12  	AuthActor
    13  }
    14  
    15  // NewActor returns an Actor with default settings
    16  func NewActor(config Config) *Actor {
    17  	var authActor AuthActor = NewDefaultAuthActor(config)
    18  	if config.IsCFOnK8s() {
    19  		authActor = NewK8sAuthActor(config)
    20  	}
    21  
    22  	return &Actor{
    23  		AuthActor: authActor,
    24  		Config:    config,
    25  	}
    26  }