Documentation ¶
Index ¶
- func DeleteInfo(ctx context.Context, file string) error
- func GetKubeStartingConfig(cmd *cobra.Command) (*api.Config, error)
- func InfoExists(ctx context.Context, file string) (bool, error)
- func KeepInfoAlive(ctx context.Context, file string) error
- func SafeContainerName(name string) string
- func SaveInfo(ctx context.Context, object *Info, file string) error
- func WatchInfos(ctx context.Context, onChange func(context.Context) error, files ...string) error
- func WithDefaultRequest(ctx context.Context, cmd *cobra.Command) (context.Context, error)
- func WithSession(ctx context.Context, s *Session) context.Context
- func WithUserClient(ctx context.Context, ud *UserClient) context.Context
- type Identifier
- type Info
- type InfoMatchError
- type Request
- type Session
- type UserClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKubeStartingConfig ¶ added in v2.16.0
func KeepInfoAlive ¶ added in v2.16.0
KeepInfoAlive updates the access and modification times of the given Info periodically so that it never gets older than keepAliveInterval. This means that any file with a modification time older than the current time minus two keepAliveIntervals can be considered stale and should be removed.
The alive poll ends and the Info is deleted when the context is cancelled.
func SafeContainerName ¶ added in v2.16.0
SafeContainerName returns a string that can safely be used as an argument to docker run --name. Only characters [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed. Others are replaced by an underscore, or if it's the very first character, by the character 'a'.
func WatchInfos ¶ added in v2.16.0
func WithDefaultRequest ¶
func WithUserClient ¶
func WithUserClient(ctx context.Context, ud *UserClient) context.Context
Types ¶
type Identifier ¶ added in v2.16.0
func IdentifierFromFlags ¶ added in v2.16.0
func IdentifierFromFlags(name string, flagMap map[string]string) (*Identifier, error)
IdentifierFromFlags returns a unique name created from the name of the current context and the active namespace denoted by the given flagMap.
func NewIdentifier ¶ added in v2.16.0
func NewIdentifier(name, contextName, namespace string) (*Identifier, error)
func (*Identifier) ContainerName ¶ added in v2.16.0
func (id *Identifier) ContainerName() string
func (*Identifier) InfoFileName ¶ added in v2.16.0
func (id *Identifier) InfoFileName() string
func (*Identifier) String ¶ added in v2.16.0
func (id *Identifier) String() string
type Info ¶ added in v2.16.0
type InfoMatchError ¶ added in v2.16.0
type InfoMatchError string
func (InfoMatchError) Error ¶ added in v2.16.0
func (i InfoMatchError) Error() string
type Request ¶
type Request struct { connector.ConnectRequest // If set, then use a containerized daemon for the connection. Docker bool // Match expression to use when finding an existing connection by name Use *regexp.Regexp // Request is created on-demand, not by InitRequest Implicit bool UserDaemonProfilingPort uint16 RootDaemonProfilingPort uint16 // contains filtered or unexported fields }
func GetRequest ¶
func InitRequest ¶
InitRequest adds the networking flags and Kubernetes flags to the given command and returns a Request and a FlagSet with the Kubernetes flags. The FlagSet is returned here so that a map of flags that gets modified can be extracted using FlagMap once the flag parsing has completed.
func (*Request) GetAllNamespaces ¶ added in v2.16.0
type Session ¶
type Session struct { UserClient Info *connector.ConnectInfo Started bool }
func GetSession ¶
type UserClient ¶
type UserClient struct { connector.ConnectorClient Conn *grpc.ClientConn DaemonID *Identifier }
func GetUserClient ¶
func GetUserClient(ctx context.Context) *UserClient
func (*UserClient) DaemonPort ¶ added in v2.13.0
func (ud *UserClient) DaemonPort() int
func (*UserClient) Remote ¶
func (c *UserClient) Remote() bool