server

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr           string
	DevMode        bool
	Logger         *slog.Logger
	StaticFS       fs.FS // embedded web/dist files for production
	Version        string
	NotifyManager  *notify.Manager
	AgentManager   *agent.Manager
	GroupDMManager *agent.GroupDMManager
}

type Server

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

func New

func New(cfg Config) *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) Serve

func (s *Server) Serve(ln net.Listener) error

func (*Server) ServeTLS

func (s *Server) ServeTLS(ln net.Listener, certFile, keyFile string) error

func (*Server) SetTLSConfig

func (s *Server) SetTLSConfig(tlsCfg *tls.Config)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type WSAttachmentMsg added in v0.5.0

type WSAttachmentMsg struct {
	Type        string                `json:"type"`
	Attachments []*session.Attachment `json:"attachments"`
}

type WSExitMsg

type WSExitMsg struct {
	Type     string `json:"type"`
	ExitCode int    `json:"exitCode"`
	Live     bool   `json:"live"`
}

type WSInputMsg

type WSInputMsg struct {
	Type string `json:"type"`
	Data string `json:"data"` // base64
}

type WSMessage

type WSMessage struct {
	Type string          `json:"type"`
	Data json.RawMessage `json:"data,omitempty"`
}

WebSocket message types

type WSOutputMsg

type WSOutputMsg struct {
	Type string `json:"type"`
	Data string `json:"data"` // base64
}

type WSResizeMsg

type WSResizeMsg struct {
	Type string `json:"type"`
	Cols int    `json:"cols"`
	Rows int    `json:"rows"`
}

type WSScrollbackMsg

type WSScrollbackMsg struct {
	Type string `json:"type"`
	Data string `json:"data"` // base64
}

type WSYoloDebugMsg

type WSYoloDebugMsg struct {
	Type string `json:"type"`
	Tail string `json:"tail"`
}

Jump to

Keyboard shortcuts

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