forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
express-brute-memcached.d.ts
114 lines (97 loc) · 3.07 KB
/
express-brute-memcached.d.ts
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Type definitions for express-brute-memcached
// Project: https://github.com/AdamPflug/express-brute-memcached
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "express-brute-memcached" {
/**
* @summary Memcached options.
* @interface
*/
interface MemcachedStoreOptions {
prefix: string;
/**
* @summary Maximum key size allowed.
* @type {number}
*/
maxKeySize: number;
/**
* @summary Maximum expiration time of keys (in seconds).
* @type {number}
*/
maxExpiration: number;
/**
* @summary Maximum size of a value.
* @type {number}
*/
maxValue: number;
/**
* @summary Maximum size of the connection pool.
* @type {number}
*/
poolSize: number;
/**
* @summary Hashing algorithm used to generate the hashRing values
* @type {string}
*/
algorithm: string;
/**
* @summary Time between reconnection attempts (in milliseconds).
* @type {number}
*/
reconnect: number;
/**
* @summary Time after which Memcached sends a connection timeout (in milliseconds).
* @type {number}
*/
timeout: number;
/**
* @summary Number of socket allocation retries per request.
* @type {number}
*/
retries: number;
/**
* @summary Number of failed-attempts to a server before it is regarded as 'dead'.
* @type {number}
*/
failures: number;
/**
* @summary Time between a server failure and an attempt to set it up back in service.
* @type {number}
*/
retry: number;
/**
* @summary If true, authorizes the automatic removal of dead servers from the pool.
* @type {boolean}
*/
remove: boolean;
/**
* @summary An array of server_locations to replace servers that fail and that are removed from the consistent hashing scheme.
* @type {Array}
*/
failOverServers: Array<any>;
/**
* @summary True, whether to use md5 as hashing scheme when keys exceed maxKeySize .
* @type
*/
keyCompression: boolean;
/**
* @summary Idle timeout for the connections.
* @type {number}
*/
idle: number;
}
/**
* @summary A memcached store adapter.
* @class
*/
export default class MemcachedStore {
/**
* @summary Constructor.
* @constructor
* @param {string|Array} hosts The collection.
* @param {Object} options The otpions.
*/
constructor(hosts: string|Array<string>, options?: MemcachedStoreOptions);
}
}