Documentation
¶
Index ¶
- Constants
- func AuthMiddleware(next http.Handler) http.Handler
- func ExecPod(kubeClient kubernetes.Interface, cfg *rest.Config, cmd []string, ...) error
- func GetRequestBody(body interface{}) io.Reader
- func NewKubeOutClusterClient(clusterId string) (kubernetes.Interface, *rest.Config, error)
- func PermissionMiddleware(next http.Handler) http.Handler
- func PoetryRequest(poetryClient *PoetryClient, r *http.Request) error
- func PoetryRequestPermission(poetryClient *PoetryClient, userID int, permissionUUID, productName string, ...) bool
- func ServeWs(w http.ResponseWriter, r *http.Request)
- func ValidatePod(kubeClient kubernetes.Interface, namespace, podName, containerName string) (bool, error)
- type EndpointResponse
- type KeyState
- type Organization
- type PoetryClient
- func (p *PoetryClient) Deserialize(data []byte, v interface{}) error
- func (p *PoetryClient) Do(url, method string, reader io.Reader, header http.Header) ([]byte, error)
- func (p *PoetryClient) GetUserPermissionUUIDs(roleID int64, productName string, log *xlog.Logger) ([]string, error)
- func (p *PoetryClient) ListRolePermissions(roleID int64, roleType int, productName string, log *xlog.Logger) ([]*RolePermission, error)
- func (p *PoetryClient) SendRequest(url, method string, data interface{}, header http.Header) (string, error)
- type ProductResp
- type PtyHandler
- type RenderInfo
- type RenderKV
- type RolePermission
- type RolePermissionModels
- type TeamInfo
- type TerminalMessage
- type TerminalSession
- type UserInfo
- type UserViewReponseModel
Constants ¶
View Source
const ( SystemType = 1 ProjectType = 2 AllUsersRoleName = "all-users" )
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 ExecPod ¶
func ExecPod(kubeClient kubernetes.Interface, cfg *rest.Config, cmd []string, ptyHandler PtyHandler, namespace, podName, containerName string) error
ExecPod do pod exec
func GetRequestBody ¶
func NewKubeOutClusterClient ¶
kubeclient config
func PoetryRequest ¶
func PoetryRequest(poetryClient *PoetryClient, r *http.Request) error
func PoetryRequestPermission ¶
func PoetryRequestPermission(poetryClient *PoetryClient, userID int, permissionUUID, productName string, w http.ResponseWriter, r *http.Request) bool
func ValidatePod ¶
func ValidatePod(kubeClient kubernetes.Interface, namespace, podName, containerName string) (bool, error)
验证是否存在
Types ¶
type EndpointResponse ¶
type Organization ¶
type PoetryClient ¶
func (*PoetryClient) Deserialize ¶
func (p *PoetryClient) Deserialize(data []byte, v interface{}) error
func (*PoetryClient) GetUserPermissionUUIDs ¶
func (*PoetryClient) ListRolePermissions ¶
func (p *PoetryClient) ListRolePermissions(roleID int64, roleType int, productName string, log *xlog.Logger) ([]*RolePermission, error)
func (*PoetryClient) SendRequest ¶
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"`
Descritpion 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 RolePermission ¶
type RolePermissionModels ¶
type RolePermissionModels struct {
RolePermissions []*RolePermission `json:"RolePermissions"`
}
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 {
// contains filtered or unexported fields
}
TerminalSession implements PtyHandler
func NewTerminalSession ¶
func NewTerminalSession(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*TerminalSession, error)
func (*TerminalSession) Next ¶
func (t *TerminalSession) Next() *remotecommand.TerminalSize
Next called in a loop from remotecommand as long as the process is running
type UserInfo ¶
type UserInfo struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
Phone string `json:"phone"`
IsAdmin bool `json:"isAdmin"`
IsSuperUser bool `json:"isSuperUser"`
IsTeamLeader bool `json:"isTeamLeader"`
OrganizationID int `json:"organization_id"`
Directory string `json:"directory"`
LastLoginAt int64 `json:"lastLogin"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Teams []TeamInfo `json:"teams"`
}
type UserViewReponseModel ¶
type UserViewReponseModel struct {
User *UserInfo `json:"info"`
Teams []*TeamInfo `json:"teams"`
Organization *Organization `json:"organization"`
}
Click to show internal directories.
Click to hide internal directories.