Documentation
¶
Index ¶
- Constants
- Variables
- type Conflict
- type Directory
- type FileEntry
- type Manager
- func (m *Manager) CancelTransfer(id string) error
- func (m *Manager) ClearCompleted(sessionID string)
- func (m *Manager) Close(id string) error
- func (m *Manager) CloseAll() error
- func (m *Manager) HasActiveTransfers() bool
- func (m *Manager) HomeDirectory(id string) (string, error)
- func (m *Manager) List() []StateEvent
- func (m *Manager) ListTransfers(sessionID string) []TransferEvent
- func (m *Manager) MakeDirectory(id, directory string) error
- func (m *Manager) ReadDirectory(id, directory string) (Directory, error)
- func (m *Manager) Remove(id string, paths []string) error
- func (m *Manager) Rename(id, source, newName string) error
- func (m *Manager) ResolveConflict(id, choice string, applyToBatch bool) error
- func (m *Manager) RetryTransfer(id string) (TransferEvent, error)
- func (m *Manager) Start(parent context.Context, request StartRequest) (StateEvent, error)
- func (m *Manager) StartTransfer(request TransferRequest) ([]TransferEvent, error)
- type OpenFunc
- type OpenOptions
- type Permissions
- type Preparer
- type RemoteClient
- type StartRequest
- type StateEvent
- type TransferEvent
- type TransferRequest
Constants ¶
View Source
const ( StatusConnecting = "connecting" StatusActive = "active" StatusClosed = "closed" StatusFailed = "failed" )
Variables ¶
View Source
var ErrSessionNotActive = errors.New("SFTP session is not active")
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
Prepare Preparer
HostKeyCallback func(context.Context) (ssh.HostKeyCallback, error)
Open OpenFunc
Timeout time.Duration
EmitState func(StateEvent)
EmitTransfer func(TransferEvent)
// contains filtered or unexported fields
}
func (*Manager) CancelTransfer ¶
func (*Manager) ClearCompleted ¶
func (*Manager) HasActiveTransfers ¶
func (*Manager) List ¶
func (m *Manager) List() []StateEvent
func (*Manager) ListTransfers ¶
func (m *Manager) ListTransfers(sessionID string) []TransferEvent
func (*Manager) MakeDirectory ¶
func (*Manager) ReadDirectory ¶
func (*Manager) ResolveConflict ¶
func (*Manager) RetryTransfer ¶
func (m *Manager) RetryTransfer(id string) (TransferEvent, error)
func (*Manager) Start ¶
func (m *Manager) Start(parent context.Context, request StartRequest) (StateEvent, error)
func (*Manager) StartTransfer ¶
func (m *Manager) StartTransfer(request TransferRequest) ([]TransferEvent, error)
type OpenFunc ¶
type OpenFunc func(context.Context, OpenOptions) (RemoteClient, error)
type OpenOptions ¶
type OpenOptions struct {
Connection jumpserver.ClientConnection
Asset jumpserver.AssetDetail
Account jumpserver.Account
HostKeyCallback ssh.HostKeyCallback
Timeout time.Duration
}
type Permissions ¶
type Preparer ¶
type Preparer interface {
Prepare(context.Context, connectapp.Options) (connectapp.Prepared, error)
}
type RemoteClient ¶
type RemoteClient interface {
Getwd() (string, error)
RealPath(string) (string, error)
InitialDirectory(string) (string, error)
ReadDir(string) ([]os.FileInfo, error)
Lstat(string) (os.FileInfo, error)
Open(string) (io.ReadCloser, error)
OpenFile(string, int) (io.WriteCloser, error)
Mkdir(string) error
Rename(string, string) error
Remove(string) error
RemoveDirectory(string) error
Close() error
Wait() error
}
type StartRequest ¶
type StateEvent ¶
type StateEvent struct {
Asset string `json:"asset"`
Permissions *Permissions `json:"permissions,omitempty"`
ID string `json:"id"`
Status string `json:"status"`
Title string `json:"title"`
Profile string `json:"profile"`
Organization string `json:"organization"`
Target string `json:"target"`
Alias string `json:"alias"`
AssetID string `json:"assetId"`
AssetName string `json:"assetName"`
Account string `json:"account"`
Directory string `json:"directory"`
Error string `json:"error"`
}
type TransferEvent ¶
type TransferEvent struct {
ID string `json:"id"`
BatchID string `json:"batchId"`
SessionID string `json:"sessionId"`
Direction string `json:"direction"`
Name string `json:"name"`
Source string `json:"source"`
Destination string `json:"destination"`
Status string `json:"status"`
Transferred int64 `json:"transferred"`
Total int64 `json:"total"`
Error string `json:"error"`
Conflict *Conflict `json:"conflict,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.