1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-03 09:03:50 +00:00

Implement Yandex storage backend - fixes #234

This commit is contained in:
dibu28
2015-12-07 10:01:03 +06:00
committed by Nick Craig-Wood
parent 8ea0d5212f
commit 3ac4407b88
35 changed files with 1952 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package src
// HTTPRequest struct
type HTTPRequest struct {
Method string
Path string
Parameters map[string]interface{}
Headers map[string][]string
}
func createGetRequest(client *Client, path string, params map[string]interface{}) *HTTPRequest {
return createRequest(client, "GET", path, params)
}
func createPostRequest(client *Client, path string, params map[string]interface{}) *HTTPRequest {
return createRequest(client, "POST", path, params)
}
func createRequest(client *Client, method string, path string, parameters map[string]interface{}) *HTTPRequest {
var headers = make(map[string][]string)
headers["Authorization"] = []string{"OAuth " + client.token}
return &HTTPRequest{
Method: method,
Path: path,
Parameters: parameters,
Headers: headers,
}
}