Documentation ¶
Index ¶
- Variables
- func Attach(codeID, userid string, tcmd *exec.Cmd) chan struct{}
- func CPUTime(procid int) (ms int)
- func Childrens(process int) []int
- func Connect2(runnerip net.IP) (net.Conn, error)
- func Connect2Any() (net.Conn, error)
- func DelSubvolume(name string) error
- func DelSubvolumeAbsolute(p string) error
- func GetBTRFSStats() ([]*btrfs.Stats, error)
- func Init() error
- func IsBTRFSMounted(folder string) bool
- func MemInfo(procid int) (size, resident, shared int)
- func NetInfo(procid int) (ino, outo int)
- func NewSubvolume(name string, size string) (string, error)
- func NewSubvolumeAbsolute(p string, size string) (string, error)
- func PipeReadStream(connR *bufio.Reader, w io.Writer) error
- func PutConnection(c net.Conn)
- func ReadAllStream(connR *bufio.Reader) ([]byte, error)
- func ReadResponse(connR *bufio.Reader) (success bool, payload []byte, err error)
- func Running(pid int) bool
- func SetQuota(subvolume string, size string) error
- func Snapshot(src string, size string) (string, error)
- func SnapshotAbsolute(src, dest string, size string) error
- func Stop()
- func StreamReadWebsocket(r *websocket.Conn, connW *bufio.Writer) error
- func StreamReader(connW *bufio.Writer, r io.Reader) error
- func StreamWriteWebsocket(wr *websocket.Conn, connR *bufio.Reader) error
- func WriteCommand(connW *bufio.Writer, cmd []byte) error
- type BuildCommand
- type DecrReq
- type ExecutionCommand
- type LogCommand
- type MessageKind
- type OverlayDir
- type ProxyCommand
- type RequestType
- type ResponseHead
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidUserID = errors.New("invalid userid")
Functions ¶
func Connect2 ¶
Use Connect2Any and Connect2 functions to connect to a runner because they will handle wether the runner is local and in the same process or on a remote server
func Connect2Any ¶
Use Connect2Any and Connect2 functions to connect to a runner because they will handle wether the runner is local and in the same process or on a remote server
func DelSubvolume ¶
func DelSubvolumeAbsolute ¶
func GetBTRFSStats ¶
func IsBTRFSMounted ¶
func NewSubvolume ¶
NewSubvolume creates new btrfs subvolume with given quota
func NewSubvolumeAbsolute ¶
NewSubvolumeAbsolute does the same as NewSubvolume but with a subvolume absolute path
func PutConnection ¶
func ReadResponse ¶
func SnapshotAbsolute ¶
func StreamWriteWebsocket ¶
sockMessType is either websocket.TextMessage or websocket.BinaryMessage
Types ¶
type BuildCommand ¶
source code remain in the execution image you can manually delete it in build command
type ExecutionCommand ¶
type LogCommand ¶
type MessageKind ¶
type MessageKind byte
const ( ProxyKind MessageKind = 1 ExecuteKind MessageKind = 2 BuildKind MessageKind = 3 GCExeKind MessageKind = 4 LogKind MessageKind = 5 )
type OverlayDir ¶
type OverlayDir struct { UpperDir string WorkDir string MountPoint string Mounted bool // contains filtered or unexported fields }
OverlayDir is a ready to mount overlaydir and tmp dir
func NewOverlayDir ¶
func NewOverlayDir(uid string) *OverlayDir
NewOverlayDir returns a ready to mount OverlayDir uid is the id of a btrfs subvolume
func (*OverlayDir) Kill ¶
func (o *OverlayDir) Kill()
Kill destroys an OverlayDir and its work folder
func (*OverlayDir) Mount ¶
func (o *OverlayDir) Mount(lowerdirs []string) error
Mount an overlayfs with specified underlying directories
func (*OverlayDir) Resize ¶
func (o *OverlayDir) Resize(sizeM int) error
Resize changes quota for an existing overlaydir
func (*OverlayDir) Umount ¶
func (o *OverlayDir) Umount()
type ProxyCommand ¶
type ProxyCommand struct { ExeID string ReqType RequestType Headers map[string][]string Trailers map[string][]string Method string RemoteAddr string IsHTTPS bool URL string // with https replaced by http and port 8080 }
ProxyCommand is to be used for established http and websocket connections Multipart should work by streaming the entire body without calling parsemultipartform on the LB side
type RequestType ¶
type RequestType uint8
const ( HTTPRequest RequestType = 1 WebsocketRequest RequestType = 2 SSHRequest RequestType = 3 )