server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server represents the SSH hypervisor server

func NewServer

func NewServer(config *internal.Config, logger logrus.FieldLogger) (*Server, error)

NewServer creates a new SSH hypervisor server

func (*Server) Run

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

Run starts the SSH server

type UserStat

type UserStat struct {
	Username      string    `json:"username"`
	ConnectCount  int       `json:"connect_count"`
	LastConnected time.Time `json:"last_connected"`
}

UserStat represents connection statistics for a single user

type UserStats

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

UserStats manages user connection statistics

func NewUserStats

func NewUserStats(dataDir string) *UserStats

NewUserStats creates a new UserStats manager

func (*UserStats) GetRecentUsers

func (us *UserStats) GetRecentUsers(excludeUser string, limit int) []*UserStat

GetRecentUsers returns the most recent users (excluding the current user)

func (*UserStats) GetUserStat

func (us *UserStats) GetUserStat(username string) (*UserStat, bool)

GetUserStat returns statistics for a specific user

func (*UserStats) IsFirstTime

func (us *UserStats) IsFirstTime(username string) bool

IsFirstTime returns true if this is the user's first connection

func (*UserStats) Load

func (us *UserStats) Load() error

Load reads user statistics from the JSON file

func (*UserStats) RecordConnection

func (us *UserStats) RecordConnection(username string)

RecordConnection records a user connection

func (*UserStats) Save

func (us *UserStats) Save() error

Save writes user statistics to the JSON file

Jump to

Keyboard shortcuts

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