-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from waifuvault/3-context-for-requests
context for requests
- Loading branch information
Showing
3 changed files
with
103 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
package mod | ||
|
||
import "context" | ||
|
||
type Waifuvalt interface { | ||
UploadFile(options WaifuvaultPutOpts) (*WaifuResponse[string], error) | ||
FileInfo(token string) (*WaifuResponse[int], error) | ||
FileInfoFormatted(token string) (*WaifuResponse[string], error) | ||
DeleteFile(token string) (bool, error) | ||
GetFile(options GetFileInfo) ([]byte, error) | ||
// UploadFile - Upload a file using a byte array, url or file | ||
UploadFile(ctx context.Context, options WaifuvaultPutOpts) (*WaifuResponse[string], error) | ||
|
||
// FileInfo - Obtain file info such as URL and retention period (as an epoch timestamp) | ||
FileInfo(ctx context.Context, token string) (*WaifuResponse[int], error) | ||
|
||
// FileInfoFormatted - Same as FileInfo, but instead returns the retention period as a human-readable string | ||
FileInfoFormatted(ctx context.Context, token string) (*WaifuResponse[string], error) | ||
|
||
// DeleteFile - Delete a file given a token | ||
DeleteFile(ctx context.Context, token string) (bool, error) | ||
|
||
// GetFile - Download the file given options and return a byte array of said file | ||
GetFile(ctx context.Context, options GetFileInfo) ([]byte, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters