Documentation ¶
Overview ¶
universal-network-adapter models
Index ¶
- type Blob
- type Credentials
- type Destination
- type ParsedDestination
- func (pd *ParsedDestination) GetHost() string
- func (pd *ParsedDestination) GetPassword() string
- func (pd *ParsedDestination) GetPath() string
- func (pd *ParsedDestination) GetRsaPrivateKey() (ssh.Signer, error)
- func (pd *ParsedDestination) GetScheme() string
- func (pd *ParsedDestination) GetUser() string
- type RemoteFile
- type RemoteFileContent
- type TLSMode
- type UnaError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct { // путь до файла FilePath string // contains filtered or unexported fields }
Wrapper around remote file, implementing io.ReadCloser
type Credentials ¶
type Credentials struct { // username User string // password Password string // sftp private key RsaPrivateKey string // sftp private key passphrase RsaPrivateKeyPassphrase string TLSConfig *tls.Config TLSMode TLSMode }
Credentials to authorize on remote server
type Destination ¶
type Destination struct { // remote file/dir url. Should start with protocol Url string // credentials to access the remote file/dir Credentials *Credentials // connection timeout Timeout time.Duration }
Model of remote file/dir on remote server to be browsed/downloaded
func NewDestination ¶
func NewDestination(url string, credentials *Credentials, timeout *time.Duration) *Destination
Constructor for Destination
type ParsedDestination ¶
type ParsedDestination struct { // remote file/dir url Url string // credentials to access the remote file/dir Credentials Credentials // Url parsed by using net/url parser ParsedUrl *goUrl.URL // connection timeout. Defaults to 30 seconds, if NewDestination is used Timeout time.Duration }
Processed Destination model for internal usage in universal network adapter
func ParseDestination ¶
func ParseDestination(destination *Destination) (*ParsedDestination, error)
parses Destination to ParsedDestination
func (*ParsedDestination) GetHost ¶
func (pd *ParsedDestination) GetHost() string
returns URL hostname
func (*ParsedDestination) GetPassword ¶
func (pd *ParsedDestination) GetPassword() string
returns password from parsed Credentials
func (*ParsedDestination) GetRsaPrivateKey ¶
func (pd *ParsedDestination) GetRsaPrivateKey() (ssh.Signer, error)
returns RSA private key for sftp connect from parsed Credentials
func (*ParsedDestination) GetScheme ¶
func (pd *ParsedDestination) GetScheme() string
returns URL protocol
func (*ParsedDestination) GetUser ¶
func (pd *ParsedDestination) GetUser() string
returns user from parsed Credentials
type RemoteFile ¶
type RemoteFile struct { // filename Name string // filepath Path string // remote file parsed destination model ParsedDestination *ParsedDestination `json:"-"` // file size, bytes Size int64 // file modification date Lastmod time.Time }
Remote file model
func NewRemoteFile ¶
func NewRemoteFile(destination *Destination) (*RemoteFile, error)
Constructor for RemoteFile
type RemoteFileContent ¶
type RemoteFileContent struct { // filename Name string // filepath Path string // io.ReadCloser to read remote file content Blob io.ReadCloser }
Downloaded remote file content model
Click to show internal directories.
Click to hide internal directories.