code

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code struct {
	sync.RWMutex
	Name string
	// contains filtered or unexported fields
}

Code code-server handler

func New

func New(cfg *global.Rule, readTimeout, writeTimeout time.Duration) *Code

New new code-server handler

func (*Code) Forward

func (code *Code) Forward(conn *conn.Conn, w http.ResponseWriter, r *http.Request)

Forward forward code-server requests

func (code *Code) GetLinks() []rule.Link

GetLinks get rule links

func (*Code) GetName

func (code *Code) GetName() string

GetName get code-server rule name

func (*Code) GetPort

func (code *Code) GetPort() uint16

GetPort get listen port

func (*Code) GetRemote

func (code *Code) GetRemote() string

GetRemote get remote target name

func (*Code) GetTarget

func (code *Code) GetTarget() string

GetTarget get target of this rule

func (*Code) GetTypeName

func (code *Code) GetTypeName() string

GetTypeName get code-server rule type name

func (*Code) Handle

func (code *Code) Handle(c *conn.Conn)

Handle handle code-server

func (*Code) Info

func (code *Code) Info(w http.ResponseWriter, r *http.Request)

Info get workspace info

func (*Code) New

func (code *Code) New(conn *conn.Conn, w http.ResponseWriter, r *http.Request)

New new code-server workspace

func (code *Code) NewLink(id, remote string, localConn net.Conn, remoteConn *conn.Conn) rule.Link

NewLink new link

func (*Code) OnDisconnect

func (code *Code) OnDisconnect(id string)

OnDisconnect on disconnect message

func (*Code) Render

func (code *Code) Render(conn *conn.Conn, w http.ResponseWriter, r *http.Request)

Render render code-server

type Workspace

type Workspace struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Workspace workspace of code-server

func (*Workspace) Close

func (ws *Workspace) Close(send bool)

Close close workspace

func (*Workspace) Exec

func (ws *Workspace) Exec(dir string) error

Exec execute code-server

func (*Workspace) Forward

func (ws *Workspace) Forward()

Forward forward data from remote node

func (*Workspace) GetBytes

func (ws *Workspace) GetBytes() (uint64, uint64)

GetBytes get send and recv bytes

func (*Workspace) GetID

func (ws *Workspace) GetID() string

GetID get link id

func (*Workspace) GetPackets

func (ws *Workspace) GetPackets() (uint64, uint64)

GetPackets get send and recv packets

func (*Workspace) SendConnect

func (ws *Workspace) SendConnect(r *http.Request) (uint64, error)

SendConnect send websocket connect action from local node

func (*Workspace) SendData

func (ws *Workspace) SendData(reqID uint64, ok bool, t int, body []byte)

SendData send websocket data

func (*Workspace) SendRequest

func (ws *Workspace) SendRequest(r *http.Request) (uint64, error)

SendRequest send request from local node

Jump to

Keyboard shortcuts

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