-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.tea
66 lines (58 loc) · 1.6 KB
/
main.tea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* This is a utility module
*/
/**
* Get timestamp
* @return the string
* @example 2006-01-02T15:04:05Z
* @error no error throws
*/
static function getTimestamp(): string;
/**
* Judge if the api called success or not
* @param res the response string
* @param secret the accesskey secret string
* @return the boolean
* @example true
* @error no error throws
*/
static function hasError(res: string, secret: string): boolean;
/**
* Calculate signature according to signedParams and secret
* @param signedParams the signed string
* @param secret the accesskey secret
* @return the signature string
* @example qlB4B1lFcehlWRelL7Fo4uNHPCs=
* @error no error throws
*/
static function getSignature(signedParams: map[string]string, secret: string): string;
/**
* Upload item with urlPath
* @param item the file
* @param urlPath the upload url
*/
static async function putObject(item: readable, headers: map[string]string, urlPath: string) throws: void;
/**
* Parse headers into map[string]string
* @param headers the target headers
* @return the map[string]string
*/
static function parseUploadHeaders(headers: any): map[string]string;
/**
* Generate a nonce string
* @return the nonce string
*/
static function getNonce(): string;
/**
* Judge upload if ok or not
* @return the boolean
* @example resultCode == successCode or resultCode == ok is true
* @error no error throws
*/
static function isSuccess(resultCode: string, successCode: string): boolean;
/**
* add tow integer
* @return the integer
* @error no error throws
*/
static function addInteger(num: integer, num1: integer): integer;