Add share object api (#335)

This commit is contained in:
Cesar N
2020-10-22 11:18:27 -07:00
committed by GitHub
parent 0c43e5c3f4
commit 1466632fd6
10 changed files with 825 additions and 4 deletions

View File

@@ -143,6 +143,7 @@ type MCClient interface {
remove(ctx context.Context, isIncomplete, isRemoveBucket, isBypass bool, contentCh <-chan *mc.ClientContent) <-chan *probe.Error
list(ctx context.Context, opts mc.ListOptions) <-chan *mc.ClientContent
get(ctx context.Context, opts mc.GetOptions) (io.ReadCloser, *probe.Error)
shareDownload(ctx context.Context, versionID string, expires time.Duration) (string, *probe.Error)
}
// Interface implementation
@@ -183,6 +184,10 @@ func (c mcClient) get(ctx context.Context, opts mc.GetOptions) (io.ReadCloser, *
return c.client.Get(ctx, opts)
}
func (c mcClient) shareDownload(ctx context.Context, versionID string, expires time.Duration) (string, *probe.Error) {
return c.client.ShareDownload(ctx, versionID, expires)
}
// ConsoleCredentials interface with all functions to be implemented
// by mock when testing, it should include all needed consoleCredentials.Login api calls
// that are used within this project.