Documentation ¶
Overview ¶
Package transfer handles all logic related to transferring servers between two nodes. This includes the logic for archiving a server on the source node and logic for importing a server from the source node into the target node.
Index ¶
- type Archive
- type Manager
- type Status
- type Transfer
- func (t *Transfer) Archive() (*Archive, error)
- func (t *Transfer) Cancel()
- func (t *Transfer) Context() context.Context
- func (t *Transfer) Error(err error, v string)
- func (t *Transfer) Log() *log.Entry
- func (t *Transfer) PushArchiveToTarget(url, token string) ([]byte, error)
- func (t *Transfer) SendMessage(v string)
- func (t *Transfer) SetStatus(s Status)
- func (t *Transfer) Status() Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
Archive represents an archive used to transfer the contents of a server.
func NewArchive ¶
NewArchive returns a new archive associated with the given transfer.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages transfers.
func Incoming ¶
func Incoming() *Manager
Incoming returns a transfer manager for incoming transfers.
func Outgoing ¶
func Outgoing() *Manager
Outgoing returns a transfer manager for outgoing transfers.
type Status ¶
type Status string
Status represents the current status of a transfer.
const ( // StatusPending is the status of a transfer when it is first created. StatusPending Status = "pending" // StatusProcessing is the status of a transfer when it is currently in // progress, such as when the archive is being streamed to the target node. StatusProcessing Status = "processing" // StatusCancelling is the status of a transfer when it is in the process of // being cancelled. StatusCancelling Status = "cancelling" // StatusCancelled is the final status of a transfer when it has been // cancelled. StatusCancelled Status = "cancelled" // StatusFailed is the final status of a transfer when it has failed. StatusFailed Status = "failed" // StatusCompleted is the final status of a transfer when it has completed. StatusCompleted Status = "completed" )
type Transfer ¶
type Transfer struct { // Server associated with the transfer. Server *server.Server // contains filtered or unexported fields }
Transfer represents a transfer of a server from one node to another.
func (*Transfer) Archive ¶
Archive returns an archive that can be used to stream the contents of the contents of a server.
func (*Transfer) PushArchiveToTarget ¶
PushArchiveToTarget POSTs the archive to the target node and returns the response body.
func (*Transfer) SendMessage ¶
SendMessage sends a message to the server's console.