controller

package
v0.0.0-...-77fc1cc Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthRedisClient *redis.Client

AuthRedisClient is redis client storing invalid auth information

View Source
var DomainNameRedisClient *redis.Client

DomainNameRedisClient is redis client storing used domain name

View Source
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

type ByteStreamToDocker struct {
	ID  string `json:"id"`
	Msg string `json:"msg"`
}

ByteStreamToDocker contains byte stream from user to container

type ByteStreamToUser

type ByteStreamToUser struct {
	OK  bool   `ok`
	Msg string `json:"msg"`
}

ByteStreamToUser stores byte stream from container to user

type DirRequest

type DirRequest struct {
	JWT     string `json:"jwt"`
	Project string `json:"project"`
}

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

type NewContainerRet struct {
	ID  string `json:"id"`
	OK  bool   `json:"ok"`
	Msg string `json:"msg"`
}

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

type ResizeContainerRet struct {
	OK  bool   `json:"ok"`
	Msg string `json:"msg"`
}

ResizeContainerRet containes the response of resize container

type TTYResponse

type TTYResponse struct {
	OK  bool   `json:"ok"`
	Msg string `json:"msg"`
	Id  string `json:"id"`
}

TTYResponse stores data to be sent to the client

Jump to

Keyboard shortcuts

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