server

package
v0.0.0-...-fbf1687 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendJSONMessage

func SendJSONMessage(ctx context.Context, conn *websocket.Conn, v interface{}) error

SendJSONMessage marshals a struct and sends it over a WebSocket connection.

Types

type Message

type Message struct {
	MsgType string `json:"msgType"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(logger *zerolog.Logger) *Server

func (*Server) AddCommand

func (s *Server) AddCommand(id string, cmd command.Command)

func (*Server) AddTerminal

func (s *Server) AddTerminal(id string, t terminal.TTY)

func (*Server) GetCommand

func (s *Server) GetCommand(id string) (command.Command, bool)

func (*Server) GetTerminal

func (s *Server) GetTerminal(id string) (terminal.TTY, bool)

func (*Server) RemoveCommand

func (s *Server) RemoveCommand(id string)

func (*Server) RemoveTerminal

func (s *Server) RemoveTerminal(id string)

func (*Server) Start

func (s *Server) Start(addr string)

Jump to

Keyboard shortcuts

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