ssh

package
v0.0.0-...-51d4900 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitShellService

type GitShellService interface {
	HandleGitCommand(ctx context.Context, command string, repoPath string, stdin io.Reader, stdout, stderr io.Writer) error
}

GitShellService defines git shell operations

func NewGitShellService

func NewGitShellService(logger *logrus.Logger) GitShellService

NewGitShellService creates a new git shell service

type RepositoryService

type RepositoryService interface {
	Get(ctx context.Context, owner, name string) (*models.Repository, error)
	GetRepositoryPath(ctx context.Context, repoID uuid.UUID) (string, error)
}

RepositoryService defines the interface needed by SSH server for repository operations

func NewRepositoryServiceAdapter

func NewRepositoryServiceAdapter(repoService services.RepositoryService) RepositoryService

NewRepositoryServiceAdapter creates a new adapter

type SSHServer

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

SSHServer represents the SSH server for git operations

func NewSSHServer

func NewSSHServer(
	config SSHServerConfig,
	repositoryService RepositoryService,
	gitService GitShellService,
	logger *logrus.Logger,
	db *gorm.DB,
) (*SSHServer, error)

NewSSHServer creates a new SSH server instance

func (*SSHServer) Start

func (s *SSHServer) Start(ctx context.Context) error

Start starts the SSH server

func (*SSHServer) Stop

func (s *SSHServer) Stop() error

Stop stops the SSH server

type SSHServerConfig

type SSHServerConfig struct {
	Port        int    `mapstructure:"port"`
	HostKeyPath string `mapstructure:"host_key_path"`
}

SSHServerConfig holds SSH server configuration

Jump to

Keyboard shortcuts

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