Documentation
¶
Index ¶
- type DispatcherFileOperator
- func (o *DispatcherFileOperator) CreateDirectory(volumeName string, path string) error
- func (o *DispatcherFileOperator) DeletePath(volumeName string, path string) error
- func (o *DispatcherFileOperator) ListFiles(volumeName string, path string) ([]FileEntry, error)
- func (o *DispatcherFileOperator) ReadFile(volumeName string, path string) ([]byte, error)
- func (o *DispatcherFileOperator) RenamePath(volumeName string, from string, to string) error
- func (o *DispatcherFileOperator) WriteFile(volumeName string, path string, content []byte, perm os.FileMode) error
- type FileEntry
- type FileOperator
- type FileOperatorFactory
- type GameserverLookup
- type LocalAuth
- type RemoteAuth
- type SFTPAuth
- type Server
- type WorkerFileOperator
- func (o *WorkerFileOperator) CreateDirectory(volumeName string, path string) error
- func (o *WorkerFileOperator) DeletePath(volumeName string, path string) error
- func (o *WorkerFileOperator) ListFiles(volumeName string, path string) ([]FileEntry, error)
- func (o *WorkerFileOperator) ReadFile(volumeName string, path string) ([]byte, error)
- func (o *WorkerFileOperator) RenamePath(volumeName string, from string, to string) error
- func (o *WorkerFileOperator) WriteFile(volumeName string, path string, content []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DispatcherFileOperator ¶
type DispatcherFileOperator struct {
// contains filtered or unexported fields
}
DispatcherFileOperator routes file operations through the dispatcher to the correct worker. Used on controller/standalone nodes where SFTP needs to reach remote workers.
func NewDispatcherFileOperator ¶
func NewDispatcherFileOperator(dispatcher *orchestrator.Dispatcher, gameserverID string) *DispatcherFileOperator
func (*DispatcherFileOperator) CreateDirectory ¶
func (o *DispatcherFileOperator) CreateDirectory(volumeName string, path string) error
func (*DispatcherFileOperator) DeletePath ¶
func (o *DispatcherFileOperator) DeletePath(volumeName string, path string) error
func (*DispatcherFileOperator) ListFiles ¶
func (o *DispatcherFileOperator) ListFiles(volumeName string, path string) ([]FileEntry, error)
func (*DispatcherFileOperator) ReadFile ¶
func (o *DispatcherFileOperator) ReadFile(volumeName string, path string) ([]byte, error)
func (*DispatcherFileOperator) RenamePath ¶
func (o *DispatcherFileOperator) RenamePath(volumeName string, from string, to string) error
type FileOperator ¶
type FileOperator interface {
ListFiles(volumeName string, path string) ([]FileEntry, error)
ReadFile(volumeName string, path string) ([]byte, error)
WriteFile(volumeName string, path string, content []byte, perm os.FileMode) error
DeletePath(volumeName string, path string) error
CreateDirectory(volumeName string, path string) error
RenamePath(volumeName string, from string, to string) error
}
FileOperator abstracts volume-level file operations for the SFTP handler.
type FileOperatorFactory ¶
type FileOperatorFactory func(gameserverID string) FileOperator
FileOperatorFactory creates a FileOperator for a given session. On workers, this returns the same WorkerFileOperator each time. On controllers, this creates a DispatcherFileOperator scoped to the gameserver.
type GameserverLookup ¶
type GameserverLookup interface {
GetGameserverBySFTPUsername(username string) (*model.Gameserver, error)
}
GameserverLookup abstracts the DB query needed for SFTP auth.
type LocalAuth ¶
type LocalAuth struct {
// contains filtered or unexported fields
}
LocalAuth validates SFTP credentials directly against the database. Used on standalone and controller nodes.
func NewLocalAuth ¶
func NewLocalAuth(store GameserverLookup) *LocalAuth
type RemoteAuth ¶
type RemoteAuth struct {
// contains filtered or unexported fields
}
RemoteAuth validates SFTP credentials by calling back to the controller via gRPC. Used on worker nodes.
func NewRemoteAuth ¶
func NewRemoteAuth(client pb.ControllerServiceClient) *RemoteAuth
func (*RemoteAuth) ValidateLogin ¶
func (a *RemoteAuth) ValidateLogin(username, password string) (string, string, error)
type SFTPAuth ¶
type SFTPAuth interface {
ValidateLogin(username, password string) (gameserverID string, volumeName string, err error)
}
SFTPAuth validates SFTP login credentials and returns the gameserver ID and volume name.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
type WorkerFileOperator ¶
type WorkerFileOperator struct {
// contains filtered or unexported fields
}
WorkerFileOperator adapts a worker.Worker to the FileOperator interface. Used on worker nodes where file operations are local.
func NewWorkerFileOperator ¶
func NewWorkerFileOperator(w worker.Worker) *WorkerFileOperator
func (*WorkerFileOperator) CreateDirectory ¶
func (o *WorkerFileOperator) CreateDirectory(volumeName string, path string) error
func (*WorkerFileOperator) DeletePath ¶
func (o *WorkerFileOperator) DeletePath(volumeName string, path string) error
func (*WorkerFileOperator) ListFiles ¶
func (o *WorkerFileOperator) ListFiles(volumeName string, path string) ([]FileEntry, error)
func (*WorkerFileOperator) ReadFile ¶
func (o *WorkerFileOperator) ReadFile(volumeName string, path string) ([]byte, error)
func (*WorkerFileOperator) RenamePath ¶
func (o *WorkerFileOperator) RenamePath(volumeName string, from string, to string) error