intercept

package
v2.9.4-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

func LeaveCommand

func LeaveCommand() *cobra.Command

func Result

func Result(r *connector.InterceptResult, err error) error

func Run

func Run(ctx context.Context, sif State) error

Types

type Args

type Args struct {
	Name        string // Args[0] || `${Args[0]}-${--namespace}` // which depends on a combinationof --workload and --namespace
	AgentName   string // --workload || Args[0] // only valid if !localOnly
	Namespace   string // --namespace
	Port        string // --port // only valid if !localOnly
	ServiceName string // --service // only valid if !localOnly
	LocalOnly   bool   // --local-only

	EnvFile  string   // --env-file
	EnvJSON  string   // --env-json
	Mount    string   // --mount // "true", "false", or desired mount point // only valid if !localOnly
	MountSet bool     // whether --mount was passed
	ToPod    []string // --to-pod

	DockerRun   bool     // --docker-run
	DockerMount string   // --docker-mount // where to mount in a docker container. Defaults to mount unless mount is "true" or "false".
	Cmdline     []string // Args[1:]

	Mechanism     string // --mechanism tcp
	MechanismArgs []string
	ExtendedInfo  []byte
}

func (*Args) AddFlags

func (a *Args) AddFlags(flags *pflag.FlagSet)

func (*Args) AutocompleteNamespace

func (a *Args) AutocompleteNamespace(cmd *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective)

func (*Args) GetMountPoint

func (a *Args) GetMountPoint(ctx context.Context) (string, bool, error)

func (*Args) Run

func (a *Args) Run(cmd *cobra.Command, positional []string) error

func (*Args) ValidArgs

func (a *Args) ValidArgs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func (*Args) Validate

func (a *Args) Validate(cmd *cobra.Command, positional []string) error

func (*Args) ValidateDockerArgs

func (a *Args) ValidateDockerArgs() error

type State

type State interface {
	As(ptr any)
	Cmd() *cobra.Command
	CreateRequest(context.Context) (*connector.CreateInterceptRequest, error)
	Name() string
	Reporter() *scout.Reporter
	RunAndLeave() bool
}

func NewState

func NewState(
	cmd *cobra.Command,
	args *Args,
) State

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL