Documentation
¶
Index ¶
- Variables
- func MonitorDirHandler(w http.ResponseWriter, r *http.Request)
- func RegisterPortAndDomainInfo(mapping *types.PortMapping, containerName string) error
- func WebSocketTermHandler(w http.ResponseWriter, r *http.Request)
- type ByteStreamToDocker
- type ByteStreamToUser
- type DirRequest
- type DirResponse
- type NewContainer
- type NewContainerRet
- type RequestCommand
- type ResizeContainer
- type ResizeContainerRet
- type TTYResponse
Constants ¶
This section is empty.
Variables ¶
var AuthRedisClient *redis.Client
AuthRedisClient is redis client storing invalid auth information
var DomainNameRedisClient *redis.Client
DomainNameRedisClient is redis client storing used domain name
var MysqlEngine *xorm.Engine
MysqlEngine is mysql engine
Functions ¶
func MonitorDirHandler ¶
func MonitorDirHandler(w http.ResponseWriter, r *http.Request)
MonitorDirHandler monitor user dir status
func RegisterPortAndDomainInfo ¶
func RegisterPortAndDomainInfo(mapping *types.PortMapping, containerName string) error
RegisterPortAndDomainInfo register port
func WebSocketTermHandler ¶
func WebSocketTermHandler(w http.ResponseWriter, r *http.Request)
WebSocketTermHandler is a middle way handler to connect web app with docker service
Types ¶
type ByteStreamToDocker ¶
ByteStreamToDocker contains byte stream from user to container
type ByteStreamToUser ¶
ByteStreamToUser stores byte stream from container to user
type DirRequest ¶
DirRequest contains message send from user
type DirResponse ¶
type DirResponse struct { OK bool `json:"ok"` Path string `json:"path"` State int `json:"state"` Type string `json:"type"` }
DirResponse stores response to the user
type NewContainer ¶
type NewContainer struct { Image string `json:"image"` Command string `json:"command"` PWD string `json:"pwd"` ENV []string `json:"env"` Mnt []string `json:"mnt"` TargetDir []string `json:"target"` Network []string `json:"network"` }
NewContainer is the JSON format between web server and docker server
type NewContainerRet ¶
NewContainerRet is the create result returned by docker end
type RequestCommand ¶
type RequestCommand struct { Message string `json:"msg"` JWT string `json:"jwt"` Project string `json:"project"` Language int `json:"language"` Width int `json:"width"` Height int `json:"height"` // contains filtered or unexported fields }
RequestCommand stores command and jwt in every ws message
type ResizeContainer ¶
type ResizeContainer struct { ID string `json:"id"` Width int `json:"width"` Height int `json:"height"` }
ResizeContainer contains msg to be sent tot the docker end
type ResizeContainerRet ¶
ResizeContainerRet containes the response of resize container
type TTYResponse ¶
TTYResponse stores data to be sent to the client