Documentation
¶
Index ¶
- type Option
- type PodOption
- type Result
- func WithForwarders(ctx context.Context, options []*Option, kubeconfigPath string, ...) (*Result, error)
- func WithForwardersEmbedConfig(ctx context.Context, options []*Option, kubeconfigBytes []byte, ...) (*Result, error)
- func WithRestConfig(ctx context.Context, options []*Option, config *restclient.Config, ...) (*Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct { LocalPort int // the local port for forwarding RemotePort int // the remote port port for forwarding Namespace string // the k8s namespace metadata PodName string // the k8s pod metadata ServiceName string // the k8s service metadata Source string // the k8s source string, eg: svc/my-nginx-svc po/my-nginx-66b6c48dd5-ttdb2 }
type Result ¶
type Result struct { Close func() // close the port forwarding Ready func() ([][]portforward.ForwardedPort, error) // block till the forwarding ready Wait func() // block and listen IOStreams close signal }
func WithForwarders ¶
func WithForwarders(ctx context.Context, options []*Option, kubeconfigPath string, logStreams *genericclioptions.IOStreams) (*Result, error)
It is to forward port for k8s cloud services. If `kubeconfigPath` is empty, the default kubeconfig location is used (e.g. `~/.kube/config`)
func WithForwardersEmbedConfig ¶
func WithForwardersEmbedConfig(ctx context.Context, options []*Option, kubeconfigBytes []byte, logStreams *genericclioptions.IOStreams) (*Result, error)
It is to forward port whith kubeconfig bytes.
func WithRestConfig ¶
func WithRestConfig(ctx context.Context, options []*Option, config *restclient.Config, logStreams *genericclioptions.IOStreams) (*Result, error)
It is to forward port with restclient.Config.
Click to show internal directories.
Click to hide internal directories.