NewKey construct cache key from provided parameters with default version number
(query []byte, originParams url.Values, acceptEncoding string, userParamsHash uint32, queryParamsHash uint32, userCredentialHash uint32)
| 62 | |
| 63 | // NewKey construct cache key from provided parameters with default version number |
| 64 | func NewKey(query []byte, originParams url.Values, acceptEncoding string, userParamsHash uint32, queryParamsHash uint32, userCredentialHash uint32) *Key { |
| 65 | return &Key{ |
| 66 | Query: query, |
| 67 | AcceptEncoding: acceptEncoding, |
| 68 | ClientProtocolVersion: originParams.Get("client_protocol_version"), |
| 69 | DefaultFormat: originParams.Get("default_format"), |
| 70 | Database: originParams.Get("database"), |
| 71 | Compress: originParams.Get("compress"), |
| 72 | EnableHTTPCompression: originParams.Get("enable_http_compression"), |
| 73 | Namespace: originParams.Get("cache_namespace"), |
| 74 | Extremes: originParams.Get("extremes"), |
| 75 | MaxResultRows: originParams.Get("max_result_rows"), |
| 76 | ResultOverflowMode: originParams.Get("result_overflow_mode"), |
| 77 | UserParamsHash: userParamsHash, |
| 78 | Version: Version, |
| 79 | QueryParamsHash: queryParamsHash, |
| 80 | UserCredentialHash: userCredentialHash, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | func (k *Key) filePath(dir string) string { |
| 85 | return filepath.Join(dir, k.String()) |