...

Source file src/github.com/redhat-developer/odo/pkg/portForward/interface.go

Documentation: github.com/redhat-developer/odo/pkg/portForward

     1  package portForward
     2  
     3  import (
     4  	"context"
     5  	"io"
     6  
     7  	"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
     8  	"github.com/devfile/library/v2/pkg/devfile/parser"
     9  
    10  	"github.com/redhat-developer/odo/pkg/api"
    11  )
    12  
    13  type Client interface {
    14  	// StartPortForwarding starts port forwarding for the endpoints defined in the containers of the devfile
    15  	// componentName indicates the name of component in the Devfile
    16  	// randomPorts indicates to affect random ports, instead of stable ports starting at 20001
    17  	// output will be written to errOut writer
    18  	// definedPorts allows callers to explicitly define the mapping they want to set.
    19  	StartPortForwarding(
    20  		ctx context.Context,
    21  		devFileObj parser.DevfileObj,
    22  		componentName string,
    23  		debug bool,
    24  		randomPorts bool,
    25  		out io.Writer,
    26  		errOut io.Writer,
    27  		definedPorts []api.ForwardedPort,
    28  		customAddress string,
    29  	) error
    30  
    31  	// StopPortForwarding stops the port forwarding for the specified component.
    32  	StopPortForwarding(ctx context.Context, componentName string)
    33  
    34  	// GetForwardedPorts returns the list of ports for each container currently forwarded.
    35  	GetForwardedPorts() map[string][]v1alpha2.Endpoint
    36  }
    37  

View as plain text