Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileDescription ¶
type ObjectStorage ¶
type ObjectStorage struct {
RemoteConfig *FileDescription
}
func NewObjectStorage ¶
func NewObjectStorage(conn *legionv1alpha1.ConnectionSpec) (obj *ObjectStorage, err error)
func (*ObjectStorage) Download ¶
func (os *ObjectStorage) Download(localPath, remotePath string) error
Downloads files from connection specific storage to the local filesystem. Non-empty "remotePath" overrides the connection URI path. For example, we have the following bucket structure:
- /data/text.txt
A connection has "gs://bucket-name/data" URI structure. The function with following parameters localPath="data/sync_dir/" remotePath="" downloads file to the "data/sync_dir/text.txt" location. The function with following parameters localPath="data/sync_dir/" remotePath="/data/text.txt" downloads file to the "data/sync_dir/text.txt" location. The function with following parameters localPath="data/sync_dir/renamed-text.txt" remotePath="/data/text.txt" downloads file to the "data/sync_dir/text.txt" location. If remotePath point to a directory then localPath must point to a directory too.
func (*ObjectStorage) Upload ¶
func (os *ObjectStorage) Upload(localPath, remotePath string) error
Uploads files to connection specific storage from the local filesystem. Non-empty "remotePath" overrides the connection URI path. For example, we have the following local filesystem structure:
- /data/text.txt
A connection has "gs://bucket-name/sync_dir/" URI structure. The function with following parameters localPath="data/" remotePath="" downloads file to the "gs://bucket-name/sync_dir/text.txt" bucket location. The function with following parameters localPath="data/" remotePath="/sync_dir/" downloads file to the "gs://bucket-name/sync_dir/text.txt" bucket location. The function with following parameters localPath="data/text.txt" remotePath="/sync_dir/renamed-text.txt" downloads file to the "gs://bucket-name/sync_dir/renamed-text.txt" bucket location. If localPath point to a directory then remotePath must point to a directory too.