Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SetBackoff ¶
func (c *Client) SetBackoff(h backoffFunc)
SetBackoff sets a user provided function that is called to provide a backoff duration prior to retransmitting an unacknowledged packet.
func (*Client) SetRetries ¶
SetRetries sets maximum number of attempts client made to transmit a packet. Default is 5 attempts.
func (*Client) SetTimeout ¶
SetTimeout sets maximum time client waits for single network round-trip to succeed. Default is 5 seconds.
type Filer ¶
type Filer struct { Filename string `json:"filename"` // file name MD5 string `json:"md5"` // md5 value of file, take 16 bytes FileSize int64 `json:"filesize"` // file size StartIndex int64 `json:"start_index"` // start index for read or write FileMode uint32 `json:"file_mode"` // file mode ACK uint16 `json:"ack"` // ack code for request State uint8 `json:"state"` // tranfer state }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(readHandler func(filename string, rf io.ReaderFrom) error, writeHandler func(filename string, wt io.WriterTo) error) *Server
NewServer creates SFTP server. It requires two functions to handle read and write requests. In case nil is provided for read or write handler the respective operation is disabled.
func (*Server) ListenAndServe ¶
ListenAndServe binds to address provided and start the server. ListenAndServe returns when Shutdown is called.
func (*Server) Serve ¶
Serve starts server provided already opened UDP connecton. It is useful for the case when you want to run server in separate goroutine but still want to be able to handle any errors opening connection. Serve returns when Shutdown is called or connection is closed.
func (*Server) SetBackoff ¶
func (s *Server) SetBackoff(h backoffFunc)
SetBackoff sets a user provided function that is called to provide a backoff duration prior to retransmitting an unacknowledged packet.
func (*Server) SetRetries ¶
SetRetries sets maximum number of attempts server made to transmit a packet. Default is 5 attempts.
func (*Server) SetTimeout ¶
SetTimeout sets maximum time server waits for single network round-trip to succeed. Default is 5 seconds.