service

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 29 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// KeyStateNew ...
	KeyStateNew = KeyState("new")
	// KeyStateUnused ...
	KeyStateUnused = KeyState("unused")
	// KeyStatePresent ...
	KeyStatePresent = KeyState("present")
)
View Source
const (
	EndOfTransmission = "\u0004"
)

Variables

This section is empty.

Functions

func DebugWorkflow

func DebugWorkflow(c *gin.Context)

func ExecPod

func ExecPod(kubeClient kubernetes.Interface, cfg *rest.Config, cmd []string, ptyHandler PtyHandler, namespace, podName, containerName string) error

ExecPod do pod exec

func NewKubeOutClusterClient

func NewKubeOutClusterClient(clusterID string) (kubernetes.Interface, *rest.Config, error)

NewKubeOutClusterClient returns kubeClient and config

func ServeWs

func ServeWs(c *gin.Context)

func ValidatePod

func ValidatePod(kubeClient kubernetes.Interface, namespace, podName, containerName string) (bool, error)

验证是否存在

Types

type EndpointResponse

type EndpointResponse struct {
	ResultCode int    `json:"resultCode"`
	ErrorMsg   string `json:"errorMsg"`
}

type KeyState

type KeyState string

KeyState can be new, deleted, normal

type ProductResp

type ProductResp struct {
	ID          string      `json:"id"`
	ProductName string      `json:"product_name"`
	Namespace   string      `json:"namespace"`
	Status      string      `json:"status"`
	Error       string      `json:"error"`
	EnvName     string      `json:"env_name"`
	UpdateBy    string      `json:"update_by"`
	UpdateTime  int64       `json:"update_time"`
	Services    [][]string  `json:"services"`
	Render      *RenderInfo `json:"render"`
	Vars        []*RenderKV `json:"vars"`
	IsPublic    bool        `json:"isPublic"`
	ClusterID   string      `json:"cluster_id,omitempty"`
	RecycleDay  int         `json:"recycle_day"`
	IsProd      bool        `json:"is_prod"`
	Source      string      `json:"source"`
}

type PtyHandler

type PtyHandler interface {
	io.Reader
	io.Writer
	remotecommand.TerminalSizeQueue
	Done() chan struct{}
}

type RenderInfo

type RenderInfo struct {
	Name        string `json:"name"`
	Revision    int64  `json:"revision"`
	ProductTmpl string `json:"product_tmpl"`
	Description string `json:"description"`
}

RenderInfo ...

type RenderKV

type RenderKV struct {
	Key      string   `json:"key"`
	Value    string   `json:"value"`
	Alias    string   `json:"alias"`
	State    KeyState `json:"state"`
	Services []string `json:"services"`
}

RenderKV ...

type TerminalMessage

type TerminalMessage struct {
	Operation string `json:"operation"`
	Data      string `json:"data"`
	Rows      uint16 `json:"rows"`
	Cols      uint16 `json:"cols"`
}

TerminalMessage is the messaging protocol between ShellController and TerminalSession.

type TerminalSession

type TerminalSession struct {

	// SecretEnvs is a list of environment variables that should be hidden from the client.
	SecretEnvs []string
	Type       TerminalSessionType
	// contains filtered or unexported fields
}

TerminalSession implements PtyHandler

func NewTerminalSession

func NewTerminalSession(w http.ResponseWriter, r *http.Request, responseHeader http.Header, opt ...*TerminalSessionOption) (*TerminalSession, error)

func (*TerminalSession) Close

func (t *TerminalSession) Close() error

Close close session

func (*TerminalSession) Done

func (t *TerminalSession) Done() chan struct{}

Done done

func (*TerminalSession) Next

Next called in a loop from remotecommand as long as the process is running

func (*TerminalSession) Read

func (t *TerminalSession) Read(p []byte) (int, error)

Read called in a loop from remotecommand as long as the process is running

func (*TerminalSession) Write

func (t *TerminalSession) Write(p []byte) (int, error)

Write called from remotecommand whenever there is any output

type TerminalSessionOption

type TerminalSessionOption struct {
	SecretEnvs []string
	Type       TerminalSessionType
}

type TerminalSessionType

type TerminalSessionType string
const (
	// Environment is the debug terminal session type for environment
	Environment TerminalSessionType = "env"
	// Workflow is the debug terminal session type for workflow, which need musk secret envs
	Workflow TerminalSessionType = "workflow"
)

Jump to

Keyboard shortcuts

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