clusterTerminalAccess

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 29 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTerminalAccessConfig

func GetTerminalAccessConfig() (*models.UserTerminalSessionConfig, error)

Types

type ManifestEditResponse added in v0.6.19

type ManifestEditResponse struct {
	ErrorComments    string                 `json:"errors,omitempty"`
	ManifestResponse *k8s2.ManifestResponse `json:"manifestResponse"`
	models.UserTerminalSessionResponse
}

type UserTerminalAccessService

type UserTerminalAccessService interface {
	StartTerminalSession(ctx context.Context, request *models.UserTerminalSessionRequest) (*models.UserTerminalSessionResponse, error)
	UpdateTerminalSession(ctx context.Context, request *models.UserTerminalSessionRequest) (*models.UserTerminalSessionResponse, error)
	UpdateTerminalShellSession(ctx context.Context, request *models.UserTerminalShellSessionRequest) (*models.UserTerminalSessionResponse, error)
	FetchTerminalStatus(ctx context.Context, terminalAccessId int, namespace string, containerName string, shellName string) (*models.UserTerminalSessionResponse, error)
	StopTerminalSession(ctx context.Context, userTerminalAccessId int)
	DisconnectTerminalSession(ctx context.Context, userTerminalAccessId int) error
	DisconnectAllSessionsForUser(ctx context.Context, userId int32)
	FetchPodManifest(ctx context.Context, userTerminalAccessId int) (resp *k8s2.ManifestResponse, err error)
	FetchPodEvents(ctx context.Context, userTerminalAccessId int) (*models.UserTerminalPodEvents, error)
	ValidateShell(podName, namespace, shellName, containerName string, clusterId int) (bool, string, error)
	EditTerminalPodManifest(ctx context.Context, request *models.UserTerminalSessionRequest, override bool) (ManifestEditResponse, error)
	GetTerminalAccessSessionDataFromCacheById(terminalAccessId int) (*models.UserTerminalAccessData, bool)
}

type UserTerminalAccessServiceImpl

type UserTerminalAccessServiceImpl struct {
	TerminalAccessRepository     repository.TerminalAccessRepository
	Logger                       *zap.SugaredLogger
	Config                       *models.UserTerminalSessionConfig
	TerminalAccessSessionDataMap *map[int]*UserTerminalAccessSessionData
	TerminalAccessDataArrayMutex *sync.RWMutex
	PodStatusSyncCron            *cron.Cron
	K8sCommonService             k8s.K8sCommonService

	K8sCapacityService capacity.K8sCapacityService
	// contains filtered or unexported fields
}

func NewUserTerminalAccessServiceImpl

func NewUserTerminalAccessServiceImpl(logger *zap.SugaredLogger, terminalAccessRepository repository.TerminalAccessRepository, config *models.UserTerminalSessionConfig, k8sCommonService k8s.K8sCommonService, terminalSessionHandler terminal.TerminalSessionHandler, K8sCapacityService capacity.K8sCapacityService, k8sUtil *k8s2.K8sServiceImpl, cronLogger *cron3.CronLoggerImpl) (*UserTerminalAccessServiceImpl, error)

func (*UserTerminalAccessServiceImpl) DeleteTerminalPod

func (impl *UserTerminalAccessServiceImpl) DeleteTerminalPod(ctx context.Context, clusterId int, terminalPodName string, namespace string) error

func (*UserTerminalAccessServiceImpl) DeleteTerminalResource

func (impl *UserTerminalAccessServiceImpl) DeleteTerminalResource(ctx context.Context, clusterId int, terminalResourceName string, resourceTemplateString string, namespace string) error

func (*UserTerminalAccessServiceImpl) DisconnectAllSessionsForUser

func (impl *UserTerminalAccessServiceImpl) DisconnectAllSessionsForUser(ctx context.Context, userId int32)

func (*UserTerminalAccessServiceImpl) DisconnectTerminalSession

func (impl *UserTerminalAccessServiceImpl) DisconnectTerminalSession(ctx context.Context, userTerminalAccessId int) error

func (*UserTerminalAccessServiceImpl) EditTerminalPodManifest added in v0.6.19

func (impl *UserTerminalAccessServiceImpl) EditTerminalPodManifest(ctx context.Context, editManifestRequest *models.UserTerminalSessionRequest, override bool) (ManifestEditResponse, error)

func (*UserTerminalAccessServiceImpl) FetchPodEvents

func (impl *UserTerminalAccessServiceImpl) FetchPodEvents(ctx context.Context, userTerminalAccessId int) (*models.UserTerminalPodEvents, error)

func (*UserTerminalAccessServiceImpl) FetchPodManifest

func (impl *UserTerminalAccessServiceImpl) FetchPodManifest(ctx context.Context, userTerminalAccessId int) (resp *k8s2.ManifestResponse, err error)

func (*UserTerminalAccessServiceImpl) FetchTerminalStatus

func (impl *UserTerminalAccessServiceImpl) FetchTerminalStatus(ctx context.Context, terminalAccessId int, namespace string, containerName string, shellName string) (*models.UserTerminalSessionResponse, error)

func (*UserTerminalAccessServiceImpl) GenerateNodeDebugPod added in v0.6.19

func (impl *UserTerminalAccessServiceImpl) GenerateNodeDebugPod(o *models.UserTerminalSessionRequest) (*v1.Pod, error)

func (*UserTerminalAccessServiceImpl) GetTerminalAccessSessionDataFromCacheById added in v1.1.0

func (impl *UserTerminalAccessServiceImpl) GetTerminalAccessSessionDataFromCacheById(terminalAccessId int) (*models.UserTerminalAccessData, bool)

func (*UserTerminalAccessServiceImpl) StartNodeDebug added in v0.6.19

func (*UserTerminalAccessServiceImpl) StartTerminalSession

func (*UserTerminalAccessServiceImpl) StopTerminalSession

func (impl *UserTerminalAccessServiceImpl) StopTerminalSession(ctx context.Context, userTerminalAccessId int)

func (*UserTerminalAccessServiceImpl) SyncPodStatus

func (impl *UserTerminalAccessServiceImpl) SyncPodStatus()

func (*UserTerminalAccessServiceImpl) SyncRunningInstances

func (impl *UserTerminalAccessServiceImpl) SyncRunningInstances()

func (*UserTerminalAccessServiceImpl) UpdateTerminalSession

func (*UserTerminalAccessServiceImpl) UpdateTerminalShellSession

func (*UserTerminalAccessServiceImpl) ValidateShell added in v0.6.15

func (impl *UserTerminalAccessServiceImpl) ValidateShell(podName, namespace, shellName, containerName string, clusterId int) (bool, string, error)

type UserTerminalAccessSessionData

type UserTerminalAccessSessionData struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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