socket

package
v4.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VarImagePullSecrets       = "ImagePullSecrets"
	VarImagePullSecretsNoName = "ImagePullSecretsNoName"
	VarBranch                 = "Branch"
	VarCommit                 = "Commit"
	VarPipeline               = "Pipeline"
	VarClusterIssuer          = "ClusterIssuer"
	VarHost                   = "Host"
	VarTlsSecret              = "TlsSecret"
)
View Source
const (
	OpStdout = "stdout"
	OpStdin  = "stdin"
	OpResize = "resize"
	OpToast  = "toast"
)

Variables

View Source
var (
	ETX                 = []byte("\u0003")
	END_OF_TRANSMISSION = []byte("\u0004")
)
View Source
var AuditLogWithChange = events.AuditLog
View Source
var (
	ErrorVersionNotMatched = errors.New("当前版本和最新版本存在差异,请刷新重试")
)

Functions

func HandleExecShell

func HandleExecShell(input *websocket_pb.WsHandleExecShellInput, conn *WsConn) (string, error)

func HandleWsAuthorize

func HandleWsAuthorize(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsCancel

func HandleWsCancel(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsCreateProject

func HandleWsCreateProject(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsHandleCloseShell

func HandleWsHandleCloseShell(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsHandleExecShell

func HandleWsHandleExecShell(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsHandleExecShellMsg

func HandleWsHandleExecShellMsg(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsProjectPodEvent

func HandleWsProjectPodEvent(c *WsConn, t websocket_pb.Type, message []byte)

func HandleWsUpdateProject

func HandleWsUpdateProject(c *WsConn, t websocket_pb.Type, message []byte)

func InstallProject

func InstallProject(job contracts.Job) (err error)

func NewJober

func NewJober(
	input *JobInput,
	user contracts.UserInfo,
	slugName string,
	messager contracts.DeployMsger,
	pubsub contracts.PubSub,
	timeoutSeconds int64,
	opts ...Option,
) contracts.Job

func NewMessageSender

func NewMessageSender(conn *WsConn, slugName string, wsType websocket_pb.Type) contracts.DeployMsger

func NewSessionMap

func NewSessionMap(conn *WsConn) contracts.SessionMapper

func WaitForTerminal

func WaitForTerminal(conn *WsConn, k8sClient kubernetes.Interface, cfg *rest.Config, container *contracts.Container, shell, sessionId string)

WaitForTerminal is called from apihandler.handleAttach as a goroutine Waits for the SockJS connection to be opened by the client the session to be bound in handleMyPtyHandler

Types

type ChartFileLoader

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

func (*ChartFileLoader) Load

func (c *ChartFileLoader) Load(j *jobRunner) error

type DeployResult

type DeployResult struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*DeployResult) IsSet

func (d *DeployResult) IsSet() bool

func (*DeployResult) Model

func (d *DeployResult) Model() *types.ProjectModel

func (*DeployResult) Msg

func (d *DeployResult) Msg() string

func (*DeployResult) ResultType

func (d *DeployResult) ResultType() websocket_pb.ResultType

func (*DeployResult) Set

type DynamicLoader

type DynamicLoader struct{}

func (*DynamicLoader) Load

func (d *DynamicLoader) Load(j *jobRunner) error

type ExtraValuesLoader

type ExtraValuesLoader struct{}

func (*ExtraValuesLoader) Load

func (d *ExtraValuesLoader) Load(j *jobRunner) error

type HandleRequestFunc

type HandleRequestFunc func(c *WsConn, t websocket_pb.Type, message []byte)

type JobInput

type JobInput struct {
	Type         websocket_pb.Type
	NamespaceId  int64
	Name         string
	GitProjectId int64
	GitBranch    string
	GitCommit    string
	Config       string
	Atomic       bool
	ExtraValues  []*types.ExtraValue
	Version      int64
}

type Loader

type Loader interface {
	Load(*jobRunner) error
}

type MergeValuesLoader

type MergeValuesLoader struct{}

func (*MergeValuesLoader) Load

func (m *MergeValuesLoader) Load(j *jobRunner) error

Load imagePullSecrets 会自动注入到 imagePullSecrets 中

type NewJobFunc

type NewJobFunc func(
	input *JobInput,
	user contracts.UserInfo,
	slugName string,
	messager contracts.DeployMsger,
	pubsub contracts.PubSub,
	timeoutSeconds int64,
	opts ...Option,
) contracts.Job

type Option

type Option func(*jobRunner)

func WithDryRun

func WithDryRun() Option

type ReleaseInstallerLoader

type ReleaseInstallerLoader struct{}

func (*ReleaseInstallerLoader) Load

func (r *ReleaseInstallerLoader) Load(j *jobRunner) error

type Sleeper

type Sleeper interface {
	Sleep(time.Duration)
}

type TerminalResponse

type TerminalResponse struct {
	ID string `json:"id"`
}

type VariableLoader

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

func (*VariableLoader) Load

func (v *VariableLoader) Load(j *jobRunner) error

type WaitSocketExitInterface

type WaitSocketExitInterface interface {
	Inc()
	Dec()
	Wait()
	Count() int
}

func NewWaitSocketExit

func NewWaitSocketExit() WaitSocketExitInterface

type WebsocketManager

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

func NewWebsocketManager

func NewWebsocketManager(healthTickDuration time.Duration) *WebsocketManager

func (*WebsocketManager) Info

func (wc *WebsocketManager) Info(writer http.ResponseWriter, request *http.Request)

func (*WebsocketManager) TickClusterHealth

func (wc *WebsocketManager) TickClusterHealth()

func (*WebsocketManager) Ws

type WsConn

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

func (*WsConn) GetUser

func (c *WsConn) GetUser() contracts.UserInfo

func (*WsConn) SetUser

func (c *WsConn) SetUser(info contracts.UserInfo)

func (*WsConn) Shutdown

func (c *WsConn) Shutdown()

type WsResponse

type WsResponse = websocket_pb.WsMetadataResponse

Jump to

Keyboard shortcuts

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