server

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSHFlagPrefix    = "ssh"
	TelnetFlagPrefix = "telnet"
	APIFlagPrefix    = "api"
	EnabledFlag      = "-enabled"
	AddressFlag      = "-address"

	SSHHostKeyPathFlag = SSHFlagPrefix + "-host-key"
	SSHHostKeyDataFlag = SSHFlagPrefix + "-host-key-data"

	ConcurrentStreamsFlag = "concurrent-streams"
	TimeoutFlag           = "timeout"
	IdleTimeoutFlag       = "idle-timeout"
	MaxTimeoutFlag        = "max-timeout"
)

Variables

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

Functions

func ErrorText added in v1.6.0

func ErrorText(err error) string

func Flags

func Flags(flags *flag.FlagSet)

func LoadDeprecated added in v1.8.0

func LoadDeprecated(flags *flag.FlagSet)

func RemoteIP added in v1.8.0

func RemoteIP(addr net.Addr) string

Types

type APIServer added in v1.8.0

type APIServer struct {
	Server
	TelnetEnabled bool
	SSHEnabled    bool
}

func NewAPI added in v1.8.0

func NewAPI(flags *flag.FlagSet) APIServer

func (*APIServer) Health added in v1.8.0

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

func (*APIServer) Listen added in v1.8.0

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

func (*APIServer) Streams added in v1.8.0

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

type HealthResponse added in v1.5.0

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

type Info added in v1.5.2

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

func NewInfo added in v1.5.2

func NewInfo() Info

func (*Info) GetStreams added in v1.5.2

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

func (*Info) NumActive added in v1.5.2

func (s *Info) NumActive() int

func (*Info) StreamConnect added in v1.5.2

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

func (*Info) StreamDisconnect added in v1.5.2

func (s *Info) StreamDisconnect(id uint)

type MovieServer added in v1.4.0

type MovieServer struct {
	Server
	Movie *movie.Movie
}

func NewMovieServer added in v1.4.0

func NewMovieServer(flags *flag.FlagSet, prefix string) MovieServer

type SSHServer added in v1.4.0

type SSHServer struct {
	MovieServer
	HostKeyPath []string
	HostKeyPEM  []string
}

func NewSSH

func NewSSH(flags *flag.FlagSet) SSHServer

func (*SSHServer) Handler added in v1.4.0

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

func (*SSHServer) Listen added in v1.4.0

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

func (*SSHServer) TrackStream added in v1.5.1

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

type Server added in v1.4.0

type Server struct {
	Enabled bool
	Address string
	Log     *slog.Logger
}

func NewServer added in v1.4.0

func NewServer(flags *flag.FlagSet, prefix string) Server

type Stream added in v1.5.1

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

type StreamsResponse added in v1.5.0

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

type TelnetServer added in v1.4.0

type TelnetServer struct {
	MovieServer
}

func NewTelnet

func NewTelnet(flags *flag.FlagSet) TelnetServer

func (*TelnetServer) Handler added in v1.4.0

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

func (*TelnetServer) Listen added in v1.4.0

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