util

package
v2.10.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoUserDaemon     = errors.New("telepresence user daemon is not running")
	ErrNoRootDaemon     = errors.New("telepresence root daemon is not running")
	ErrNoTrafficManager = errors.New("telepresence traffic manager is not connected")
)

Functions

func AddKubeconfigEnv

func AddKubeconfigEnv(cr *connector.ConnectRequest)

func AddSubCommands

func AddSubCommands(ctx context.Context, commands ...*cobra.Command) context.Context

func CommandInitializer

func CommandInitializer(cmd *cobra.Command) (err error)

func DescribeIntercepts

func DescribeIntercepts(iis []*manager.InterceptInfo, volumeMountsPrevented error, debug bool) string

func Disconnect

func Disconnect(ctx context.Context, quitDaemons bool) error

Disconnect shuts down a session in the root daemon. When it shuts down, it will tell the connector to shut down.

func EnsureRootDaemonRunning

func EnsureRootDaemonRunning(ctx context.Context) error

EnsureRootDaemonRunning ensures that the daemon is running.

func ForcedUpdateCheck

func ForcedUpdateCheck(cmd *cobra.Command, _ []string) error

func GetConnectRequest

func GetConnectRequest(ctx context.Context) *connector.ConnectRequest

func GetSubCommands

func GetSubCommands(cmd *cobra.Command) []*cobra.Command

func InitCommand

func InitCommand(cmd *cobra.Command) (err error)

func PrepareMount

func PrepareMount(cwd string, mountPoint string) (string, error)

func RaiseCloudMessage

func RaiseCloudMessage(cmd *cobra.Command, _ []string) error

RaiseCloudMessage is what is called from `PostRunE` in a command and is responsible for raising the message for the command used.

func UpdateCheckIfDue

func UpdateCheckIfDue(cmd *cobra.Command, _ []string) error

func UserDaemonDisconnect

func UserDaemonDisconnect(ctx context.Context, quitDaemons bool) (err error)

func WithCommandInitializer

func WithCommandInitializer(ctx context.Context, cmdInit func(cmd *cobra.Command) error) context.Context

func WithConnectionRequest

func WithConnectionRequest(ctx context.Context, rq *connector.ConnectRequest) context.Context

Types

type Session

type Session struct {
	UserDaemon
	Info    *connector.ConnectInfo
	Started bool
}

func GetSession

func GetSession(ctx context.Context) *Session

type UpdateChecker

type UpdateChecker struct {
	NextCheck map[string]time.Time `json:"next_check"`
	// contains filtered or unexported fields
}

func NewUpdateChecker

func NewUpdateChecker(ctx context.Context, url string) (*UpdateChecker, error)

NewUpdateChecker returns a new update checker, possibly initialized from the users cache.

func (*UpdateChecker) StoreNextCheck

func (uc *UpdateChecker) StoreNextCheck(ctx context.Context, d time.Duration) error

func (*UpdateChecker) UpdateAvailable

func (uc *UpdateChecker) UpdateAvailable(currentVersion *semver.Version, errOut io.Writer) (*semver.Version, bool)

type UserDaemon

type UserDaemon struct {
	connector.ConnectorClient
	Conn *grpc.ClientConn
}

func GetUserDaemon

func GetUserDaemon(ctx context.Context) *UserDaemon

Jump to

Keyboard shortcuts

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