server

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRateLimited = errors.New("rate limited")

Functions

func ErrorText

func ErrorText(err error) string

func RemoteIP

func RemoteIP(addr net.Addr) string

Types

type APIServer

type APIServer struct {
	Server
	TelnetEnabled bool
	SSHEnabled    bool
}

func NewAPI

func NewAPI(conf *config.Config) APIServer

func (*APIServer) Health

func (s *APIServer) Health(w http.ResponseWriter, _ *http.Request)

func (*APIServer) Listen

func (s *APIServer) Listen(ctx context.Context) error

func (*APIServer) Streams

func (s *APIServer) Streams(w http.ResponseWriter, r *http.Request)

type HealthResponse

type HealthResponse struct {
	Healthy bool `json:"healthy"`
	SSH     bool `json:"ssh"`
	Telnet  bool `json:"telnet"`
}

type Info

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

func NewInfo

func NewInfo(conf *config.Config) *Info

func (*Info) GetStreams

func (s *Info) GetStreams() []Stream

func (*Info) NumActive

func (s *Info) NumActive() int

func (*Info) StreamConnect

func (s *Info) StreamConnect(server, remoteIP string) (uint, error)

func (*Info) StreamDisconnect

func (s *Info) StreamDisconnect(id uint)

type SSHServer

type SSHServer struct {
	Server
}

func NewSSH

func NewSSH(conf *config.Config, info *Info) SSHServer

func (*SSHServer) Handler

func (s *SSHServer) Handler(m *movie.Movie) bubbletea.Handler

func (*SSHServer) Listen

func (s *SSHServer) Listen(ctx context.Context, m *movie.Movie) error

func (*SSHServer) TrackStream

func (s *SSHServer) TrackStream(handler ssh.Handler) ssh.Handler

type Server

type Server struct {
	Info  *Info
	Log   *slog.Logger
	Movie *movie.Movie
	// contains filtered or unexported fields
}

func NewServer

func NewServer(conf *config.Config, server string, info *Info) Server

type Stream

type Stream struct {
	Server    string    `json:"server"`
	RemoteIP  string    `json:"remote_ip"`
	Connected time.Time `json:"connected"`
}

type StreamsResponse

type StreamsResponse struct {
	Active  *int      `json:"active,omitempty"`
	Total   *uint32   `json:"total,omitempty"`
	Streams *[]Stream `json:"streams,omitempty"`
}

type TelnetServer

type TelnetServer struct {
	Server
}

func NewTelnet

func NewTelnet(conf *config.Config, info *Info) TelnetServer

func (*TelnetServer) Handler

func (s *TelnetServer) Handler(ctx context.Context, conn net.Conn, m *movie.Movie)

func (*TelnetServer) Listen

func (s *TelnetServer) Listen(ctx context.Context, m *movie.Movie) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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