Documentation
¶
Index ¶
- Constants
- func NewNerdalizeCredentials(c *client.NerdAPIClient) *credentials.Credentials
- type DataClient
- func (client *DataClient) DownloadFile(key, outFile string) error
- func (client *DataClient) DownloadFiles(root string, outDir string, kw KeyWriter, concurrency int) error
- func (client *DataClient) ListObjects(root string) (keys []string, err error)
- func (client *DataClient) UploadDir(dir string, root string, kw KeyWriter, concurrency int) error
- func (client *DataClient) UploadFile(filePath string, key string, root string) error
- func (client *DataClient) UploadFiles(files []string, keys []string, root string, kw KeyWriter, concurrency int) error
- type DataClientConfig
- type KeyWriter
- type Provider
Constants ¶
const DirectoryPermissions = 0755
DirectoryPermissions are the permissions when a new directory is created upon file download.
const ProviderName = `NerdalizeProvider`
ProviderName is the name of the credentials provider.
Variables ¶
This section is empty.
Functions ¶
func NewNerdalizeCredentials ¶
func NewNerdalizeCredentials(c *client.NerdAPIClient) *credentials.Credentials
NewNerdalizeCredentials creates a new credentials object with the NerdalizeProvider as provider.
Types ¶
type DataClient ¶
type DataClient struct { Session *session.Session *DataClientConfig }
DataClient holds a reference to an AWS session
func NewDataClient ¶
func NewDataClient(conf *DataClientConfig) (*DataClient, error)
NewDataClient creates a new data client that is capable of uploading and downloading (multiple) files.
func (*DataClient) DownloadFile ¶
func (client *DataClient) DownloadFile(key, outFile string) error
DownloadFile downloads a single file.
func (*DataClient) DownloadFiles ¶
func (client *DataClient) DownloadFiles(root string, outDir string, kw KeyWriter, concurrency int) error
DownloadFiles concurrently downloads all files in a given s3 root path.
func (*DataClient) ListObjects ¶
func (client *DataClient) ListObjects(root string) (keys []string, err error)
ListObjects lists all keys for a given root.
func (*DataClient) UploadDir ¶
UploadDir uploads every single file in the directory and all its subdirectories.
func (*DataClient) UploadFile ¶
func (client *DataClient) UploadFile(filePath string, key string, root string) error
UploadFile uploads a single file.
func (*DataClient) UploadFiles ¶
func (client *DataClient) UploadFiles(files []string, keys []string, root string, kw KeyWriter, concurrency int) error
UploadFiles uploads a list of files concurrently.
type DataClientConfig ¶
type DataClientConfig struct { Credentials *credentials.Credentials Bucket string }
DataClientConfig provides config details to create a new DataClient.
type Provider ¶
type Provider struct { credentials.Expiry ExpiryWindow time.Duration Client *client.NerdAPIClient }
Provider satisfies the credentials.Provider interface, and is a client to retrieve credentials from the nerdalize api.