mirror of
https://github.com/gofiber/storage.git
synced 2025-09-27 12:52:25 +08:00
Compare commits
996 Commits
v0.0.2
...
arangodb/v
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7e1e44dc62 | ||
![]() |
59b17408c6 | ||
![]() |
4cc0f4f2f4 | ||
![]() |
d0d7be2983 | ||
![]() |
f5c7691e7a | ||
![]() |
cbca7ba17a | ||
![]() |
e460e37927 | ||
![]() |
782c77def0 | ||
![]() |
3d3cecf34d | ||
![]() |
c67907f872 | ||
![]() |
7f45922477 | ||
![]() |
b75a6767e8 | ||
![]() |
0150f5f926 | ||
![]() |
98bebea186 | ||
![]() |
56a4cbfc19 | ||
![]() |
60220b5b83 | ||
![]() |
304146395d | ||
![]() |
a5635a782f | ||
![]() |
df66fb784c | ||
![]() |
9a9a1ce716 | ||
![]() |
5c3a1ca3eb | ||
![]() |
95226eed34 | ||
![]() |
33a61daca9 | ||
![]() |
6c71397839 | ||
![]() |
9fba60d754 | ||
![]() |
a115ee2fba | ||
![]() |
31e2d80802 | ||
![]() |
bbbd3e8ad1 | ||
![]() |
9edc233ee7 | ||
![]() |
c030fac063 | ||
![]() |
36401996a5 | ||
![]() |
c4a57d2fbe | ||
![]() |
f0e4fda91b | ||
![]() |
d95d8e93b9 | ||
![]() |
2ce3ae15bf | ||
![]() |
c592c8b549 | ||
![]() |
9f8afc3ce9 | ||
![]() |
2b4e7abe21 | ||
![]() |
3c0ea943b0 | ||
![]() |
9757af64f1 | ||
![]() |
b24255db5e | ||
![]() |
5aa726f723 | ||
![]() |
e42a4816ac | ||
![]() |
4137501136 | ||
![]() |
f72d263ecb | ||
![]() |
41bc99cc17 | ||
![]() |
e71c5057ac | ||
![]() |
4190ba4790 | ||
![]() |
1f1e7edd2a | ||
![]() |
b4151987ad | ||
![]() |
6fbb923377 | ||
![]() |
1743f57c9c | ||
![]() |
4c06b1802d | ||
![]() |
5c222a8684 | ||
![]() |
ad837a4f68 | ||
![]() |
8f9884ade2 | ||
![]() |
8ae4fed70a | ||
![]() |
349820a7d1 | ||
![]() |
5bbdaaf114 | ||
![]() |
455eb537ac | ||
![]() |
a37efaa61b | ||
![]() |
3a98e867cb | ||
![]() |
15d7b9ed6d | ||
![]() |
cc87dce84d | ||
![]() |
c651866df3 | ||
![]() |
e19782fb04 | ||
![]() |
17d0b6dd0b | ||
![]() |
201e025ee8 | ||
![]() |
448c43ff43 | ||
![]() |
cd292b687f | ||
![]() |
19ee2e65b8 | ||
![]() |
a276545019 | ||
![]() |
b892818d23 | ||
![]() |
28b8432101 | ||
![]() |
772f808741 | ||
![]() |
cdd6008fbb | ||
![]() |
e1214a9ccc | ||
![]() |
426e8266c5 | ||
![]() |
821232a3c4 | ||
![]() |
6a8f254286 | ||
![]() |
1af4aa7ac9 | ||
![]() |
b031cab8df | ||
![]() |
56a60b7f0a | ||
![]() |
1e6d856921 | ||
![]() |
53ecdac6f1 | ||
![]() |
3b6636b0ef | ||
![]() |
5102a5d757 | ||
![]() |
869d99ce0f | ||
![]() |
2d2739c33a | ||
![]() |
b7bd9bd90e | ||
![]() |
b7954d8a33 | ||
![]() |
7b7c79acb3 | ||
![]() |
4b76119c68 | ||
![]() |
10b721602f | ||
![]() |
21297be965 | ||
![]() |
85f3189476 | ||
![]() |
cf1a4a6345 | ||
![]() |
9294e3e676 | ||
![]() |
85c4df40cd | ||
![]() |
62e0250560 | ||
![]() |
cd72744191 | ||
![]() |
c38fc91d9d | ||
![]() |
b76d1302b1 | ||
![]() |
bbbcbd2b23 | ||
![]() |
6c53b6664f | ||
![]() |
6f49a10c0c | ||
![]() |
ad190e72fe | ||
![]() |
259782bc5e | ||
![]() |
98ed2982ec | ||
![]() |
27dd8f698e | ||
![]() |
0bb88f2eda | ||
![]() |
0886756196 | ||
![]() |
1232a9d64c | ||
![]() |
a0ef0d32fe | ||
![]() |
96d14d009d | ||
![]() |
1fcc337ab7 | ||
![]() |
0f2c58a7cc | ||
![]() |
f4c8d08849 | ||
![]() |
5effaf1761 | ||
![]() |
940432bfee | ||
![]() |
3fa3b411f6 | ||
![]() |
59aaa96760 | ||
![]() |
f07e3fd77f | ||
![]() |
0fdcdfd35b | ||
![]() |
ed3de3f984 | ||
![]() |
f1840c82ae | ||
![]() |
b1ae386d8f | ||
![]() |
55d0e8bf1e | ||
![]() |
d5ffdf4330 | ||
![]() |
08b47b0ba7 | ||
![]() |
bae367bf31 | ||
![]() |
d7e05cabb9 | ||
![]() |
7cf8aa2e57 | ||
![]() |
8225ee4fc6 | ||
![]() |
ae72763b86 | ||
![]() |
2653a66f19 | ||
![]() |
0272238cb6 | ||
![]() |
87bb8a408c | ||
![]() |
38c7d87300 | ||
![]() |
544251e681 | ||
![]() |
79079a1588 | ||
![]() |
c90677d575 | ||
![]() |
544eab8907 | ||
![]() |
9b8fbbe710 | ||
![]() |
3cf40177fb | ||
![]() |
3a9b0d3b4f | ||
![]() |
30046f9723 | ||
![]() |
1944178657 | ||
![]() |
aa82816129 | ||
![]() |
ae6582d8c7 | ||
![]() |
d865a554b1 | ||
![]() |
a5b87a0d48 | ||
![]() |
56366d252e | ||
![]() |
40d0bbcd04 | ||
![]() |
337863256a | ||
![]() |
d536bf88ec | ||
![]() |
5a94b0cafc | ||
![]() |
d50dbef8b0 | ||
![]() |
6c22baa03c | ||
![]() |
7e6c59b984 | ||
![]() |
1e53c43669 | ||
![]() |
e1d6198d07 | ||
![]() |
3e95f45a26 | ||
![]() |
932bb5bb7c | ||
![]() |
bc217cf94d | ||
![]() |
9cd63043c7 | ||
![]() |
d574b31723 | ||
![]() |
f9f90a78aa | ||
![]() |
2751b27d8e | ||
![]() |
763cd2a116 | ||
![]() |
e35c881c60 | ||
![]() |
5ddd49417e | ||
![]() |
a536aeb484 | ||
![]() |
d556f0600c | ||
![]() |
86a070ba95 | ||
![]() |
8b43d65db7 | ||
![]() |
a442a10435 | ||
![]() |
0f19d7e7a3 | ||
![]() |
40b55f8623 | ||
![]() |
f0a9cb7eb5 | ||
![]() |
baf1cd6f6f | ||
![]() |
363da11e66 | ||
![]() |
a6ed269baf | ||
![]() |
bdd345a093 | ||
![]() |
c5ebba6a5f | ||
![]() |
f22219bc24 | ||
![]() |
b2c586c124 | ||
![]() |
d4e2e3855a | ||
![]() |
c14486d19c | ||
![]() |
59b965453e | ||
![]() |
7202c98a32 | ||
![]() |
4216da2c74 | ||
![]() |
f095be3ebf | ||
![]() |
6581ab3f07 | ||
![]() |
c8ef22ea1f | ||
![]() |
bd32283899 | ||
![]() |
ef180673e3 | ||
![]() |
50b0432d75 | ||
![]() |
7de9b3831a | ||
![]() |
cca505e8d7 | ||
![]() |
dc1a243d40 | ||
![]() |
a905829b4b | ||
![]() |
b02409072e | ||
![]() |
b4a187a288 | ||
![]() |
afcdf55278 | ||
![]() |
57009f9900 | ||
![]() |
30088827f8 | ||
![]() |
3cb256e558 | ||
![]() |
cc387a31a8 | ||
![]() |
255d499dd1 | ||
![]() |
035e220e4a | ||
![]() |
12ef109fb1 | ||
![]() |
7d72f76698 | ||
![]() |
33e4902051 | ||
![]() |
5bbdf2fba6 | ||
![]() |
6f259cefd2 | ||
![]() |
8ab3b8216d | ||
![]() |
e93f03c1e4 | ||
![]() |
38c207c315 | ||
![]() |
2bdc69ea0b | ||
![]() |
6daf9a2b07 | ||
![]() |
9f6ffa3b2e | ||
![]() |
e0d5aef2a3 | ||
![]() |
b61bc913ca | ||
![]() |
2ac08c9d70 | ||
![]() |
9e37910ee5 | ||
![]() |
0b8805bc3d | ||
![]() |
eadf410bbe | ||
![]() |
b735c4a72a | ||
![]() |
98f78cf864 | ||
![]() |
7d726253df | ||
![]() |
91824ad6c8 | ||
![]() |
55dc0cf6e0 | ||
![]() |
808cf6778b | ||
![]() |
d1c3493765 | ||
![]() |
85c11d850d | ||
![]() |
10680abda7 | ||
![]() |
200738a370 | ||
![]() |
6a8b73a2f3 | ||
![]() |
a66b7764f6 | ||
![]() |
0be1c37af5 | ||
![]() |
afe52a9cf8 | ||
![]() |
6ef0db07d1 | ||
![]() |
960163ea48 | ||
![]() |
ec9d4c1f18 | ||
![]() |
7f67534357 | ||
![]() |
f411b856f8 | ||
![]() |
e37cc98b6d | ||
![]() |
ac5787fa65 | ||
![]() |
e7e03c2743 | ||
![]() |
106c5f8f5c | ||
![]() |
83edce7155 | ||
![]() |
dff02a2998 | ||
![]() |
7769513ca5 | ||
![]() |
6014de4ee7 | ||
![]() |
73aedd8a72 | ||
![]() |
ec921b81ba | ||
![]() |
6c22afe293 | ||
![]() |
efb747ae43 | ||
![]() |
5028696803 | ||
![]() |
ae3ec197df | ||
![]() |
2970f04de9 | ||
![]() |
9d95878f07 | ||
![]() |
0c9ddbbfc5 | ||
![]() |
49733e1be3 | ||
![]() |
c648e063d0 | ||
![]() |
3822d8810c | ||
![]() |
0e286885a9 | ||
![]() |
15dc8460b4 | ||
![]() |
bb1d9165e4 | ||
![]() |
b3ad7dfa6d | ||
![]() |
3cc51b29df | ||
![]() |
78849085f0 | ||
![]() |
e3320c4084 | ||
![]() |
22e48de898 | ||
![]() |
7e6ede5392 | ||
![]() |
5a120d6807 | ||
![]() |
ca239f0353 | ||
![]() |
6a614f832e | ||
![]() |
163223d2ae | ||
![]() |
5e4f21998b | ||
![]() |
afa1845884 | ||
![]() |
c5dcdeeeb9 | ||
![]() |
0a28808076 | ||
![]() |
681addbc44 | ||
![]() |
3070b92a1a | ||
![]() |
3bc82f8ba2 | ||
![]() |
182dffbb2b | ||
![]() |
e6e9899fde | ||
![]() |
0c8ae83437 | ||
![]() |
12304b6c69 | ||
![]() |
d4821f4081 | ||
![]() |
f1db2b938a | ||
![]() |
62a2237b12 | ||
![]() |
5b601650c1 | ||
![]() |
4fff115484 | ||
![]() |
2030d6bedc | ||
![]() |
188183f268 | ||
![]() |
cc594845f2 | ||
![]() |
c2fc6d75f2 | ||
![]() |
1ab2060f49 | ||
![]() |
91a8c49b97 | ||
![]() |
8978d06c91 | ||
![]() |
91c14686eb | ||
![]() |
ba8724cf5a | ||
![]() |
2d85619f08 | ||
![]() |
051a214db7 | ||
![]() |
1003347044 | ||
![]() |
b53ab6b5c6 | ||
![]() |
df72ed55f2 | ||
![]() |
08795be652 | ||
![]() |
ec0e35123a | ||
![]() |
07725d6663 | ||
![]() |
83285cb60e | ||
![]() |
1435bb3c45 | ||
![]() |
3860aa554d | ||
![]() |
f9f4ab050a | ||
![]() |
8488eb63a7 | ||
![]() |
8a0fa4c063 | ||
![]() |
47ed4c56f3 | ||
![]() |
4e342e03f0 | ||
![]() |
f63b41b577 | ||
![]() |
20890304d0 | ||
![]() |
eff3d26529 | ||
![]() |
43b0074e9f | ||
![]() |
6aae9b8202 | ||
![]() |
1d9f2399f1 | ||
![]() |
59c66e6c28 | ||
![]() |
ef3d4e20a4 | ||
![]() |
27ced8e41c | ||
![]() |
2441f85244 | ||
![]() |
c1aaef52f7 | ||
![]() |
f07e641c06 | ||
![]() |
14d989aaab | ||
![]() |
57f18bb17e | ||
![]() |
5627741945 | ||
![]() |
dd9a30caed | ||
![]() |
478527cfe6 | ||
![]() |
94187f16f7 | ||
![]() |
166e7afc35 | ||
![]() |
b63e2ec1f4 | ||
![]() |
6427b9ec4c | ||
![]() |
3928e84760 | ||
![]() |
d7d4596fff | ||
![]() |
277b986d51 | ||
![]() |
70fee34609 | ||
![]() |
1d9548f814 | ||
![]() |
7236d3072e | ||
![]() |
ccb994294b | ||
![]() |
496fe74085 | ||
![]() |
54de76d0a0 | ||
![]() |
536652e4dc | ||
![]() |
dd26802d13 | ||
![]() |
e8d52cf39d | ||
![]() |
f805f4b19d | ||
![]() |
2d57c82700 | ||
![]() |
ca00466318 | ||
![]() |
826b9999b3 | ||
![]() |
83bf2fcdd6 | ||
![]() |
596f2b300a | ||
![]() |
f2a9a240e0 | ||
![]() |
4c99d651ea | ||
![]() |
a003309f46 | ||
![]() |
8556d05651 | ||
![]() |
3db4eca735 | ||
![]() |
a0b639e2b6 | ||
![]() |
c807ce6226 | ||
![]() |
5201b1530f | ||
![]() |
d9a1c49d7f | ||
![]() |
7c6f5f13e4 | ||
![]() |
36cad8502f | ||
![]() |
cfe24e69a0 | ||
![]() |
f27ab7a48b | ||
![]() |
009e37321d | ||
![]() |
fa0e18f327 | ||
![]() |
c522db57a9 | ||
![]() |
8d052559ca | ||
![]() |
4dd8d829c6 | ||
![]() |
ffd98aafb7 | ||
![]() |
a4a3651e5a | ||
![]() |
c7383c18b7 | ||
![]() |
213df74971 | ||
![]() |
7c94731cb5 | ||
![]() |
fe32c2d972 | ||
![]() |
f6dce5b285 | ||
![]() |
7898136626 | ||
![]() |
0eaa59c008 | ||
![]() |
508b537916 | ||
![]() |
86018220ee | ||
![]() |
bdf971b980 | ||
![]() |
7690419d07 | ||
![]() |
80c93464df | ||
![]() |
bdc7ea2b51 | ||
![]() |
adb76e1a32 | ||
![]() |
d6eda44a04 | ||
![]() |
84686dc330 | ||
![]() |
45666e1a97 | ||
![]() |
ca875bcec4 | ||
![]() |
d63d73fe8f | ||
![]() |
399c740564 | ||
![]() |
2175a47ef1 | ||
![]() |
d677d04dd3 | ||
![]() |
22312727ef | ||
![]() |
18428bba82 | ||
![]() |
0f6b4b5d10 | ||
![]() |
d711f6a262 | ||
![]() |
8709adfb27 | ||
![]() |
d36b6eaa23 | ||
![]() |
7682132e74 | ||
![]() |
b66e5d19eb | ||
![]() |
4a3e5f2feb | ||
![]() |
4566bbe5d9 | ||
![]() |
41a84b36b5 | ||
![]() |
448ff1e6b3 | ||
![]() |
8b182c107d | ||
![]() |
0c37d458df | ||
![]() |
242972c94c | ||
![]() |
e663012926 | ||
![]() |
dc5d77e7a6 | ||
![]() |
568e3226a9 | ||
![]() |
006093ad61 | ||
![]() |
223fa616d3 | ||
![]() |
04b2bc9d80 | ||
![]() |
172c454082 | ||
![]() |
56599be5ff | ||
![]() |
c29f5aa8f5 | ||
![]() |
c1630600c0 | ||
![]() |
fc891e01f9 | ||
![]() |
5cf74ff83e | ||
![]() |
b1f8fb4b57 | ||
![]() |
601106e52b | ||
![]() |
c8f27bc351 | ||
![]() |
6e9449e32c | ||
![]() |
6fff337734 | ||
![]() |
59fb944039 | ||
![]() |
3e99cfdf88 | ||
![]() |
df5b685ba1 | ||
![]() |
fe97f748c4 | ||
![]() |
cf328af225 | ||
![]() |
da8b861fdb | ||
![]() |
33a9110500 | ||
![]() |
9f2f01d3b0 | ||
![]() |
c788e78feb | ||
![]() |
9f1cae4adb | ||
![]() |
d46ce172d6 | ||
![]() |
e2e0a1014a | ||
![]() |
03cf8de059 | ||
![]() |
bb8d53b553 | ||
![]() |
f83618fee1 | ||
![]() |
cfd6533fef | ||
![]() |
47f8893094 | ||
![]() |
1de1a76184 | ||
![]() |
3e5aaa96f7 | ||
![]() |
d728e60fd7 | ||
![]() |
d28eb6c162 | ||
![]() |
5b5080204d | ||
![]() |
d4edec3521 | ||
![]() |
a641361687 | ||
![]() |
22f3428ac3 | ||
![]() |
6adb265745 | ||
![]() |
bf4e3420c1 | ||
![]() |
d1792557ee | ||
![]() |
4a1b164135 | ||
![]() |
798b44be93 | ||
![]() |
63079db33b | ||
![]() |
6e97f151e2 | ||
![]() |
ceb5847dd5 | ||
![]() |
9e2b1ea9d3 | ||
![]() |
6da4c48255 | ||
![]() |
35ee4cb1fc | ||
![]() |
ef1f92b9b5 | ||
![]() |
6f932f8aad | ||
![]() |
9df2c6bd86 | ||
![]() |
204ce4415d | ||
![]() |
b7331cd76e | ||
![]() |
03958a9b57 | ||
![]() |
6e1cdd3254 | ||
![]() |
f1cc39884e | ||
![]() |
bec6880d52 | ||
![]() |
10fa3a6c89 | ||
![]() |
482370ea0c | ||
![]() |
fecc0623c5 | ||
![]() |
f50746a25a | ||
![]() |
4d9108e34d | ||
![]() |
f681dcebfb | ||
![]() |
9425ec7dff | ||
![]() |
7e7d4f371b | ||
![]() |
bf28559433 | ||
![]() |
8915ac5932 | ||
![]() |
fd4fac3adf | ||
![]() |
8aa8fbeefc | ||
![]() |
bf983c20f9 | ||
![]() |
13e08cef5a | ||
![]() |
c1af83c69d | ||
![]() |
b68751d060 | ||
![]() |
6c4deabb76 | ||
![]() |
77503ea5d8 | ||
![]() |
d89901cc12 | ||
![]() |
335fab6bdf | ||
![]() |
0f10913b8b | ||
![]() |
26a210373f | ||
![]() |
213f994147 | ||
![]() |
588a599ecb | ||
![]() |
c08a1ff422 | ||
![]() |
a21499405c | ||
![]() |
43150c5fea | ||
![]() |
41bbe83912 | ||
![]() |
4b6d204e22 | ||
![]() |
1190344d37 | ||
![]() |
0ab3d410b2 | ||
![]() |
4a7266f166 | ||
![]() |
866bd8730b | ||
![]() |
4f5088e8da | ||
![]() |
50cf5a78b1 | ||
![]() |
aee8189852 | ||
![]() |
c906c8ae1c | ||
![]() |
3c69d1c1da | ||
![]() |
cc691bdbd6 | ||
![]() |
f8ddd21b97 | ||
![]() |
1a3961f00d | ||
![]() |
6c0e70cefb | ||
![]() |
accf8d2c15 | ||
![]() |
9677f3549e | ||
![]() |
2f911653ec | ||
![]() |
bc8bb06e3c | ||
![]() |
d19802b57a | ||
![]() |
cbfbd984d3 | ||
![]() |
a3b1139001 | ||
![]() |
5a40e781c1 | ||
![]() |
e819b50e03 | ||
![]() |
57394e68cd | ||
![]() |
959e491679 | ||
![]() |
84a36d2015 | ||
![]() |
d004699f2d | ||
![]() |
5622ef89d5 | ||
![]() |
9a88efd8df | ||
![]() |
7793d2a375 | ||
![]() |
d6f24b53b6 | ||
![]() |
fb038e2f23 | ||
![]() |
ff49c86eea | ||
![]() |
20885d936c | ||
![]() |
0380c686df | ||
![]() |
f0840fb5c8 | ||
![]() |
2bb1e01c17 | ||
![]() |
396549add5 | ||
![]() |
164dbec004 | ||
![]() |
63f3884abb | ||
![]() |
55fb9917ff | ||
![]() |
2bba6b2afd | ||
![]() |
df568c139f | ||
![]() |
a4c75f4d23 | ||
![]() |
ab96148ba7 | ||
![]() |
3a2dcee0b3 | ||
![]() |
42a0064a70 | ||
![]() |
668c9cc6ad | ||
![]() |
aa1d482357 | ||
![]() |
f450f56bf3 | ||
![]() |
9222956861 | ||
![]() |
d8ee898ba0 | ||
![]() |
9d6194668c | ||
![]() |
2a795ed473 | ||
![]() |
117838fd0e | ||
![]() |
318b2fc04c | ||
![]() |
0aa08303bc | ||
![]() |
a1556f322a | ||
![]() |
6c27f7f186 | ||
![]() |
ee54c946b0 | ||
![]() |
0b9349c8bd | ||
![]() |
24611ce162 | ||
![]() |
1469483e15 | ||
![]() |
5eba92a47b | ||
![]() |
999159cfb7 | ||
![]() |
da27e01fe6 | ||
![]() |
155991d08b | ||
![]() |
8e7e1286be | ||
![]() |
4b273b74cb | ||
![]() |
b9f4a4fada | ||
![]() |
533803d845 | ||
![]() |
c790bf75df | ||
![]() |
c15a219ee8 | ||
![]() |
1fc6144cc0 | ||
![]() |
90e5588e5d | ||
![]() |
c57db8ae34 | ||
![]() |
634e4f7bbb | ||
![]() |
4f9889ce48 | ||
![]() |
155e4d36f7 | ||
![]() |
b4dea997f0 | ||
![]() |
bc92dbd3c3 | ||
![]() |
dcc812364e | ||
![]() |
ae0c3cfe6f | ||
![]() |
d5342ec28a | ||
![]() |
f7239431b3 | ||
![]() |
800e2db645 | ||
![]() |
420291805e | ||
![]() |
cdaf9129ee | ||
![]() |
125ee5f155 | ||
![]() |
c752b57508 | ||
![]() |
a63192c702 | ||
![]() |
c790785827 | ||
![]() |
25bf058c15 | ||
![]() |
debea836ad | ||
![]() |
4ba1e265d9 | ||
![]() |
82a7c7c87e | ||
![]() |
4791605f49 | ||
![]() |
fb2da5d153 | ||
![]() |
9f74d3e4a8 | ||
![]() |
e2196eb28a | ||
![]() |
f23189e030 | ||
![]() |
a37e0cc3b0 | ||
![]() |
8cd43b2951 | ||
![]() |
fd6f711788 | ||
![]() |
b48047ea41 | ||
![]() |
939d9b0eeb | ||
![]() |
4da7a8a588 | ||
![]() |
6d96c2fe32 | ||
![]() |
a04596a8b5 | ||
![]() |
23d0362d9b | ||
![]() |
35acbea01c | ||
![]() |
f201d3a103 | ||
![]() |
43ac34f7f3 | ||
![]() |
9006b23eef | ||
![]() |
d8daf4eb86 | ||
![]() |
42106d8ab4 | ||
![]() |
934395fb24 | ||
![]() |
caca820b8c | ||
![]() |
98413e412a | ||
![]() |
c8041d6397 | ||
![]() |
dca8f183e4 | ||
![]() |
659ab6b298 | ||
![]() |
08e41d81a0 | ||
![]() |
4b651548b3 | ||
![]() |
d43a56df50 | ||
![]() |
c3e230d024 | ||
![]() |
987a93083e | ||
![]() |
368027dc04 | ||
![]() |
55e5545d5b | ||
![]() |
8922818463 | ||
![]() |
4711dd9713 | ||
![]() |
b886afa98f | ||
![]() |
b10af3a02c | ||
![]() |
1f2c29fd9a | ||
![]() |
66d62ec7cb | ||
![]() |
e3e1f7a5ed | ||
![]() |
98c27d105b | ||
![]() |
84e6895b43 | ||
![]() |
5e419ced93 | ||
![]() |
fa82c71195 | ||
![]() |
47b223f56a | ||
![]() |
fe408d135e | ||
![]() |
501fd5d574 | ||
![]() |
954b019951 | ||
![]() |
4b0b7156c8 | ||
![]() |
0ca08d620b | ||
![]() |
4b33392dfb | ||
![]() |
d6a1b45f1f | ||
![]() |
6f502bb885 | ||
![]() |
c920e92115 | ||
![]() |
2998ca898b | ||
![]() |
01c4e9fa39 | ||
![]() |
9a830af2d8 | ||
![]() |
4cdb9c09a1 | ||
![]() |
922fbd8dd1 | ||
![]() |
d58b2097ce | ||
![]() |
d8f916f077 | ||
![]() |
d379039ef4 | ||
![]() |
a53bde5913 | ||
![]() |
21b2e44742 | ||
![]() |
6ef891d8a0 | ||
![]() |
23be295830 | ||
![]() |
6ded9c0f75 | ||
![]() |
dd752c6046 | ||
![]() |
20ba96f664 | ||
![]() |
e8a33f952c | ||
![]() |
c850eaff51 | ||
![]() |
2bd20cfa5a | ||
![]() |
2ee234e829 | ||
![]() |
1137fb9036 | ||
![]() |
a9dc413939 | ||
![]() |
825eb938c2 | ||
![]() |
e5eb169055 | ||
![]() |
1914d5fb39 | ||
![]() |
98df5fc473 | ||
![]() |
4e6f1c95ff | ||
![]() |
c010712741 | ||
![]() |
161724ceae | ||
![]() |
6627d9d1ee | ||
![]() |
d533947dca | ||
![]() |
595b1917f3 | ||
![]() |
f112c6ddff | ||
![]() |
070dec8c74 | ||
![]() |
8125d5ae39 | ||
![]() |
45e450a3d8 | ||
![]() |
737624d914 | ||
![]() |
1401f6b804 | ||
![]() |
8c679bf3a2 | ||
![]() |
fc7eb4fd27 | ||
![]() |
7486445385 | ||
![]() |
dfdfd7fbf3 | ||
![]() |
87862b1ac6 | ||
![]() |
bbfc356c01 | ||
![]() |
d8d446b1a5 | ||
![]() |
6ba900f18c | ||
![]() |
dc7bef5d10 | ||
![]() |
dff3b2aa26 | ||
![]() |
560664ab5a | ||
![]() |
68c1b99eac | ||
![]() |
998df25440 | ||
![]() |
b59617e2a6 | ||
![]() |
c6162ed666 | ||
![]() |
31f94813cf | ||
![]() |
1f256f5391 | ||
![]() |
a299404c1b | ||
![]() |
72b47afe1e | ||
![]() |
ce744287b7 | ||
![]() |
9f14918a5a | ||
![]() |
11aacc8bd1 | ||
![]() |
01da118ae2 | ||
![]() |
94d968b7f7 | ||
![]() |
57c24a378b | ||
![]() |
fdea0f9267 | ||
![]() |
58364534e9 | ||
![]() |
bc10416921 | ||
![]() |
c30115270c | ||
![]() |
2c315e1ce7 | ||
![]() |
ff64bffed1 | ||
![]() |
34200e124b | ||
![]() |
20a6c8a79b | ||
![]() |
d2569fbe93 | ||
![]() |
bf76d31f6c | ||
![]() |
551c37101c | ||
![]() |
23f59994f8 | ||
![]() |
109c6b6f4f | ||
![]() |
fc6b3c841b | ||
![]() |
0b3e720b84 | ||
![]() |
7bcf46ac24 | ||
![]() |
0b31353707 | ||
![]() |
872f038e0b | ||
![]() |
b08cc03b22 | ||
![]() |
328c5ce28f | ||
![]() |
3e54ad6cac | ||
![]() |
7990d6d708 | ||
![]() |
95f32bf522 | ||
![]() |
95f98b0c41 | ||
![]() |
b0af7b2d2e | ||
![]() |
51f7507c86 | ||
![]() |
0965ae08a9 | ||
![]() |
2e6aade129 | ||
![]() |
7d29b5bbf0 | ||
![]() |
6666191087 | ||
![]() |
43b37e9b7e | ||
![]() |
6c53e5e46e | ||
![]() |
d178fca7df | ||
![]() |
230c3a6c5b | ||
![]() |
9b85e40cc6 | ||
![]() |
e38e2dcbba | ||
![]() |
a5d0a37b49 | ||
![]() |
808d103448 | ||
![]() |
30e0b8afa8 | ||
![]() |
da887624a4 | ||
![]() |
5eb8d57c09 | ||
![]() |
89493b1be0 | ||
![]() |
7ad1f0f105 | ||
![]() |
ffa78322a4 | ||
![]() |
ad9cf6da5d | ||
![]() |
a5a18bb80b | ||
![]() |
81764f4072 | ||
![]() |
327c871825 | ||
![]() |
4126450357 | ||
![]() |
8e81d7cded | ||
![]() |
94977c4028 | ||
![]() |
278f9d748a | ||
![]() |
d5f9d825aa | ||
![]() |
3a4eb3934d | ||
![]() |
d0b6aa2131 | ||
![]() |
310758fc7a | ||
![]() |
c1ab36765b | ||
![]() |
f24af60e42 | ||
![]() |
7d0bbde770 | ||
![]() |
efffcc135b | ||
![]() |
1b233673bb | ||
![]() |
07bde5f757 | ||
![]() |
ce174aed64 | ||
![]() |
cff33471cf | ||
![]() |
e211b33874 | ||
![]() |
05c149e84f | ||
![]() |
bf50899345 | ||
![]() |
b2f8339751 | ||
![]() |
e0435cd1a0 | ||
![]() |
d03bf4584c | ||
![]() |
e40f7b86df | ||
![]() |
3a8b8d4f71 | ||
![]() |
c38c925975 | ||
![]() |
d27ddd4739 | ||
![]() |
0aec65bb77 | ||
![]() |
671a3e4a04 | ||
![]() |
cbc4d3d251 | ||
![]() |
fe8cc5f97c | ||
![]() |
af3630ee22 | ||
![]() |
602260698d | ||
![]() |
ad27e8bcbb | ||
![]() |
d4ddc46c29 | ||
![]() |
ac29a7e86c | ||
![]() |
daa2dc7ee4 | ||
![]() |
1e822400d5 | ||
![]() |
57f7bb86d5 | ||
![]() |
ba65508bc9 | ||
![]() |
30e23d86d0 | ||
![]() |
7c79c78623 | ||
![]() |
caf28d82f7 | ||
![]() |
28ae1f71fb | ||
![]() |
bdea86b669 | ||
![]() |
2ec5a2cf70 | ||
![]() |
841d5eaedd | ||
![]() |
9ee4838edf | ||
![]() |
12203cbbe8 | ||
![]() |
e2ce496727 | ||
![]() |
4c11a63573 | ||
![]() |
725abe0123 | ||
![]() |
81c40a28df | ||
![]() |
2465b14c41 | ||
![]() |
d002c1076e | ||
![]() |
c3e5299489 | ||
![]() |
2d113619b3 | ||
![]() |
2fdd8600ad | ||
![]() |
dbc7a0636d | ||
![]() |
382fd19d57 | ||
![]() |
364ffb1dda | ||
![]() |
b787cedd82 | ||
![]() |
2dd7251e59 | ||
![]() |
b6574fdbfa | ||
![]() |
adcd9c09c3 | ||
![]() |
e8a6d1b229 | ||
![]() |
6d96fb56af | ||
![]() |
6fd94ebd5a | ||
![]() |
0c0027d11d | ||
![]() |
07d3c6b7c1 | ||
![]() |
8be14c8950 | ||
![]() |
2f13554ac3 | ||
![]() |
3d96c04300 | ||
![]() |
debcd26997 | ||
![]() |
96284ee8b7 | ||
![]() |
a1f5f8b1b0 | ||
![]() |
ae951cdfcc | ||
![]() |
a567590b51 | ||
![]() |
6ea9ef03b5 | ||
![]() |
663d7da0e7 | ||
![]() |
3432c9df7b | ||
![]() |
46d63d36ec | ||
![]() |
035b445a98 | ||
![]() |
ef2bde0f4a | ||
![]() |
b2e9530bc7 | ||
![]() |
bd65618ff5 | ||
![]() |
6420cf2823 | ||
![]() |
2f656df41c | ||
![]() |
83339bc156 | ||
![]() |
e464f894c6 | ||
![]() |
a5b31b013b | ||
![]() |
0dd7781663 | ||
![]() |
771b96b211 | ||
![]() |
aeda350995 | ||
![]() |
551f99d5d2 | ||
![]() |
2aa051f366 | ||
![]() |
7d95149519 | ||
![]() |
1c100fe50a | ||
![]() |
395ea51b28 | ||
![]() |
d327e9b0dd | ||
![]() |
5cbf98de49 | ||
![]() |
22444f8aa9 | ||
![]() |
cc5ccf062b | ||
![]() |
315f14ce58 | ||
![]() |
f9eaa6ae4d | ||
![]() |
2be6e0cc10 | ||
![]() |
5b444c36df | ||
![]() |
61fa9709f2 | ||
![]() |
45cc6b9dcd | ||
![]() |
e76d7e56b6 | ||
![]() |
6d004c4bca | ||
![]() |
e7293b3841 | ||
![]() |
69b0b5a26f | ||
![]() |
edb920dc05 | ||
![]() |
df9fdcbaf9 | ||
![]() |
1883d62d06 | ||
![]() |
ff1db4e2a4 | ||
![]() |
5048d2480c | ||
![]() |
d75a723f55 | ||
![]() |
864b9a01e0 | ||
![]() |
b866b0b30a | ||
![]() |
842a366c10 | ||
![]() |
2728ec3c02 | ||
![]() |
4a3096149e | ||
![]() |
726ef21f76 | ||
![]() |
3d9778b4da | ||
![]() |
c2fa94c9f4 | ||
![]() |
ff033d0e0e | ||
![]() |
f815ac6561 | ||
![]() |
bab82c9802 | ||
![]() |
73a941a879 | ||
![]() |
868c89fd7e | ||
![]() |
c050ff8e3d | ||
![]() |
1fec873770 | ||
![]() |
877dae612d | ||
![]() |
5bf7da2074 | ||
![]() |
9c850f5235 | ||
![]() |
bd837d91ab | ||
![]() |
c4e1c722b1 | ||
![]() |
85e612ec79 | ||
![]() |
f0233feaea | ||
![]() |
2e2ed658fd | ||
![]() |
fe9649ddfb | ||
![]() |
6004253367 | ||
![]() |
d93f683d40 | ||
![]() |
d3c4120740 | ||
![]() |
9fe7fada49 | ||
![]() |
1619377fd7 | ||
![]() |
1761413f2b | ||
![]() |
ccd2f0bbd6 | ||
![]() |
d6fbde4b32 | ||
![]() |
36af0e2d7b | ||
![]() |
0c07206571 | ||
![]() |
7bbbc01f84 | ||
![]() |
b94d9ecf40 | ||
![]() |
ae3553dac9 | ||
![]() |
b9b7ed25ca | ||
![]() |
61a72fd587 | ||
![]() |
be29dff25d | ||
![]() |
d62b0bb95f | ||
![]() |
40a44d5655 | ||
![]() |
6a0f72c350 | ||
![]() |
aedc03b9c3 | ||
![]() |
3397275612 | ||
![]() |
6afe536cce | ||
![]() |
53f888504d | ||
![]() |
2760d0e29e | ||
![]() |
48d48cfd7e | ||
![]() |
a83ebb0aac | ||
![]() |
7cfce7a88b | ||
![]() |
8b66d2ff33 | ||
![]() |
feaf977424 | ||
![]() |
935434a940 | ||
![]() |
4d84709369 | ||
![]() |
8a84698537 | ||
![]() |
f69705a65d | ||
![]() |
ae99c04c93 | ||
![]() |
d0fe287cd7 | ||
![]() |
79bb924d44 | ||
![]() |
39d7f4ff11 | ||
![]() |
d9a333fb56 | ||
![]() |
d227c71a3f | ||
![]() |
4cc4c1cba8 | ||
![]() |
7856af3a73 | ||
![]() |
b8491b9f1e | ||
![]() |
e29def7754 | ||
![]() |
9dbfd131e1 | ||
![]() |
547993882d | ||
![]() |
3b18a59438 | ||
![]() |
383e132ba7 | ||
![]() |
4a20c75be6 | ||
![]() |
b89c397b15 | ||
![]() |
725b5720cb | ||
![]() |
3db5081ec0 | ||
![]() |
0f037bd33f | ||
![]() |
0a89d904ed | ||
![]() |
a66230ef17 | ||
![]() |
9829073dd7 | ||
![]() |
ea23fabafa | ||
![]() |
e5d9b064ca | ||
![]() |
1d00ff6dd8 | ||
![]() |
0db60a3462 | ||
![]() |
5e88deb97d | ||
![]() |
30ecb3762a | ||
![]() |
a8531fbd67 | ||
![]() |
5fb75c133b | ||
![]() |
b9c23a2736 | ||
![]() |
2fc023c798 | ||
![]() |
4e9dcd8d12 | ||
![]() |
a956dc9144 | ||
![]() |
9b7d6b130f | ||
![]() |
a24dd2827c | ||
![]() |
bb4a08411c | ||
![]() |
0fb6a23e53 | ||
![]() |
e71db29b3a | ||
![]() |
59487036e9 | ||
![]() |
d79b8fe8e0 | ||
![]() |
2e02bda8a1 | ||
![]() |
0c0949c777 | ||
![]() |
4611bdac86 | ||
![]() |
f3768e816f | ||
![]() |
d304cb36a9 | ||
![]() |
3f5230b6e5 | ||
![]() |
3058c5ea7b | ||
![]() |
ce566e078c | ||
![]() |
b16d9d6ace | ||
![]() |
9a9ea7d242 | ||
![]() |
ab94351a60 | ||
![]() |
fd56bd28da | ||
![]() |
ddef41c2ee |
79
.github/ISSUE_TEMPLATE/bug-report.yaml
vendored
Normal file
79
.github/ISSUE_TEMPLATE/bug-report.yaml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
name: "\U0001F41B Bug Report"
|
||||
title: "\U0001F41B [Bug]: "
|
||||
description: Create a bug report to help us fix it.
|
||||
labels: ["☢️ Bug"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
id: notice
|
||||
attributes:
|
||||
value: |
|
||||
### Notice
|
||||
- Dont't forget you can ask your questions on our [Discord server](https://gofiber.io/discord).
|
||||
- If you think Fiber storage don't have a nice feature that you think, open the issue with **✏️ Feature Request** template.
|
||||
- Write your issue with clear and understandable English.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: "Bug Description"
|
||||
description: "A clear and detailed description of what the bug is."
|
||||
placeholder: "Explain your problem as clear and detailed."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: how-to-reproduce
|
||||
attributes:
|
||||
label: How to Reproduce
|
||||
description: "Steps to reproduce the behavior and what should be observed in the end."
|
||||
placeholder: "Tell us step by step how we can replicate your problem and what we should see in the end."
|
||||
value: |
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '....'
|
||||
2. Click on '....'
|
||||
3. Do '....'
|
||||
4. See '....'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: "A clear and detailed description of what you think should happens."
|
||||
placeholder: "Tell us what storage should normally do."
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: "Storage package Version"
|
||||
description: "Some bugs may be fixed in future storage releases, so we have to know your storage package version."
|
||||
placeholder: "Write your storage version. (v1.0.0, v1.1.0...)"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: snippet
|
||||
attributes:
|
||||
label: "Code Snippet (optional)"
|
||||
description: "For some issues, we need to know some parts of your code."
|
||||
placeholder: "Share a code you think related to the issue."
|
||||
render: go
|
||||
value: |
|
||||
package main
|
||||
|
||||
import "github.com/gofiber/storage/%package%"
|
||||
|
||||
func main() {
|
||||
// Steps to reproduce
|
||||
}
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: "Checklist:"
|
||||
description: "By submitting this issue, you confirm that:"
|
||||
options:
|
||||
- label: "I agree to follow Fiber's [Code of Conduct](https://github.com/gofiber/fiber/blob/master/.github/CODE_OF_CONDUCT.md)."
|
||||
required: true
|
||||
- label: "I have checked for existing issues that describe my problem prior to opening this one."
|
||||
required: true
|
||||
- label: "I understand that improperly formatted bug reports may be closed without explanation."
|
||||
required: true
|
55
.github/ISSUE_TEMPLATE/feature-request.yaml
vendored
Normal file
55
.github/ISSUE_TEMPLATE/feature-request.yaml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: "\U0001F680 Feature Request"
|
||||
title: "\U0001F680 [Feature]: "
|
||||
description: Suggest an idea to improve this project.
|
||||
labels: ["✏️ Feature"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
id: notice
|
||||
attributes:
|
||||
value: |
|
||||
### Notice
|
||||
- Dont't forget you can ask your questions on our [Discord server](https://gofiber.io/discord).
|
||||
- If you think this is just a bug, open the issue with **☢️ Bug Report** template.
|
||||
- Write your issue with clear and understandable English.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: "Feature Description"
|
||||
description: "A clear and detailed description of the feature we need to do."
|
||||
placeholder: "Explain your feature as clear and detailed."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: "Additional Context (optional)"
|
||||
description: "If you have something else to describe, write them here."
|
||||
placeholder: "Write here what you can describe differently."
|
||||
- type: textarea
|
||||
id: snippet
|
||||
attributes:
|
||||
label: "Code Snippet (optional)"
|
||||
description: "Code snippet may be really helpful to describe some features."
|
||||
placeholder: "Share a code to explain the feature better."
|
||||
render: go
|
||||
value: |
|
||||
package main
|
||||
|
||||
import "github.com/gofiber/storage/%package%"
|
||||
|
||||
func main() {
|
||||
// Steps to reproduce
|
||||
}
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: "Checklist:"
|
||||
description: "By submitting this issue, you confirm that:"
|
||||
options:
|
||||
- label: "I agree to follow Fiber's [Code of Conduct](https://github.com/gofiber/fiber/blob/master/.github/CODE_OF_CONDUCT.md)."
|
||||
required: true
|
||||
- label: "I have checked for existing issues that describe my suggestion prior to opening this one."
|
||||
required: true
|
||||
- label: "I understand that improperly formatted feature requests may be closed without explanation."
|
||||
required: true
|
50
.github/ISSUE_TEMPLATE/question.yaml
vendored
Normal file
50
.github/ISSUE_TEMPLATE/question.yaml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: "🤔 Question"
|
||||
title: "\U0001F917 [Question]: "
|
||||
description: Ask a question so we can help you easily.
|
||||
labels: ["🤔 Question"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
id: notice
|
||||
attributes:
|
||||
value: |
|
||||
### Notice
|
||||
- Dont't forget you can ask your questions on our [Discord server](https://gofiber.io/discord).
|
||||
- If you think this is just a bug, open the issue with **☢️ Bug Report** template.
|
||||
- If you think Fiber storage don't have a nice feature that you think, open the issue with **✏️ Feature Request** template.
|
||||
- Write your issue with clear and understandable English.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: "Question Description"
|
||||
description: "A clear and detailed description of the question."
|
||||
placeholder: "Explain your question as clear and detailed."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: snippet
|
||||
attributes:
|
||||
label: "Code Snippet (optional)"
|
||||
description: "Code snippet may be really helpful to describe some features."
|
||||
placeholder: "Share a code to explain the feature better."
|
||||
render: go
|
||||
value: |
|
||||
package main
|
||||
|
||||
import "github.com/gofiber/storage/%package%"
|
||||
|
||||
func main() {
|
||||
// Steps to reproduce
|
||||
}
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: "Checklist:"
|
||||
description: "By submitting this issue, you confirm that:"
|
||||
options:
|
||||
- label: "I agree to follow Fiber's [Code of Conduct](https://github.com/gofiber/fiber/blob/master/.github/CODE_OF_CONDUCT.md)."
|
||||
required: true
|
||||
- label: "I have checked for existing issues that describe my questions prior to opening this one."
|
||||
required: true
|
||||
- label: "I understand that improperly formatted questions may be closed without explanation."
|
||||
required: true
|
56
.github/README.md
vendored
56
.github/README.md
vendored
@@ -1,56 +0,0 @@
|
||||
|
||||
<p align="center">
|
||||
<!-- <a href="https://gofiber.io">
|
||||
<img alt="Fiber" height="125" src="https://raw.githubusercontent.com/gofiber/docs/master/static/fiber_v2_logo.svg">
|
||||
</a>
|
||||
<br> -->
|
||||
|
||||
# 📦 Storage
|
||||
|
||||
<a href="https://pkg.go.dev/github.com/gofiber/storage?tab=doc">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7&style=flat">
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/gofiber/storage">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%93%9D%20goreport-A%2B-75C46B">
|
||||
</a>
|
||||
<a href="https://gocover.io/github.com/gofiber/storage">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%94%8E%20gocover-97.8%25-75C46B.svg?style=flat">
|
||||
</a>
|
||||
<a href="https://gofiber.io/discord">
|
||||
<img src="https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Premade storage drivers that implement [`fiber.Storage`](https://github.com/gofiber/fiber/blob/ba08653c92f86bc69956b23714f919b705d9381e/app.go#L39-L50), to be used with various Fiber middlewares.
|
||||
|
||||
## 📑 Storage Implementations
|
||||
|
||||
|
||||
* [Badger](/badger) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Local+Storage%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Local%20Storage?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [Memcache](/memcache) <a href="https://github.com/gofiber/storage/actions?query=workflow%3AMemcache">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Memcache?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [Memory](/memory) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Local+Storage%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Local%20Storage?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [MongoDB](/mongodb) <a href="https://github.com/gofiber/storage/actions?query=workflow%3AMongoDB">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/MongoDB?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [MySQL](/mysql) <a href="https://github.com/gofiber/storage/actions?query=workflow%3AMySQL">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/MySQL?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [Postgres](/postgres) <a href="https://github.com/gofiber/storage/actions?query=workflow%3APostgres">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Postgres?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [Redis](/redis) <a href="https://github.com/gofiber/storage/actions?query=workflow%3ARedis">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Redis?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
* [SQLite3](/sqlite3) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Local+Storage%22">
|
||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Local%20Storage?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||
</a>
|
||||
|
||||
## 🤔 Something missing?
|
||||
|
||||
If you've got a custom storage driver you made that's not listed here, why not submit a [PR](https://github.com/gofiber/storage/pulls) to add it?
|
123
.github/dependabot.yml
vendored
Normal file
123
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/arangodb/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/badger/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/couchbase/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/etcd/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/pebble/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/dynamodb/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/memcache/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/memory/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/mongodb/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/mysql/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/postgres/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/redis/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/sqlite3/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/ristretto/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/s3/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/bbolt/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/azureblob/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
directory: "/mssql/" # Location of package manifests
|
||||
labels:
|
||||
- "🤖 Dependencies"
|
||||
schedule:
|
||||
interval: "daily"
|
20
.github/labeler.yml
vendored
Normal file
20
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
version: v1
|
||||
labels:
|
||||
- label: '📒 Documentation'
|
||||
matcher:
|
||||
title: '\b(docs|doc:|\[doc\]|README|typos|comment|documentation)\b'
|
||||
- label: '☢️ Bug'
|
||||
matcher:
|
||||
title: '\b(fix|race|bug|missing|correct)\b'
|
||||
- label: '🧹 Updates'
|
||||
matcher:
|
||||
title: '\b(improve|update|refactor|deprecated|remove|unused|test)\b'
|
||||
- label: '🤖 Dependencies'
|
||||
matcher:
|
||||
title: '\b(bumb|bdependencies)\b'
|
||||
- label: '✏️ Feature'
|
||||
matcher:
|
||||
title: '\b(feature|create|implement|add)\b'
|
||||
- label: '🤔 Question'
|
||||
matcher:
|
||||
title: '\b(question|how)\b'
|
9
.github/logo-dark.svg
vendored
Normal file
9
.github/logo-dark.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 14 KiB |
9
.github/logo.svg
vendored
Normal file
9
.github/logo.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 14 KiB |
43
.github/release-drafter-arangodb.yml
vendored
Normal file
43
.github/release-drafter-arangodb.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'ArangoDB - v$RESOLVED_VERSION'
|
||||
tag-template: 'arangodb/v$RESOLVED_VERSION'
|
||||
tag-prefix: arangodb/v
|
||||
include-paths:
|
||||
- arangodb
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...arangodb/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-azureblob.yml
vendored
Normal file
43
.github/release-drafter-azureblob.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Azure Blob - v$RESOLVED_VERSION'
|
||||
tag-template: 'azureblob/v$RESOLVED_VERSION'
|
||||
tag-prefix: azureblob/v
|
||||
include-paths:
|
||||
- azureblob
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...azureblob/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-badger.yml
vendored
Normal file
43
.github/release-drafter-badger.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Badger - v$RESOLVED_VERSION'
|
||||
tag-template: 'badger/v$RESOLVED_VERSION'
|
||||
tag-prefix: badger/v
|
||||
include-paths:
|
||||
- badger
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...badger/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-bbolt.yml
vendored
Normal file
43
.github/release-drafter-bbolt.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Bbolt - v$RESOLVED_VERSION'
|
||||
tag-template: 'bbolt/v$RESOLVED_VERSION'
|
||||
tag-prefix: bbolt/v
|
||||
include-paths:
|
||||
- bbolt
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...bbolt/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-couchbase.yml
vendored
Normal file
43
.github/release-drafter-couchbase.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Couchbase - v$RESOLVED_VERSION'
|
||||
tag-template: 'couchbase/v$RESOLVED_VERSION'
|
||||
tag-prefix: couchbase/v
|
||||
include-paths:
|
||||
- couchbase
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...couchbase/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-dynamodb.yml
vendored
Normal file
43
.github/release-drafter-dynamodb.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'DynamoDB - v$RESOLVED_VERSION'
|
||||
tag-template: 'dynamodb/v$RESOLVED_VERSION'
|
||||
tag-prefix: dynamodb/v
|
||||
include-paths:
|
||||
- dynamodb
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...dynamodb/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-etcd.yml
vendored
Normal file
43
.github/release-drafter-etcd.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Etcd - v$RESOLVED_VERSION'
|
||||
tag-template: 'etcd/v$RESOLVED_VERSION'
|
||||
tag-prefix: etcd/v
|
||||
include-paths:
|
||||
- etcd
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...etcd/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-memcache.yml
vendored
Normal file
43
.github/release-drafter-memcache.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Memcache - v$RESOLVED_VERSION'
|
||||
tag-template: 'memcache/v$RESOLVED_VERSION'
|
||||
tag-prefix: memcache/v
|
||||
include-paths:
|
||||
- memcache
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...memcache/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-memory.yml
vendored
Normal file
43
.github/release-drafter-memory.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Memory - v$RESOLVED_VERSION'
|
||||
tag-template: 'memory/v$RESOLVED_VERSION'
|
||||
tag-prefix: memory/v
|
||||
include-paths:
|
||||
- memory
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...memory/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-mongodb.yml
vendored
Normal file
43
.github/release-drafter-mongodb.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'MongoDB - v$RESOLVED_VERSION'
|
||||
tag-template: 'mongodb/v$RESOLVED_VERSION'
|
||||
tag-prefix: mongodb/v
|
||||
include-paths:
|
||||
- mongodb
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...mongodb/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-mssql.yml
vendored
Normal file
43
.github/release-drafter-mssql.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'MSSQL - v$RESOLVED_VERSION'
|
||||
tag-template: 'mssql/v$RESOLVED_VERSION'
|
||||
tag-prefix: mssql/v
|
||||
include-paths:
|
||||
- mssql
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...mssql/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-mysql.yml
vendored
Normal file
43
.github/release-drafter-mysql.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'MySQL - v$RESOLVED_VERSION'
|
||||
tag-template: 'mysql/v$RESOLVED_VERSION'
|
||||
tag-prefix: mysql/v
|
||||
include-paths:
|
||||
- mysql
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...mysql/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-pebble.yml
vendored
Normal file
43
.github/release-drafter-pebble.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: "Pebble - v$RESOLVED_VERSION"
|
||||
tag-template: "pebble/v$RESOLVED_VERSION"
|
||||
tag-prefix: pebble/v
|
||||
include-paths:
|
||||
- pebble
|
||||
categories:
|
||||
- title: "🚀 New"
|
||||
labels:
|
||||
- "✏️ Feature"
|
||||
- title: "🧹 Updates"
|
||||
labels:
|
||||
- "🧹 Updates"
|
||||
- "🤖 Dependencies"
|
||||
- title: "🐛 Fixes"
|
||||
labels:
|
||||
- "☢️ Bug"
|
||||
- title: "📚 Documentation"
|
||||
labels:
|
||||
- "📒 Documentation"
|
||||
change-template: "- $TITLE (#$NUMBER)"
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- "major"
|
||||
minor:
|
||||
labels:
|
||||
- "minor"
|
||||
- "✏️ Feature"
|
||||
patch:
|
||||
labels:
|
||||
- "patch"
|
||||
- "📒 Documentation"
|
||||
- "☢️ Bug"
|
||||
- "🤖 Dependencies"
|
||||
- "🧹 Updates"
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...pebble/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-postgres.yml
vendored
Normal file
43
.github/release-drafter-postgres.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Postgres - v$RESOLVED_VERSION'
|
||||
tag-template: 'postgres/v$RESOLVED_VERSION'
|
||||
tag-prefix: postgres/v
|
||||
include-paths:
|
||||
- postgres
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...postgres/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-redis.yml
vendored
Normal file
43
.github/release-drafter-redis.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Redis - v$RESOLVED_VERSION'
|
||||
tag-template: 'redis/v$RESOLVED_VERSION'
|
||||
tag-prefix: redis/v
|
||||
include-paths:
|
||||
- redis
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...redis/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-ristretto.yml
vendored
Normal file
43
.github/release-drafter-ristretto.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'Ristretto - v$RESOLVED_VERSION'
|
||||
tag-template: 'ristretto/v$RESOLVED_VERSION'
|
||||
tag-prefix: ristretto/v
|
||||
include-paths:
|
||||
- ristretto
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...ristretto/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-s3.yml
vendored
Normal file
43
.github/release-drafter-s3.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'S3 - v$RESOLVED_VERSION'
|
||||
tag-template: 's3/v$RESOLVED_VERSION'
|
||||
tag-prefix: s3/v
|
||||
include-paths:
|
||||
- s3
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...s3/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
43
.github/release-drafter-sqlite3.yml
vendored
Normal file
43
.github/release-drafter-sqlite3.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name-template: 'SQLite3 - v$RESOLVED_VERSION'
|
||||
tag-template: 'sqlite3/v$RESOLVED_VERSION'
|
||||
tag-prefix: sqlite3/v
|
||||
include-paths:
|
||||
- sqlite3
|
||||
categories:
|
||||
- title: '🚀 New'
|
||||
labels:
|
||||
- '✏️ Feature'
|
||||
- title: '🧹 Updates'
|
||||
labels:
|
||||
- '🧹 Updates'
|
||||
- '🤖 Dependencies'
|
||||
- title: '🐛 Fixes'
|
||||
labels:
|
||||
- '☢️ Bug'
|
||||
- title: '📚 Documentation'
|
||||
labels:
|
||||
- '📒 Documentation'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- 'major'
|
||||
minor:
|
||||
labels:
|
||||
- 'minor'
|
||||
- '✏️ Feature'
|
||||
patch:
|
||||
labels:
|
||||
- 'patch'
|
||||
- '📒 Documentation'
|
||||
- '☢️ Bug'
|
||||
- '🤖 Dependencies'
|
||||
- '🧹 Updates'
|
||||
default: patch
|
||||
template: |
|
||||
$CHANGES
|
||||
|
||||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...sqlite3/v$RESOLVED_VERSION
|
||||
|
||||
Thank you $CONTRIBUTORS for making this update possible.
|
80
.github/scripts/sync_docs.sh
vendored
Executable file
80
.github/scripts/sync_docs.sh
vendored
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Some env variables
|
||||
BRANCH="main"
|
||||
REPO_URL="github.com/gofiber/docs.git"
|
||||
AUTHOR_EMAIL="github-actions[bot]@users.noreply.github.com"
|
||||
AUTHOR_USERNAME="github-actions[bot]"
|
||||
VERSION_FILE="storage_versions.json"
|
||||
REPO_DIR="storage"
|
||||
COMMIT_URL="https://github.com/gofiber/storage"
|
||||
DOCUSAURUS_COMMAND="npm run docusaurus -- docs:version:storage"
|
||||
|
||||
# Set commit author
|
||||
git config --global user.email "${AUTHOR_EMAIL}"
|
||||
git config --global user.name "${AUTHOR_USERNAME}"
|
||||
|
||||
git clone https://${TOKEN}@${REPO_URL} fiber-docs
|
||||
|
||||
# Handle push event
|
||||
if [ "$EVENT" == "push" ]; then
|
||||
latest_commit=$(git rev-parse --short HEAD)
|
||||
|
||||
for f in $(find . -type f -name "*.md" -not -path "./fiber-docs/*"); do
|
||||
log_output=$(git log --oneline "${BRANCH}" HEAD~1..HEAD --name-status -- "${f}")
|
||||
|
||||
if [[ $log_output != "" || ! -f "fiber-docs/docs/${REPO_DIR}/$f" ]]; then
|
||||
mkdir -p fiber-docs/docs/${REPO_DIR}/$(dirname $f)
|
||||
cp "${f}" fiber-docs/docs/${REPO_DIR}/$f
|
||||
fi
|
||||
done
|
||||
|
||||
# Handle release event
|
||||
elif [ "$EVENT" == "release" ]; then
|
||||
# Extract package name from tag
|
||||
package_name="${TAG_NAME%/*}"
|
||||
major_version="${TAG_NAME#*/}"
|
||||
major_version="${major_version%%.*}"
|
||||
|
||||
# Form new version name
|
||||
new_version="${package_name}_${major_version}.x.x"
|
||||
|
||||
cd fiber-docs/ || true
|
||||
npm ci
|
||||
|
||||
# Check if contrib_versions.json exists and modify it if required
|
||||
if [[ -f $VERSION_FILE ]]; then
|
||||
jq --arg new_version "$new_version" 'del(.[] | select(. == $new_version))' $VERSION_FILE > temp.json && mv temp.json $VERSION_FILE
|
||||
jq -S . ${VERSION_FILE} > temp.json && mv temp.json ${VERSION_FILE}
|
||||
fi
|
||||
|
||||
# Run docusaurus versioning command
|
||||
$DOCUSAURUS_COMMAND "${new_version}"
|
||||
fi
|
||||
|
||||
# Push changes
|
||||
cd fiber-docs/ || true
|
||||
git add .
|
||||
if [[ $EVENT == "push" ]]; then
|
||||
git commit -m "Add docs from ${COMMIT_URL}/commit/${latest_commit}"
|
||||
elif [[ $EVENT == "release" ]]; then
|
||||
git commit -m "Sync docs for release ${COMMIT_URL}/releases/tag/${TAG_NAME}"
|
||||
fi
|
||||
|
||||
MAX_RETRIES=5
|
||||
DELAY=5
|
||||
retry=0
|
||||
|
||||
while ((retry < MAX_RETRIES))
|
||||
do
|
||||
git push https://${TOKEN}@${REPO_URL} && break
|
||||
retry=$((retry + 1))
|
||||
git pull --rebase
|
||||
sleep $DELAY
|
||||
done
|
||||
|
||||
if ((retry == MAX_RETRIES))
|
||||
then
|
||||
echo "Failed to push after $MAX_RETRIES attempts. Exiting with 1."
|
||||
exit 1
|
||||
fi
|
22
.github/workflows/auto-labeler.yml
vendored
Normal file
22
.github/workflows/auto-labeler.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Auto labeler
|
||||
on:
|
||||
issues:
|
||||
types: [ opened, edited, milestoned ]
|
||||
pull_request_target:
|
||||
types: [ opened ]
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
checks: write
|
||||
jobs:
|
||||
labeler:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
steps:
|
||||
- name: Check Labels
|
||||
id: labeler
|
||||
uses: fuxingloh/multi-labeler@v2
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
12
.github/workflows/codeql-analysis.yml
vendored
12
.github/workflows/codeql-analysis.yml
vendored
@@ -2,10 +2,10 @@ name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, ]
|
||||
branches: [master, main]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [master]
|
||||
branches: [master, main]
|
||||
schedule:
|
||||
- cron: '0 3 * * 6'
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v2
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: go
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -51,4 +51,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
41
.github/workflows/dependabot_automerge.yml
vendored
Normal file
41
.github/workflows/dependabot_automerge.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Dependabot auto-merge
|
||||
on:
|
||||
pull_request
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
wait_for_checks:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
steps:
|
||||
- name: Wait for check is finished
|
||||
uses: lewagon/wait-on-check-action@v1.3.1
|
||||
id: wait_for_checks
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
running-workflow-name: wait_for_checks
|
||||
check-regexp: Tests
|
||||
repo-token: ${{ secrets.PR_TOKEN }}
|
||||
wait-interval: 10
|
||||
dependabot:
|
||||
needs: [wait_for_checks]
|
||||
name: Dependabot auto-merge
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
steps:
|
||||
- name: Dependabot metadata
|
||||
id: metadata
|
||||
uses: dependabot/fetch-metadata@v1.6.0
|
||||
with:
|
||||
github-token: "${{ secrets.PR_TOKEN }}"
|
||||
- name: Enable auto-merge for Dependabot PRs
|
||||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
|
||||
run: |
|
||||
gh pr review --approve "$PR_URL"
|
||||
gh pr merge --auto --merge "$PR_URL"
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{secrets.PR_TOKEN}}
|
31
.github/workflows/golangci-lint.yml
vendored
Normal file
31
.github/workflows/golangci-lint.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Golangci Lint Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "main"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- LICENSE
|
||||
- ".github/ISSUE_TEMPLATE/*.yml"
|
||||
- ".github/dependabot.yml"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- LICENSE
|
||||
- ".github/ISSUE_TEMPLATE/*.yml"
|
||||
- ".github/dependabot.yml"
|
||||
|
||||
jobs:
|
||||
golangci-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Run golangci-lint
|
||||
uses: reviewdog/action-golangci-lint@v2
|
||||
with:
|
||||
golangci_lint_flags: "--tests=false"
|
114
.github/workflows/gosec.yml
vendored
Normal file
114
.github/workflows/gosec.yml
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
name: Gosec Security Scan
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "main"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- LICENSE
|
||||
- ".github/ISSUE_TEMPLATE/*.yml"
|
||||
- ".github/dependabot.yml"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- LICENSE
|
||||
- ".github/ISSUE_TEMPLATE/*.yml"
|
||||
- ".github/dependabot.yml"
|
||||
|
||||
jobs:
|
||||
gosec-scan:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '^1.18.x'
|
||||
check-latest: true
|
||||
cache: false
|
||||
- name: Install Gosec
|
||||
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||
- name: Run Gosec (root)
|
||||
working-directory: .
|
||||
run: |
|
||||
gosec -exclude-dir=arangodb -exclude-dir=badger -exclude-dir=couchbase -exclude-dir=dynamodb -exclude-dir=etcd -exclude-dir=memcache -exclude-dir=memory -exclude-dir=mongodb -exclude-dir=mysql -exclude-dir=postgres -exclude-dir=redis -exclude-dir=ristretto -exclude-dir=sqlite3 -exclude-dir=s3 -exclude-dir=bbolt -exclude-dir=azureblob -exclude-dir=mssql -exclude-dir=pebble ./....
|
||||
# -----
|
||||
- name: Run Gosec (arangodb)
|
||||
working-directory: ./arangodb
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (badger)
|
||||
working-directory: ./badger
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (couchbase)
|
||||
working-directory: ./couchbase
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (dynamodb)
|
||||
working-directory: ./dynamodb
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (etcd)
|
||||
working-directory: ./etcd
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (memcache)
|
||||
working-directory: ./memcache
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (memory)
|
||||
working-directory: ./memory
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (mongodb)
|
||||
working-directory: ./mongodb
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (mysql)
|
||||
working-directory: ./mysql
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (postgres)
|
||||
working-directory: ./postgres
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (redis)
|
||||
working-directory: ./redis
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (sqlite3)
|
||||
working-directory: ./sqlite3
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (s3)
|
||||
working-directory: ./s3
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (ristretto)
|
||||
working-directory: ./ristretto
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (bbolt)
|
||||
working-directory: ./bbolt
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (azureblob)
|
||||
working-directory: ./azureblob
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (mssql)
|
||||
working-directory: ./mssql
|
||||
run: gosec ./...
|
||||
# -----
|
||||
- name: Run Gosec (pebble)
|
||||
working-directory: ./pebble
|
||||
run: gosec ./...
|
||||
# -----
|
39
.github/workflows/govulncheck.yml
vendored
Normal file
39
.github/workflows/govulncheck.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Govulncheck Security Scan
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "main"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- LICENSE
|
||||
- ".github/ISSUE_TEMPLATE/*.yml"
|
||||
- ".github/dependabot.yml"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- LICENSE
|
||||
- ".github/ISSUE_TEMPLATE/*.yml"
|
||||
- ".github/dependabot.yml"
|
||||
|
||||
jobs:
|
||||
govulncheck-check:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 'stable'
|
||||
check-latest: true
|
||||
cache: false
|
||||
- name: Install Govulncheck
|
||||
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
- name: Run Govulncheck
|
||||
run: govulncheck ./...
|
12
.github/workflows/linter.yml
vendored
12
.github/workflows/linter.yml
vendored
@@ -1,12 +0,0 @@
|
||||
on: [push, pull_request]
|
||||
name: Linter
|
||||
jobs:
|
||||
Golint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Golint
|
||||
uses: reviewdog/action-golangci-lint@v1
|
||||
with:
|
||||
golangci_lint_flags: "--tests=false"
|
19
.github/workflows/release-drafter-arangodb.yml
vendored
Normal file
19
.github/workflows/release-drafter-arangodb.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Arangodb
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'arangodb/**'
|
||||
jobs:
|
||||
draft_release_arangodb:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-arangodb.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-azureblob.yml
vendored
Normal file
19
.github/workflows/release-drafter-azureblob.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Azureblob
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'azureblob/**'
|
||||
jobs:
|
||||
draft_release_azureblob:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-azureblob.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-badger.yml
vendored
Normal file
19
.github/workflows/release-drafter-badger.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Badger
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'badger/**'
|
||||
jobs:
|
||||
draft_release_badger:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-badger.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-bbolt.yml
vendored
Normal file
19
.github/workflows/release-drafter-bbolt.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Bbolt
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'bbolt/**'
|
||||
jobs:
|
||||
draft_release_bbolt:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-bbolt.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-couchbase.yml
vendored
Normal file
19
.github/workflows/release-drafter-couchbase.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Couchbase
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'couchbase/**'
|
||||
jobs:
|
||||
draft_release_couchbase:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-couchbase.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-dynamodb.yml
vendored
Normal file
19
.github/workflows/release-drafter-dynamodb.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Dynamodb
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'dynamodb/**'
|
||||
jobs:
|
||||
draft_release_dynamodb:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-dynamodb.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-etcd.yml
vendored
Normal file
19
.github/workflows/release-drafter-etcd.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Etcd
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'etcd/**'
|
||||
jobs:
|
||||
draft_release_etcd:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-etcd.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-memcache.yml
vendored
Normal file
19
.github/workflows/release-drafter-memcache.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Memcache
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'memcache/**'
|
||||
jobs:
|
||||
draft_release_memcache:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-memcache.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-mongodb.yml
vendored
Normal file
19
.github/workflows/release-drafter-mongodb.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Mongodb
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'mongodb/**'
|
||||
jobs:
|
||||
draft_release_mongodb:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-mongodb.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-mssql.yml
vendored
Normal file
19
.github/workflows/release-drafter-mssql.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Mssql
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'mssql/**'
|
||||
jobs:
|
||||
draft_release_mssql:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-mssql.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-mysql.yml
vendored
Normal file
19
.github/workflows/release-drafter-mysql.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Mysql
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'mysql/**'
|
||||
jobs:
|
||||
draft_release_mysql:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-mysql.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-pebble.yml
vendored
Normal file
19
.github/workflows/release-drafter-pebble.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Pebble
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- "pebble/**"
|
||||
jobs:
|
||||
draft_release_pebble:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-pebble.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-postgres.yml
vendored
Normal file
19
.github/workflows/release-drafter-postgres.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Postgres
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'postgres/**'
|
||||
jobs:
|
||||
draft_release_postgres:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-postgres.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-redis.yml
vendored
Normal file
19
.github/workflows/release-drafter-redis.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Redis
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'redis/**'
|
||||
jobs:
|
||||
draft_release_redis:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-redis.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-ristretto.yml
vendored
Normal file
19
.github/workflows/release-drafter-ristretto.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter Ristretto
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'ristretto/**'
|
||||
jobs:
|
||||
draft_release_ristretto:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-ristretto.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19
.github/workflows/release-drafter-s3.yml
vendored
Normal file
19
.github/workflows/release-drafter-s3.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Release Drafter S3
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 's3/**'
|
||||
jobs:
|
||||
draft_release_s3:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-s3.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
20
.github/workflows/release-drafter-sqlite3.yml
vendored
Normal file
20
.github/workflows/release-drafter-sqlite3.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Release Drafter Sqlite3
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'sqlite3/**'
|
||||
jobs:
|
||||
draft_release_sqlite3:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
with:
|
||||
config-name: release-drafter-sqlite3.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
12
.github/workflows/security.yml
vendored
12
.github/workflows/security.yml
vendored
@@ -1,12 +0,0 @@
|
||||
on: [push, pull_request]
|
||||
name: Security
|
||||
jobs:
|
||||
Gosec:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Gosec
|
||||
uses: securego/gosec@master
|
||||
with:
|
||||
args: -exclude-dir=internal/*/ ./...
|
11
.github/workflows/snyk.yml
vendored
11
.github/workflows/snyk.yml
vendored
@@ -1,11 +0,0 @@
|
||||
on: [push, pull_request_target]
|
||||
name: Snyk security
|
||||
jobs:
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
uses: snyk/actions/golang@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
38
.github/workflows/sync-docs.yml
vendored
Normal file
38
.github/workflows/sync-docs.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: 'Sync docs'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- '**/*.md'
|
||||
release:
|
||||
types: [published]
|
||||
branches:
|
||||
- '*/v[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
sync-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
- name: Install JQ
|
||||
run: sudo apt-get install jq
|
||||
|
||||
- name: Sync docs
|
||||
run: ./.github/scripts/sync_docs.sh
|
||||
env:
|
||||
EVENT: ${{ github.event_name }}
|
||||
TAG_NAME: ${{ github.ref_name }}
|
||||
TOKEN: ${{ secrets.DOC_SYNC_TOKEN }}
|
37
.github/workflows/test-arangodb.yml
vendored
Normal file
37
.github/workflows/test-arangodb.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'arangodb/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'arangodb/**'
|
||||
name: "Tests ArangoDB"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
arangodb:
|
||||
image: 'arangodb:latest'
|
||||
env:
|
||||
ARANGO_NO_AUTH: 1
|
||||
ports:
|
||||
- '8529:8529'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./arangodb && go test ./... -v -race
|
32
.github/workflows/test-azureblob.yml
vendored
Normal file
32
.github/workflows/test-azureblob.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'azureblob/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'azureblob/**'
|
||||
name: "Tests Azure Blob"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Install Azurite
|
||||
run: |
|
||||
docker run -d -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --blobHost 0.0.0.0 --blobPort 10000
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./azureblob && go test ./... -v -race
|
29
.github/workflows/test-badger.yml
vendored
Normal file
29
.github/workflows/test-badger.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'badger/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'badger/**'
|
||||
name: "Tests Badger"
|
||||
jobs:
|
||||
Tests:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Test Badger
|
||||
run: cd ./badger && go test ./... -v -race
|
29
.github/workflows/test-bbolt.yml
vendored
Normal file
29
.github/workflows/test-bbolt.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'bbolt/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'bbolt/**'
|
||||
name: "Tests Bbolt"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./bbolt && go test ./... -v -race
|
35
.github/workflows/test-couchbase.yml
vendored
Normal file
35
.github/workflows/test-couchbase.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'couchbase/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'couchbase/**'
|
||||
name: "Tests Couchbase"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install couchbase
|
||||
run: |
|
||||
docker run --name couchbase -d -p 8091-8097:8091-8097 -p 9123:9123 -p 11207:11207 -p 11210:11210 -p 11280:11280 -p 18091-18097:18091-18097 couchbase:enterprise-7.1.1
|
||||
sleep 10
|
||||
docker exec --tty couchbase couchbase-cli cluster-init -c localhost:8091 --cluster-username admin --cluster-password 123456 --cluster-ramsize 256 --services data
|
||||
sleep 10
|
||||
docker exec --tty couchbase couchbase-cli bucket-create -c localhost:8091 --username admin --password 123456 --bucket fiber_storage --bucket-type couchbase --bucket-ramsize 100 --enable-flush 1
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./couchbase && go test ./... -v -race
|
35
.github/workflows/test-dynamodb.yml
vendored
Normal file
35
.github/workflows/test-dynamodb.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'dynamodb/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'dynamodb/**'
|
||||
name: "Tests DynamoDB"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: 'amazon/dynamodb-local:latest'
|
||||
ports:
|
||||
- '8000:8000'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./dynamodb && go test ./... -v -race
|
37
.github/workflows/test-etcd.yml
vendored
Normal file
37
.github/workflows/test-etcd.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'etcd/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'etcd/**'
|
||||
name: "Tests Etcd"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install etcd
|
||||
run: |
|
||||
docker run -d --name Etcd-server \
|
||||
--publish 2379:2379 \
|
||||
--publish 2380:2380 \
|
||||
--env ALLOW_NONE_AUTHENTICATION=yes \
|
||||
--env ETCD_ADVERTISE_CLIENT_URLS=http://etcd-server:2379 \
|
||||
bitnami/etcd:latest
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./etcd && go test ./... -v -race
|
62
.github/workflows/test-memcache.yml
vendored
62
.github/workflows/test-memcache.yml
vendored
@@ -1,29 +1,35 @@
|
||||
'on':
|
||||
- push
|
||||
- pull_request
|
||||
name: Memcache
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'memcache/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'memcache/**'
|
||||
name: "Tests Memcache"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: 'memcached:latest'
|
||||
ports:
|
||||
- '11211:11211'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Test
|
||||
run: cd ./memcache && go test ./... -v -race
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: 'memcached:latest'
|
||||
ports:
|
||||
- '11211:11211'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./memcache && go test ./... -v -race
|
||||
|
30
.github/workflows/test-memory.yml
vendored
Normal file
30
.github/workflows/test-memory.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'memory/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'memory/**'
|
||||
name: "Tests Local Storage"
|
||||
jobs:
|
||||
Tests:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Test Memory
|
||||
run: cd ./memory && go test ./... -v -race
|
63
.github/workflows/test-mongodb.yml
vendored
63
.github/workflows/test-mongodb.yml
vendored
@@ -1,29 +1,36 @@
|
||||
'on':
|
||||
- push
|
||||
- pull_request
|
||||
name: MongoDB
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'mongodb/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'mongodb/**'
|
||||
name: "Tests Mongodb"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: 'mongo:latest'
|
||||
ports:
|
||||
- '27017:27017'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Test
|
||||
run: cd ./mongodb && go test ./... -v -race
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: 'mongo:latest'
|
||||
ports:
|
||||
- '27017:27017'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./mongodb && go test ./... -v -race
|
||||
|
||||
|
50
.github/workflows/test-mssql.yml
vendored
Normal file
50
.github/workflows/test-mssql.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'mssql/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'mssql/**'
|
||||
name: "Tests MSSQL"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mssql:
|
||||
image: 'mcmoe/mssqldocker:latest'
|
||||
ports:
|
||||
- '1433:1433'
|
||||
env:
|
||||
ACCEPT_EULA: Y
|
||||
SA_PASSWORD: MsSql!1234
|
||||
MSSQL_DB: master
|
||||
MSSQL_USER: sa
|
||||
MSSQL_PASSWORD: MsSql!1234
|
||||
options: >-
|
||||
--health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD -Q 'select 1' -b -o /dev/null"
|
||||
--health-interval 1s
|
||||
--health-timeout 30s
|
||||
--health-start-period 10s
|
||||
--health-retries 20
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./mssql && go test ./... -v -race
|
||||
env:
|
||||
MSSQL_DATABASE: master
|
||||
MSSQL_USERNAME: sa
|
||||
MSSQL_PASSWORD: MsSql!1234
|
86
.github/workflows/test-mysql.yml
vendored
86
.github/workflows/test-mysql.yml
vendored
@@ -1,41 +1,47 @@
|
||||
'on':
|
||||
- push
|
||||
- pull_request
|
||||
name: MySQL
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'mysql/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'mysql/**'
|
||||
name: "Tests MySQL"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: 'mysql:latest'
|
||||
env:
|
||||
MYSQL_DATABASE: fiber
|
||||
MYSQL_USER: username
|
||||
MYSQL_PASSWORD: password
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
ports:
|
||||
- '3306:3306'
|
||||
options: >-
|
||||
--health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
|
||||
5s --health-retries 5
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Test
|
||||
run: cd ./mysql && go test ./... -v -race
|
||||
env:
|
||||
MYSQL_USERNAME: username
|
||||
MYSQL_PASSWORD: password
|
||||
MYSQL_DATABASE: fiber
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: 'mysql:latest'
|
||||
env:
|
||||
MYSQL_DATABASE: fiber
|
||||
MYSQL_USER: username
|
||||
MYSQL_PASSWORD: password
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
ports:
|
||||
- '3306:3306'
|
||||
options: >-
|
||||
--health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
|
||||
5s --health-retries 5
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./mysql && go test ./... -v -race
|
||||
env:
|
||||
MYSQL_USERNAME: username
|
||||
MYSQL_PASSWORD: password
|
||||
MYSQL_DATABASE: fiber
|
||||
|
28
.github/workflows/test-pebble.yml
vendored
Normal file
28
.github/workflows/test-pebble.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- "pebble/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- "pebble/**"
|
||||
name: "Tests pebble"
|
||||
jobs:
|
||||
Tests:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Test Pebble
|
||||
run: cd ./pebble && go test ./... -v -race
|
82
.github/workflows/test-postgres.yml
vendored
82
.github/workflows/test-postgres.yml
vendored
@@ -1,40 +1,44 @@
|
||||
'on':
|
||||
- push
|
||||
- pull_request
|
||||
name: Postgres
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'postgres/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'postgres/**'
|
||||
name: "Tests Postgres"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: 'postgres:latest'
|
||||
ports:
|
||||
- '5432:5432'
|
||||
env:
|
||||
POSTGRES_DB: fiber
|
||||
POSTGRES_USER: username
|
||||
POSTGRES_PASSWORD: password
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
||||
--health-retries 5
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Test
|
||||
run: cd ./postgres && go test ./... -v -race
|
||||
env:
|
||||
POSTGRES_DATABASE: fiber
|
||||
POSTGRES_USERNAME: username
|
||||
POSTGRES_PASSWORD: password
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: 'postgres:latest'
|
||||
ports:
|
||||
- '5432:5432'
|
||||
env:
|
||||
POSTGRES_DB: fiber
|
||||
POSTGRES_USER: username
|
||||
POSTGRES_PASSWORD: "pass#w%rd"
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
||||
--health-retries 5
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./postgres && go test ./... -v -race
|
||||
env:
|
||||
POSTGRES_DATABASE: fiber
|
||||
POSTGRES_USERNAME: username
|
||||
POSTGRES_PASSWORD: "pass#w%rd"
|
||||
|
86
.github/workflows/test-redis.yml
vendored
86
.github/workflows/test-redis.yml
vendored
@@ -1,29 +1,59 @@
|
||||
'on':
|
||||
- push
|
||||
- pull_request
|
||||
name: Redis
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'redis/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'redis/**'
|
||||
name: "Tests Redis"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
redis:
|
||||
image: 'redis:latest'
|
||||
ports:
|
||||
- '6379:6379'
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Run Test
|
||||
run: cd ./redis && go test ./... -v -race
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
redis:
|
||||
- '6.x'
|
||||
- '7.x'
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Redis
|
||||
uses: shogo82148/actions-setup-redis@v1
|
||||
with:
|
||||
redis-version: ${{ matrix.redis }}
|
||||
auto-start: 'false'
|
||||
redis-port: '6379'
|
||||
redis-tls-port: '6380'
|
||||
|
||||
- name: Run Redis
|
||||
run: |
|
||||
redis-server --tls-port 6380 --port 6379 \
|
||||
--tls-cert-file ./redis/tests/tls/redis.crt \
|
||||
--tls-key-file ./redis/tests/tls/redis.key \
|
||||
--tls-ca-cert-file ./redis/tests/tls/ca.crt&
|
||||
|
||||
- name: Setup Redis Cluster
|
||||
uses: vishnudxb/redis-cluster@1.0.5
|
||||
with:
|
||||
master1-port: 7000
|
||||
master2-port: 7001
|
||||
master3-port: 7002
|
||||
slave1-port: 7003
|
||||
slave2-port: 7004
|
||||
slave3-port: 7005
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
|
||||
- name: Run Test
|
||||
run: cd ./redis && go test ./... -v -race
|
||||
|
29
.github/workflows/test-ristretto.yml
vendored
Normal file
29
.github/workflows/test-ristretto.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'ristretto/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'ristretto/**'
|
||||
name: "Tests Ristretto"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./ristretto && go test ./... -v -race
|
38
.github/workflows/test-s3.yml
vendored
Normal file
38
.github/workflows/test-s3.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 's3/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 's3/**'
|
||||
name: "Tests S3"
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
steps:
|
||||
- name: Install MinIO
|
||||
run: |
|
||||
docker run -d -p 9000:9000 --name minio minio/minio server /data
|
||||
|
||||
export AWS_ACCESS_KEY_ID=minioadmin
|
||||
export AWS_SECRET_ACCESS_KEY=minioadmin
|
||||
export AWS_EC2_METADATA_DISABLED=true
|
||||
|
||||
aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://testbucket
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Run Test
|
||||
run: cd ./s3 && go test ./... -v -race
|
34
.github/workflows/test-sqlite3.yml
vendored
Normal file
34
.github/workflows/test-sqlite3.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- 'sqlite3/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'sqlite3/**'
|
||||
name: "Tests Sqlite3"
|
||||
jobs:
|
||||
Tests:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.17.x
|
||||
- 1.18.x
|
||||
- 1.19.x
|
||||
- 1.20.x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Test SQLite3 - with -race check
|
||||
if: runner.os != 'Windows'
|
||||
run: cd ./sqlite3 && go test ./... -v -race
|
||||
- name: Test SQLite3 - without -race check
|
||||
if: runner.os == 'Windows'
|
||||
run: cd ./sqlite3 && go test ./... -v
|
28
.github/workflows/test.yml
vendored
28
.github/workflows/test.yml
vendored
@@ -1,28 +0,0 @@
|
||||
'on':
|
||||
- push
|
||||
- pull_request
|
||||
name: Local Storage
|
||||
jobs:
|
||||
Tests:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
runs-on: '${{ matrix.platform }}'
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '${{ matrix.go-version }}'
|
||||
- name: Fetch Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Test Badger
|
||||
run: cd ./badger && go test ./... -v -race
|
||||
- name: Test Memory
|
||||
run: cd ./memory && go test ./... -v -race
|
||||
- name: Test SQLite3
|
||||
run: cd ./sqlite3 && go test ./... -v -race
|
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
*.tmp
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# IDE files
|
||||
.vscode
|
||||
.DS_Store
|
||||
.idea
|
||||
|
||||
# Misc
|
||||
*.fiber.gz
|
||||
*.fasthttp.gz
|
||||
*.pprof
|
||||
*.workspace
|
||||
|
||||
# Dependencies
|
||||
/vendor/
|
||||
vendor/
|
||||
vendor
|
||||
/Godeps/
|
70
README.md
Normal file
70
README.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: 👋 Welcome
|
||||
description: 📦 Premade storage drivers for 🚀 Fiber.
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
<p align="center">
|
||||
<img height="125" alt="Fiber" src="https://raw.githubusercontent.com/gofiber/storage/master/.github/logo-dark.svg#gh-dark-mode-only" />
|
||||
<img height="125" alt="Fiber" src="https://raw.githubusercontent.com/gofiber/storage/master/.github/logo.svg#gh-light-mode-only" />
|
||||
<br/>
|
||||
|
||||
<a href="https://pkg.go.dev/github.com/gofiber/storage?tab=doc">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7&style=flat"/>
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/gofiber/storage">
|
||||
<img src="https://img.shields.io/badge/%F0%9F%93%9D%20goreport-A%2B-75C46B"/>
|
||||
</a>
|
||||
<a href="https://gofiber.io/discord">
|
||||
<img src="https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Premade storage drivers that implement the [`Storage`](https://github.com/gofiber/storage/blob/main/storage.go) interface, designed to be used with various [Fiber middlewares](https://github.com/gofiber/fiber/tree/master/middleware).
|
||||
|
||||
```go
|
||||
// Storage interface for communicating with different database/key-value
|
||||
// providers. Visit https://github.com/gofiber/storage for more info.
|
||||
type Storage interface {
|
||||
// Get gets the value for the given key.
|
||||
// `nil, nil` is returned when the key does not exist
|
||||
Get(key string) ([]byte, error)
|
||||
|
||||
// Set stores the given value for the given key along
|
||||
// with an expiration value, 0 means no expiration.
|
||||
// Empty key or value will be ignored without an error.
|
||||
Set(key string, val []byte, exp time.Duration) error
|
||||
|
||||
// Delete deletes the value for the given key.
|
||||
// It returns no error if the storage does not contain the key,
|
||||
Delete(key string) error
|
||||
|
||||
// Reset resets the storage and delete all keys.
|
||||
Reset() error
|
||||
|
||||
// Close closes the storage and will stop any running garbage
|
||||
// collectors and open connections.
|
||||
Close() error
|
||||
}
|
||||
```
|
||||
|
||||
## 📑 Storage Implementations
|
||||
|
||||
- [ArangoDB](./arangodb/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+ArangoDB%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-arangodb.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [AzureBlob](./azureblob/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Azure+Blob%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-azureblob.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Badger](./badger/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Badger%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-badger.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Bbolt](./bbolt) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Bbolt%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-bbolt.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Couchbase](./couchbase/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Couchbase%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-couchbase.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [DynamoDB](./dynamodb/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+DynamoDB%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-dynamodb.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Etcd](./etcd/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Etcd%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-etcd.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Memcache](./memcache/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Memcache%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-memcache.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Memory](./memory/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Local+Storage%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-memory.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [MongoDB](./mongodb/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Mongodb%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mongodb.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [MSSQL](./mssql/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+MSSQL%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mssql.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [MySQL](./mysql/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+MySQL%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mysql.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Pebble](./pebble/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Pebble%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-pebble.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Postgres](./postgres/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Postgres%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-postgres.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [Redis](./redis/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Redis%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [S3](./s3/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+S3%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-s3.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
- [SQLite3](./sqlite3/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Sqlite3%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-sqlite3.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
|
||||
|
118
arangodb/README.md
Normal file
118
arangodb/README.md
Normal file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
id: arangodb
|
||||
title: ArangoDB
|
||||
---
|
||||
|
||||

|
||||
[](https://gofiber.io/discord)
|
||||

|
||||

|
||||

|
||||
|
||||
A ArangoDB storage driver using `arangodb/go-driver` and [arangodb/go-driver](https://github.com/arangodb/go-driver).
|
||||
|
||||
### Table of Contents
|
||||
- [Signatures](#signatures)
|
||||
- [Installation](#installation)
|
||||
- [Examples](#examples)
|
||||
- [Config](#config)
|
||||
- [Default Config](#default-config)
|
||||
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Reset() error
|
||||
func (s *Storage) Close() error
|
||||
func (s *Storage) Conn() driver.Client
|
||||
```
|
||||
### Installation
|
||||
ArangoDB is tested on the 2 last (1.14/1.15) [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||
```bash
|
||||
go mod init github.com/<user>/<repo>
|
||||
```
|
||||
And then install the mysql implementation:
|
||||
```bash
|
||||
go get github.com/gofiber/storage/arangodb
|
||||
```
|
||||
|
||||
### Examples
|
||||
Import the storage package.
|
||||
```go
|
||||
import "github.com/gofiber/storage/arangodb"
|
||||
```
|
||||
|
||||
You can use the following possibilities to create a storage:
|
||||
```go
|
||||
// Initialize default config
|
||||
store := arangodb.New()
|
||||
|
||||
// Initialize custom config
|
||||
store := arangodb.New(arangodb.Config{
|
||||
Host: "http://127.0.0.1",
|
||||
Port: 8529,
|
||||
Database: "fiber",
|
||||
Collection: "fiber_storage",
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
})
|
||||
```
|
||||
|
||||
### Config
|
||||
```go
|
||||
type Config struct {
|
||||
// Host name where the DB is hosted
|
||||
//
|
||||
// Optional. Default is "http://127.0.0.1"
|
||||
Host string
|
||||
|
||||
// Port where the DB is listening on
|
||||
//
|
||||
// Optional. Default is 8529
|
||||
Port int
|
||||
|
||||
// Server username
|
||||
//
|
||||
// Optional. Default is ""
|
||||
Username string
|
||||
|
||||
// Server password
|
||||
//
|
||||
// Optional. Default is ""
|
||||
Password string
|
||||
|
||||
// Database name
|
||||
//
|
||||
// Optional. Default is "fiber"
|
||||
Database string
|
||||
|
||||
// Collection name
|
||||
//
|
||||
// Optional. Default is "fiber_storage"
|
||||
Collection string
|
||||
|
||||
// Reset clears any existing keys in existing collection
|
||||
//
|
||||
// Optional. Default is false
|
||||
Reset bool
|
||||
// Time before deleting expired keys
|
||||
//
|
||||
// Optional. Default is 10 * time.Second
|
||||
GCInterval time.Duration
|
||||
}
|
||||
```
|
||||
|
||||
### Default Config
|
||||
Used only for optional fields
|
||||
```go
|
||||
var ConfigDefault = Config{
|
||||
Host: "http://127.0.0.1",
|
||||
Port: 8529,
|
||||
Database: "fiber",
|
||||
Collection: "fiber_storage",
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
}
|
||||
```
|
253
arangodb/arangodb.go
Normal file
253
arangodb/arangodb.go
Normal file
@@ -0,0 +1,253 @@
|
||||
package arangodb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/arangodb/go-driver"
|
||||
"github.com/arangodb/go-driver/http"
|
||||
"github.com/gofiber/utils"
|
||||
)
|
||||
|
||||
// Storage interface that is implemented by storage providers
|
||||
type Storage struct {
|
||||
db driver.Database
|
||||
gcInterval time.Duration
|
||||
done chan struct{}
|
||||
|
||||
// Arango mandatory fields
|
||||
connection driver.Connection
|
||||
client driver.Client
|
||||
collection driver.Collection
|
||||
bindingParams map[string]interface{}
|
||||
config Config
|
||||
// AQL query used to remove expired keys
|
||||
aqlRemoveGC string
|
||||
}
|
||||
|
||||
type model struct {
|
||||
// respect key format field name for ArangoDB
|
||||
Key string `json:"_key"`
|
||||
Val string `json:"val"`
|
||||
Exp int64 `json:"exp"`
|
||||
}
|
||||
|
||||
// New creates a new storage
|
||||
func New(config ...Config) *Storage {
|
||||
// Set default config
|
||||
cfg := configDefault(config...)
|
||||
|
||||
// create connection object to arango
|
||||
conn, err := http.NewConnection(http.ConnectionConfig{
|
||||
Endpoints: []string{fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// instantiate client after the connection is started
|
||||
client, err := driver.NewClient(driver.ClientConfig{
|
||||
Connection: conn,
|
||||
Authentication: driver.BasicAuthentication(cfg.Username, cfg.Password),
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// check if the database exists
|
||||
// if not create it
|
||||
// (it works only with admin privilege user)
|
||||
exists, err := client.DatabaseExists(context.Background(), cfg.Database)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if !exists {
|
||||
_, err = client.CreateDatabase(context.Background(), cfg.Database, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
database, err := client.Database(context.Background(), cfg.Database)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
found, _ := database.CollectionExists(context.Background(), cfg.Collection)
|
||||
|
||||
// Create the collection if not exists
|
||||
var collection driver.Collection
|
||||
if !found {
|
||||
// Create
|
||||
collection, err = database.CreateCollection(context.Background(), cfg.Collection, &driver.CreateCollectionOptions{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
// Get the collection
|
||||
collection, err = database.Collection(context.Background(), cfg.Collection)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Truncate collection if Reset set to true
|
||||
if cfg.Reset {
|
||||
err = collection.Truncate(context.Background())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Create storage
|
||||
store := &Storage{
|
||||
gcInterval: cfg.GCInterval,
|
||||
db: database,
|
||||
collection: collection,
|
||||
client: client,
|
||||
connection: conn,
|
||||
config: cfg,
|
||||
done: make(chan struct{}),
|
||||
aqlRemoveGC: fmt.Sprintf("FOR doc IN %s\n FILTER doc.exp <= @exp \n REMOVE { _key: doc._key } IN %s", collection.Name(), collection.Name()),
|
||||
}
|
||||
|
||||
// Start garbage collector
|
||||
go store.gc()
|
||||
|
||||
return store
|
||||
}
|
||||
|
||||
// Get value by key
|
||||
func (s *Storage) Get(key string) ([]byte, error) {
|
||||
if len(key) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
// Check if the document exists
|
||||
// to avoid errors later
|
||||
exists, err := s.collection.DocumentExists(ctx, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// instead of returning an error if not exists
|
||||
// return nil
|
||||
if !exists {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// result model
|
||||
var model model
|
||||
_, err = s.collection.ReadDocument(ctx, key, &model)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If the expiration time has already passed, then return nil
|
||||
if model.Exp != 0 && model.Exp <= time.Now().Unix() {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return utils.UnsafeBytes(model.Val), nil
|
||||
}
|
||||
|
||||
// Set key with value
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
|
||||
// Ain't Nobody Got Time For That
|
||||
if len(key) <= 0 || len(val) <= 0 {
|
||||
return nil
|
||||
}
|
||||
var expireAt int64
|
||||
if exp != 0 {
|
||||
expireAt = time.Now().Add(exp).Unix()
|
||||
}
|
||||
valStr := utils.UnsafeString(val)
|
||||
|
||||
// create the structure for the storage
|
||||
data := model{
|
||||
Key: key,
|
||||
Val: valStr,
|
||||
Exp: expireAt,
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
// Arango does not support documents with the same key
|
||||
// So we need to check if the document exists
|
||||
exists, err := s.collection.DocumentExists(ctx, key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Update the document if exists
|
||||
if exists {
|
||||
_, err = s.collection.UpdateDocument(ctx, key, data)
|
||||
return err
|
||||
}
|
||||
// Otherwise create it
|
||||
_, err = s.collection.CreateDocument(ctx, data)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete value by key
|
||||
func (s *Storage) Delete(key string) error {
|
||||
// Ain't Nobody Got Time For That
|
||||
if len(key) <= 0 {
|
||||
return nil
|
||||
}
|
||||
_, err := s.collection.RemoveDocument(context.Background(), key)
|
||||
return err
|
||||
}
|
||||
|
||||
// Reset all keys
|
||||
// truncate the collection
|
||||
func (s *Storage) Reset() error {
|
||||
return s.collection.Truncate(context.Background())
|
||||
}
|
||||
|
||||
// Close the database
|
||||
// Arango does not provide a method to close the connection
|
||||
// more info @https://github.com/arangodb/go-driver/issues/43
|
||||
func (s *Storage) Close() error {
|
||||
// Stop gc
|
||||
s.done <- struct{}{}
|
||||
// reset connection params
|
||||
s.db = nil
|
||||
s.collection = nil
|
||||
s.connection = nil
|
||||
s.bindingParams = nil
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// execute query
|
||||
func (s *Storage) exec(query string) error {
|
||||
// execute query
|
||||
_, err := s.db.Query(context.Background(), query, s.bindingParams)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// reset binding params
|
||||
s.bindingParams = map[string]interface{}{}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Garbage collector to delete expired keys
|
||||
func (s *Storage) gc() {
|
||||
ticker := time.NewTicker(s.gcInterval)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-s.done:
|
||||
return
|
||||
case t := <-ticker.C:
|
||||
// set the expiration
|
||||
s.bindingParams["exp"] = t.Unix()
|
||||
_ = s.exec(s.aqlRemoveGC)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return database client
|
||||
func (s *Storage) Conn() driver.Client {
|
||||
return s.client
|
||||
}
|
138
arangodb/arangodb_test.go
Normal file
138
arangodb/arangodb_test.go
Normal file
@@ -0,0 +1,138 @@
|
||||
package arangodb
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/utils"
|
||||
)
|
||||
|
||||
var testStore = New(Config{
|
||||
Reset: true,
|
||||
})
|
||||
|
||||
func Test_ARANGODB_Set(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Upsert(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Get(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, val, result)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Set_Expiration(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
exp = 1 * time.Second
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, exp)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
time.Sleep(1100 * time.Millisecond)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Get_Expired(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Get_NotExist(t *testing.T) {
|
||||
|
||||
result, err := testStore.Get("notexist")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Delete(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Delete(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Reset(t *testing.T) {
|
||||
var (
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set("john1", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Set("john2", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Reset()
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get("john1")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
|
||||
result, err = testStore.Get("john2")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Non_UTF8(t *testing.T) {
|
||||
val := []byte("0xF5")
|
||||
|
||||
err := testStore.Set("0xF6", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get("0xF6")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, val, result)
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Close(t *testing.T) {
|
||||
utils.AssertEqual(t, nil, testStore.Close())
|
||||
}
|
||||
|
||||
func Test_ARANGODB_Conn(t *testing.T) {
|
||||
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||
}
|
92
arangodb/config.go
Normal file
92
arangodb/config.go
Normal file
@@ -0,0 +1,92 @@
|
||||
package arangodb
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Config defines the config for storage.
|
||||
type Config struct {
|
||||
// Host name where the DB is hosted
|
||||
//
|
||||
// Optional. Default is "http://127.0.0.1"
|
||||
Host string
|
||||
|
||||
// Port where the DB is listening on
|
||||
//
|
||||
// Optional. Default is 8529
|
||||
Port int
|
||||
|
||||
// Server username
|
||||
//
|
||||
// Optional. Default is ""
|
||||
Username string
|
||||
|
||||
// Server password
|
||||
//
|
||||
// Optional. Default is ""
|
||||
Password string
|
||||
|
||||
// Database name
|
||||
//
|
||||
// Optional. Default is "fiber"
|
||||
Database string
|
||||
|
||||
// Collection name
|
||||
//
|
||||
// Optional. Default is "fiber_storage"
|
||||
Collection string
|
||||
|
||||
// Reset clears any existing keys in existing collection
|
||||
//
|
||||
// Optional. Default is false
|
||||
Reset bool
|
||||
// Time before deleting expired keys
|
||||
//
|
||||
// Optional. Default is 10 * time.Second
|
||||
GCInterval time.Duration
|
||||
}
|
||||
|
||||
// ConfigDefault is the default config
|
||||
var ConfigDefault = Config{
|
||||
Host: "http://127.0.0.1",
|
||||
Port: 8529,
|
||||
Database: "fiber",
|
||||
Collection: "fiber_storage",
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
}
|
||||
|
||||
// Helper function to set default values
|
||||
func configDefault(config ...Config) Config {
|
||||
// Return default config if nothing provided
|
||||
if len(config) < 1 {
|
||||
return ConfigDefault
|
||||
}
|
||||
|
||||
// Override default config
|
||||
cfg := config[0]
|
||||
|
||||
// Set default values
|
||||
if cfg.Host == "" {
|
||||
cfg.Host = ConfigDefault.Host
|
||||
} else {
|
||||
if !strings.HasPrefix(cfg.Host, "http") {
|
||||
panic("Host should start with `http://` or `https://`")
|
||||
}
|
||||
}
|
||||
if cfg.Port <= 0 {
|
||||
cfg.Port = ConfigDefault.Port
|
||||
}
|
||||
if cfg.Database == "" {
|
||||
cfg.Database = ConfigDefault.Database
|
||||
}
|
||||
if cfg.Collection == "" {
|
||||
cfg.Collection = ConfigDefault.Collection
|
||||
}
|
||||
|
||||
if int(cfg.GCInterval.Seconds()) <= 0 {
|
||||
cfg.GCInterval = ConfigDefault.GCInterval
|
||||
}
|
||||
return cfg
|
||||
}
|
13
arangodb/go.mod
Normal file
13
arangodb/go.mod
Normal file
@@ -0,0 +1,13 @@
|
||||
module github.com/gofiber/storage/arangodb
|
||||
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/arangodb/go-driver v1.6.0
|
||||
github.com/gofiber/utils v1.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
)
|
54
arangodb/go.sum
Normal file
54
arangodb/go.sum
Normal file
@@ -0,0 +1,54 @@
|
||||
github.com/arangodb/go-driver v1.6.0 h1:NFWj/idqXZxhFVueihMSI2R9NotNIsgvNfM/xmpekb4=
|
||||
github.com/arangodb/go-driver v1.6.0/go.mod h1:HQmdGkvNMVBTE3SIPSQ8T/ZddC6iwNsfMR+dDJQxIsI=
|
||||
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g=
|
||||
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho=
|
||||
github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9/go.mod h1:GgB8SF9nRG+GqaDtLcwJZsQFhcogVCJ79j4EdT0c2V4=
|
||||
github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM=
|
||||
github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
||||
github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
112
azureblob/README.md
Normal file
112
azureblob/README.md
Normal file
@@ -0,0 +1,112 @@
|
||||
---
|
||||
id: azureblob
|
||||
title: Azure Blob
|
||||
---
|
||||
|
||||

|
||||
[](https://gofiber.io/discord)
|
||||

|
||||

|
||||

|
||||
|
||||
[Azure Blob storage](https://azure.microsoft.com/en-us/products/storage/blobs/#overview) is Microsoft's object storage solution for the cloud.
|
||||
|
||||
> NOTE: Go **1.18** or later is required. Source: [link](https://github.com/Azure/azure-sdk-for-go/blob/main/README.md)
|
||||
|
||||
### Table of Contents
|
||||
|
||||
- [Signatures](#signatures)
|
||||
- [Installation](#installation)
|
||||
- [Examples](#examples)
|
||||
- [Config](#config)
|
||||
- [Default Config](#default-config)
|
||||
|
||||
### Signatures
|
||||
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Reset() error
|
||||
func (s *Storage) Close() error
|
||||
func (s *Storage) Conn() *azblob.Client
|
||||
```
|
||||
|
||||
### Installation
|
||||
|
||||
Azure blob storage driver is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||
|
||||
```bash
|
||||
go mod init github.com/<user>/<repo>
|
||||
```
|
||||
|
||||
And then install the azure blob implementation:
|
||||
|
||||
```bash
|
||||
go get github.com/gofiber/storage/azureblob
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
Import the storage package.
|
||||
|
||||
```go
|
||||
import "github.com/gofiber/storage/azureblob"
|
||||
```
|
||||
|
||||
You can use the following possibilities to create a storage:
|
||||
|
||||
```go
|
||||
// Initialize default config
|
||||
store := azureblob.New()
|
||||
|
||||
// Initialize custom config
|
||||
store := azureblob.New(azureblob.Config{
|
||||
Account: "test",
|
||||
Container: "test",
|
||||
Credentials: Credentials{
|
||||
Account: "test",
|
||||
Key: "YXp1cml0ZWtleQo=",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Config
|
||||
|
||||
```go
|
||||
type Config struct {
|
||||
// Storage account name.
|
||||
Account string
|
||||
// Container name.
|
||||
Container string
|
||||
// Storage endpoint.
|
||||
// Optional. Default: "https://STORAGEACCOUNTNAME.blob.core.windows.net"
|
||||
Endpoint string
|
||||
// Request timeout.
|
||||
// Optional. Default is 0 (no timeout)
|
||||
RequestTimeout time.Duration
|
||||
// Reset clears any existing keys in existing container.
|
||||
// Optional. Default is false
|
||||
Reset bool
|
||||
// Credentials overrides AWS access key and AWS secret access key. Not recommended.
|
||||
// Optional. Default is Credentials{}
|
||||
Credentials Credentials
|
||||
// The maximum number of times requests that encounter retryable failures should be attempted.
|
||||
// Optional. Default is 3
|
||||
MaxAttempts int
|
||||
}
|
||||
```
|
||||
|
||||
### Default Config
|
||||
|
||||
```go
|
||||
var ConfigDefault = Config{
|
||||
Account: "",
|
||||
Container: "",
|
||||
Endpoint: "",
|
||||
RequestTimeout: 0,
|
||||
Reset: false,
|
||||
MaxAttempts: 3,
|
||||
}
|
||||
```
|
138
azureblob/azureblob.go
Normal file
138
azureblob/azureblob.go
Normal file
@@ -0,0 +1,138 @@
|
||||
package azureblob
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/bloberror"
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Storage interface that is implemented by storage providers
|
||||
type Storage struct {
|
||||
client *azblob.Client
|
||||
container string
|
||||
requestTimeout time.Duration
|
||||
}
|
||||
|
||||
// New creates a new storage
|
||||
func New(config ...Config) *Storage {
|
||||
// Set default config
|
||||
cfg := configure(config...)
|
||||
// Set the azure credentials
|
||||
cred, err := azblob.NewSharedKeyCredential(cfg.Credentials.Account, cfg.Credentials.Key)
|
||||
handleError(err)
|
||||
client, err := azblob.NewClientWithSharedKeyCredential(cfg.Endpoint, cred, nil)
|
||||
handleError(err)
|
||||
_, err = client.CreateContainer(context.TODO(), cfg.Container, nil)
|
||||
if err != nil {
|
||||
if !bloberror.HasCode(err, bloberror.ContainerAlreadyExists) {
|
||||
panic(fmt.Sprintf("invalid config:, %v", err))
|
||||
}
|
||||
}
|
||||
storage := &Storage{
|
||||
client: client,
|
||||
container: cfg.Container,
|
||||
requestTimeout: cfg.RequestTimeout,
|
||||
}
|
||||
|
||||
// Reset all entries if set to true
|
||||
if cfg.Reset {
|
||||
if err := storage.Reset(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
return storage
|
||||
}
|
||||
|
||||
// Get value by key
|
||||
func (s *Storage) Get(key string) ([]byte, error) {
|
||||
if len(key) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
ctx, cancel := s.requestContext()
|
||||
defer cancel()
|
||||
resp, err := s.client.DownloadStream(ctx, s.container, key, nil)
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
return data, err
|
||||
}
|
||||
|
||||
// Set key with value
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
|
||||
if len(key) <= 0 {
|
||||
return nil
|
||||
}
|
||||
ctx, cancel := s.requestContext()
|
||||
defer cancel()
|
||||
_, err := s.client.UploadBuffer(ctx, s.container, key, val, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete entry by key
|
||||
func (s *Storage) Delete(key string) error {
|
||||
if len(key) <= 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
ctx, cancel := s.requestContext()
|
||||
defer cancel()
|
||||
_, err := s.client.DeleteBlob(ctx, s.container, key, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
// Reset all entries
|
||||
func (s *Storage) Reset() error {
|
||||
ctx, cancel := s.requestContext()
|
||||
defer cancel()
|
||||
//_, err := s.client.DeleteContainer(ctx, s.container, nil)
|
||||
//return err
|
||||
pager := s.client.NewListBlobsFlatPager(s.container, nil)
|
||||
errCounter := 0
|
||||
for pager.More() {
|
||||
resp, err := pager.NextPage(ctx)
|
||||
if err != nil {
|
||||
errCounter = errCounter + 1
|
||||
}
|
||||
for _, v := range resp.Segment.BlobItems {
|
||||
_, err = s.client.DeleteBlob(ctx, s.container, *v.Name, nil)
|
||||
if err != nil {
|
||||
errCounter = errCounter + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
if errCounter > 0 {
|
||||
return errors.New(fmt.Sprintf("%d errors occured while resetting", errCounter))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Conn returns storage client
|
||||
func (s *Storage) Conn() *azblob.Client {
|
||||
return s.client
|
||||
}
|
||||
|
||||
// Close the storage connextion
|
||||
func (s *Storage) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Context for making requests will timeout if a non-zero timeout is configured
|
||||
func (s *Storage) requestContext() (context.Context, context.CancelFunc) {
|
||||
if s.requestTimeout > 0 {
|
||||
return context.WithTimeout(context.Background(), s.requestTimeout)
|
||||
}
|
||||
return context.Background(), func() {}
|
||||
}
|
||||
|
||||
// handleError is a helper to panic on error
|
||||
func handleError(err error) {
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("invalid config:, %v", err))
|
||||
}
|
||||
}
|
137
azureblob/azureblob_test.go
Normal file
137
azureblob/azureblob_test.go
Normal file
@@ -0,0 +1,137 @@
|
||||
package azureblob
|
||||
|
||||
import (
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/bloberror"
|
||||
"github.com/gofiber/fiber/v2/utils"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func newStore() *Storage {
|
||||
return New(Config{
|
||||
Account: "devstoreaccount1",
|
||||
Container: "test",
|
||||
Endpoint: "http://127.0.0.1:10000/devstoreaccount1",
|
||||
Credentials: Credentials{
|
||||
Account: "devstoreaccount1",
|
||||
Key: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==",
|
||||
},
|
||||
})
|
||||
}
|
||||
func Test_AzureBlob_Get(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
testStore := newStore()
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, val, result)
|
||||
}
|
||||
|
||||
func Test_AzureBlob_Set(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
testStore := newStore()
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_AzureBlob_Delete(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
testStore := newStore()
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Delete(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
if err != nil {
|
||||
if bloberror.HasCode(err, bloberror.BlobNotFound) {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_AzureBlob_Override(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
testStore := newStore()
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_AzureBlob_Get_NotExist(t *testing.T) {
|
||||
testStore := newStore()
|
||||
result, err := testStore.Get("notexist")
|
||||
if err != nil {
|
||||
if bloberror.HasCode(err, bloberror.BlobNotFound) {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_AzureBlob_Reset(t *testing.T) {
|
||||
var (
|
||||
val = []byte("doe")
|
||||
)
|
||||
testStore := newStore()
|
||||
|
||||
err := testStore.Set("john1", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Set("john2", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Reset()
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get("john1")
|
||||
if err != nil {
|
||||
if bloberror.HasCode(err, bloberror.BlobNotFound) {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
|
||||
result, err = testStore.Get("john2")
|
||||
if err != nil {
|
||||
if bloberror.HasCode(err, bloberror.BlobNotFound) {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_S3_Conn(t *testing.T) {
|
||||
testStore := newStore()
|
||||
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||
}
|
||||
|
||||
func Test_AzureBlob_Close(t *testing.T) {
|
||||
testStore := newStore()
|
||||
utils.AssertEqual(t, nil, testStore.Close())
|
||||
}
|
80
azureblob/config.go
Normal file
80
azureblob/config.go
Normal file
@@ -0,0 +1,80 @@
|
||||
package azureblob
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Config defines the config for storage.
|
||||
type Config struct {
|
||||
// Storage account name.
|
||||
Account string
|
||||
// Container name.
|
||||
Container string
|
||||
// Storage endpoint.
|
||||
// Optional. Default: "https://STORAGEACCOUNTNAME.blob.core.windows.net"
|
||||
Endpoint string
|
||||
// Request timeout.
|
||||
// Optional. Default is 0 (no timeout)
|
||||
RequestTimeout time.Duration
|
||||
// Reset clears any existing keys in existing container.
|
||||
// Optional. Default is false
|
||||
Reset bool
|
||||
// Credentials overrides AWS access key and AWS secret access key. Not recommended.
|
||||
// Optional. Default is Credentials{}
|
||||
Credentials Credentials
|
||||
// The maximum number of times requests that encounter retryable failures should be attempted.
|
||||
// Optional. Default is 3
|
||||
MaxAttempts int
|
||||
}
|
||||
|
||||
// Credentials are the azure storage account access keys
|
||||
type Credentials struct {
|
||||
Account string
|
||||
Key string
|
||||
}
|
||||
|
||||
// ConfigDefault is the default config
|
||||
var ConfigDefault = Config{
|
||||
Account: "",
|
||||
Container: "",
|
||||
Endpoint: "",
|
||||
RequestTimeout: 0,
|
||||
Reset: false,
|
||||
MaxAttempts: 3,
|
||||
}
|
||||
|
||||
// Helper function to set default values
|
||||
func configure(config ...Config) Config {
|
||||
// Return default config if nothing provided
|
||||
if len(config) < 1 {
|
||||
return ConfigDefault
|
||||
}
|
||||
// Override default config
|
||||
cfg := config[0]
|
||||
valid, err := validateConfig(cfg)
|
||||
if err != nil || !valid {
|
||||
panic(fmt.Sprintf("invalid config:, %v", err))
|
||||
}
|
||||
if cfg.Endpoint == "" {
|
||||
cfg.Endpoint = "https://" + cfg.Account + ".blob.core.windows.net"
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
func validateConfig(config Config) (bool, error) {
|
||||
if config.Credentials.Account == "" || config.Credentials.Key == "" {
|
||||
err := errors.New("credentials must not be empty")
|
||||
return false, err
|
||||
}
|
||||
if config.Account == "" || config.Container == "" {
|
||||
err := errors.New("invalid account information provided")
|
||||
return false, err
|
||||
}
|
||||
if config.Account != config.Credentials.Account {
|
||||
err := errors.New("account configuration mismatch")
|
||||
return false, err
|
||||
}
|
||||
return true, nil
|
||||
}
|
17
azureblob/go.mod
Normal file
17
azureblob/go.mod
Normal file
@@ -0,0 +1,17 @@
|
||||
module github.com/gofiber/storage/azureblob
|
||||
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
|
||||
github.com/gofiber/fiber/v2 v2.43.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
golang.org/x/crypto v0.7.0 // indirect
|
||||
golang.org/x/net v0.8.0 // indirect
|
||||
golang.org/x/text v0.8.0 // indirect
|
||||
)
|
28
azureblob/go.sum
Normal file
28
azureblob/go.sum
Normal file
@@ -0,0 +1,28 @@
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUXTtj12tQ6zE2GZUgVQw=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1 h1:YvQv9Mz6T8oR5ypQOL6erY0Z5t71ak1uHV4QFokCOZk=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1/go.mod h1:c6WvOhtmjNUWbLfOG1qxM/q0SPvQNSVJvolm+C52dIU=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
|
||||
github.com/gofiber/fiber/v2 v2.43.0 h1:yit3E4kHf178B60p5CQBa/3v+WVuziWMa/G2ZNyLJB0=
|
||||
github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I=
|
||||
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
3
badger/.gitignore
vendored
Normal file
3
badger/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
fiber.badger/
|
||||
fiber.config.badger/
|
||||
fiber.with_options.badger/
|
@@ -1,45 +1,60 @@
|
||||
# Badger
|
||||
---
|
||||
id: badger
|
||||
title: Badger
|
||||
---
|
||||
|
||||

|
||||
[](https://gofiber.io/discord)
|
||||

|
||||

|
||||

|
||||
|
||||
A fast key-value DB using [dgraph-io/badger](https://github.com/dgraph-io/badger)
|
||||
|
||||
### Table of Contents
|
||||
|
||||
- [Signatures](#signatures)
|
||||
- [Installation](#installation)
|
||||
- [Examples](#examples)
|
||||
- [Config](#config)
|
||||
- [Default Config](#default-config)
|
||||
|
||||
|
||||
### Signatures
|
||||
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Reset() error
|
||||
func (s *Storage) Close() error
|
||||
func (s *Storage) Conn() *badger.DB
|
||||
```
|
||||
|
||||
### Installation
|
||||
|
||||
Badger is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||
|
||||
```bash
|
||||
go mod init github.com/<user>/<repo>
|
||||
```
|
||||
|
||||
And then install the badger implementation:
|
||||
|
||||
```bash
|
||||
go get github.com/gofiber/storage/badger
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
Import the storage package.
|
||||
|
||||
```go
|
||||
import "github.com/gofiber/storage/badger"
|
||||
```
|
||||
|
||||
You can use the following possibilities to create a storage:
|
||||
|
||||
```go
|
||||
// Initialize default config
|
||||
store := badger.New()
|
||||
@@ -53,6 +68,7 @@ store := badger.New(badger.Config{
|
||||
```
|
||||
|
||||
### Config
|
||||
|
||||
```go
|
||||
type Config struct {
|
||||
// Database name
|
||||
@@ -69,14 +85,33 @@ type Config struct {
|
||||
//
|
||||
// Optional. Default is 10 * time.Second
|
||||
GCInterval time.Duration
|
||||
|
||||
// BadgerOptions is a way to set options in badger
|
||||
//
|
||||
// Optional. Default is badger.DefaultOptions("./fiber.badger")
|
||||
BadgerOptions badger.Options
|
||||
|
||||
// Logger is the default logger used by badger
|
||||
//
|
||||
// Optional. Default is nil
|
||||
Logger badger.Logger
|
||||
|
||||
// UseLogger define if any logger will be used
|
||||
//
|
||||
// Optional. Default is false
|
||||
UseLogger bool
|
||||
}
|
||||
```
|
||||
|
||||
### Default Config
|
||||
|
||||
```go
|
||||
var ConfigDefault = Config{
|
||||
Database: "./fiber.badger",
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
Database: "./fiber.badger",
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
BadgerOptions: badger.DefaultOptions("./fiber.badger").WithLogger(nil),
|
||||
Logger: nil,
|
||||
UseLogger: false,
|
||||
}
|
||||
```
|
||||
|
@@ -1,10 +1,9 @@
|
||||
package badger
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/dgraph-io/badger"
|
||||
"github.com/dgraph-io/badger/v3"
|
||||
"github.com/gofiber/utils"
|
||||
)
|
||||
|
||||
@@ -15,16 +14,13 @@ type Storage struct {
|
||||
done chan struct{}
|
||||
}
|
||||
|
||||
// Common storage errors
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
// New creates a new memory storage
|
||||
func New(config ...Config) *Storage {
|
||||
// Set default config
|
||||
cfg := configDefault(config...)
|
||||
|
||||
// Set options
|
||||
opt := badger.DefaultOptions(cfg.Database).WithTruncate(true).WithLogger(nil)
|
||||
opt := cfg.BadgerOptions
|
||||
|
||||
// Open database
|
||||
db, err := badger.Open(opt)
|
||||
@@ -54,7 +50,7 @@ func New(config ...Config) *Storage {
|
||||
// Get value by key
|
||||
func (s *Storage) Get(key string) ([]byte, error) {
|
||||
if len(key) <= 0 {
|
||||
return nil, ErrNotExist
|
||||
return nil, nil
|
||||
}
|
||||
var data []byte
|
||||
err := s.db.View(func(txn *badger.Txn) error {
|
||||
@@ -71,7 +67,7 @@ func (s *Storage) Get(key string) ([]byte, error) {
|
||||
})
|
||||
// If no value was found return false
|
||||
if err == badger.ErrKeyNotFound {
|
||||
return data, ErrNotExist
|
||||
return nil, nil
|
||||
}
|
||||
return data, err
|
||||
}
|
||||
@@ -127,3 +123,8 @@ func (s *Storage) gc() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return database client
|
||||
func (s *Storage) Conn() *badger.DB {
|
||||
return s.db
|
||||
}
|
||||
|
@@ -65,14 +65,14 @@ func Test_Badger_Get_Expired(t *testing.T) {
|
||||
)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, ErrNotExist, err)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_Badger_Get_NotExist(t *testing.T) {
|
||||
|
||||
result, err := testStore.Get("notexist")
|
||||
utils.AssertEqual(t, ErrNotExist, err)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func Test_Badger_Delete(t *testing.T) {
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, ErrNotExist, err)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
@@ -108,14 +108,18 @@ func Test_Badger_Reset(t *testing.T) {
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get("john1")
|
||||
utils.AssertEqual(t, ErrNotExist, err)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
|
||||
result, err = testStore.Get("john2")
|
||||
utils.AssertEqual(t, ErrNotExist, err)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_Badger_Close(t *testing.T) {
|
||||
utils.AssertEqual(t, nil, testStore.Close())
|
||||
}
|
||||
|
||||
func Test_Badger_Conn(t *testing.T) {
|
||||
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||
}
|
@@ -1,6 +1,9 @@
|
||||
package badger
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"github.com/dgraph-io/badger/v3"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Config defines the config for storage.
|
||||
type Config struct {
|
||||
@@ -18,13 +21,33 @@ type Config struct {
|
||||
//
|
||||
// Optional. Default is 10 * time.Second
|
||||
GCInterval time.Duration
|
||||
|
||||
// BadgerOptions is a way to set options in badger
|
||||
//
|
||||
// Optional. Default is badger.DefaultOptions("./fiber.badger")
|
||||
BadgerOptions badger.Options
|
||||
|
||||
// Logger is the default logger used by badger
|
||||
//
|
||||
// Optional. Default is nil
|
||||
Logger badger.Logger
|
||||
|
||||
// UseLogger define if any logger will be used
|
||||
//
|
||||
// Optional. Default is false
|
||||
UseLogger bool
|
||||
}
|
||||
|
||||
const defaultDatabase = "./fiber.badger"
|
||||
|
||||
// ConfigDefault is the default config
|
||||
var ConfigDefault = Config{
|
||||
Database: "./fiber.badger",
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
Database: defaultDatabase,
|
||||
Reset: false,
|
||||
GCInterval: 10 * time.Second,
|
||||
BadgerOptions: badger.DefaultOptions(defaultDatabase).WithLogger(nil),
|
||||
Logger: nil,
|
||||
UseLogger: false,
|
||||
}
|
||||
|
||||
// Helper function to set default values
|
||||
@@ -44,5 +67,20 @@ func configDefault(config ...Config) Config {
|
||||
if int(cfg.GCInterval.Seconds()) <= 0 {
|
||||
cfg.GCInterval = ConfigDefault.GCInterval
|
||||
}
|
||||
overrideLogger := false
|
||||
// Detecting if no default Badger option was given
|
||||
// Also detects when a default badger option is given with a custom database name
|
||||
if cfg.BadgerOptions.ValueLogFileSize <= 0 || cfg.BadgerOptions.Dir == "" || cfg.BadgerOptions.ValueDir == "" ||
|
||||
(cfg.BadgerOptions.Dir == defaultDatabase && cfg.BadgerOptions.Dir != cfg.Database) {
|
||||
cfg.BadgerOptions = badger.DefaultOptions(cfg.Database)
|
||||
overrideLogger = true
|
||||
}
|
||||
if overrideLogger {
|
||||
if cfg.UseLogger && cfg.Logger != nil {
|
||||
cfg.BadgerOptions = cfg.BadgerOptions.WithLogger(cfg.Logger)
|
||||
} else if !cfg.UseLogger {
|
||||
cfg.BadgerOptions = cfg.BadgerOptions.WithLogger(nil)
|
||||
}
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
36
badger/config_test.go
Normal file
36
badger/config_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package badger
|
||||
|
||||
import (
|
||||
"github.com/dgraph-io/badger/v3"
|
||||
"github.com/gofiber/utils"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func assertRecoveryPanic(t *testing.T) {
|
||||
err := recover()
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_Badger_Only_Name(t *testing.T) {
|
||||
defer assertRecoveryPanic(t)
|
||||
testDB := New(Config{
|
||||
Database: "fiber.config.badger",
|
||||
UseLogger: false,
|
||||
})
|
||||
utils.AssertEqual(t, nil, testDB.Close())
|
||||
}
|
||||
|
||||
func Test_Badger_Options(t *testing.T) {
|
||||
defer assertRecoveryPanic(t)
|
||||
testDB := New(Config{
|
||||
BadgerOptions: badger.DefaultOptions("fiber.with_options.badger"),
|
||||
UseLogger: false,
|
||||
})
|
||||
utils.AssertEqual(t, nil, testDB.Close())
|
||||
}
|
||||
|
||||
func Test_Empty_Config(t *testing.T) {
|
||||
defer assertRecoveryPanic(t)
|
||||
testDB := New(Config{})
|
||||
utils.AssertEqual(t, nil, testDB.Close())
|
||||
}
|
@@ -1,9 +1,27 @@
|
||||
module github.com/gofiber/storage/badger
|
||||
|
||||
go 1.14
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/dgraph-io/badger v1.6.2
|
||||
github.com/gofiber/utils v0.1.2
|
||||
go.etcd.io/bbolt v1.3.5
|
||||
github.com/dgraph-io/badger/v3 v3.2103.5
|
||||
github.com/gofiber/utils v1.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/glog v1.0.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/flatbuffers v22.10.26+incompatible // indirect
|
||||
github.com/klauspost/compress v1.15.12 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
golang.org/x/net v0.7.0 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
)
|
||||
|
174
badger/go.sum
174
badger/go.sum
@@ -1,42 +1,99 @@
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M=
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8=
|
||||
github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE=
|
||||
github.com/dgraph-io/ristretto v0.0.2 h1:a5WaUrDa0qm0YrAAS1tUykT5El3kt62KNZZeMxQn3po=
|
||||
github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
|
||||
github.com/dgraph-io/badger/v3 v3.2103.5 h1:ylPa6qzbjYRQMU6jokoj4wzcaweHylt//CH0AKt0akg=
|
||||
github.com/dgraph-io/badger/v3 v3.2103.5/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw=
|
||||
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
|
||||
github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
||||
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
||||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
||||
github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM=
|
||||
github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
|
||||
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/flatbuffers v22.10.26+incompatible h1:z1QiaMyPu1x3Z6xf2u1dsLj1ZxicdGSeaLpCuIsQNZM=
|
||||
github.com/google/flatbuffers v22.10.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
||||
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
|
||||
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
@@ -45,22 +102,103 @@ github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb6
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
103
bbolt/README.md
Normal file
103
bbolt/README.md
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
id: bbolt
|
||||
title: Bbolt
|
||||
---
|
||||
|
||||

|
||||
[](https://gofiber.io/discord)
|
||||

|
||||

|
||||

|
||||
|
||||
A Bbolt storage driver using [etcd-io/bbolt](https://github.com/etcd-io/bbolt). Bolt is a pure Go key/value store inspired by [Howard Chu's](https://twitter.com/hyc_symas) [LMDB project](https://www.symas.com/symas-embedded-database-lmdb). The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.
|
||||
|
||||
|
||||
### Table of Contents
|
||||
- [Signatures](#signatures)
|
||||
- [Installation](#installation)
|
||||
- [Examples](#examples)
|
||||
- [Config](#config)
|
||||
- [Default Config](#default-config)
|
||||
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Reset() error
|
||||
func (s *Storage) Close() error
|
||||
func (s *Storage) Conn() *bbolt.DB
|
||||
```
|
||||
### Installation
|
||||
Bbolt is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||
```bash
|
||||
go mod init github.com/<user>/<repo>
|
||||
```
|
||||
And then install the s3 implementation:
|
||||
```bash
|
||||
go get github.com/gofiber/storage/bbolt
|
||||
```
|
||||
|
||||
### Examples
|
||||
Import the storage package.
|
||||
```go
|
||||
import "github.com/gofiber/storage/bbolt"
|
||||
```
|
||||
|
||||
You can use the following possibilities to create a storage:
|
||||
```go
|
||||
// Initialize default config
|
||||
store := bbolt.New()
|
||||
|
||||
// Initialize custom config
|
||||
store := bbolt.New(bbolt.Config{
|
||||
Database: "my_database.db",
|
||||
Bucket: "my-bucket",
|
||||
Reset: false,
|
||||
})
|
||||
```
|
||||
|
||||
### Config
|
||||
```go
|
||||
// Config defines the config for storage.
|
||||
type Config struct {
|
||||
// Database path
|
||||
//
|
||||
// Optional. Default is "fiber.db"
|
||||
Database string
|
||||
|
||||
// Bbolt bucket name
|
||||
//
|
||||
// Optional. Default is "fiber_storage"
|
||||
Bucket string
|
||||
|
||||
// Timeout is the amount of time to wait to obtain a file lock.
|
||||
// Only available on Darwin and Linux.
|
||||
//
|
||||
// Optional. Default is 60 * time.Second.
|
||||
Timeout time.Duration
|
||||
|
||||
// Open database in read-only mode.
|
||||
//
|
||||
// Optional. Default is false
|
||||
ReadOnly bool
|
||||
|
||||
// Reset clears any existing keys in existing Bucket
|
||||
//
|
||||
// Optional. Default is false
|
||||
Reset bool
|
||||
}
|
||||
```
|
||||
|
||||
### Default Config
|
||||
```go
|
||||
// ConfigDefault is the default config
|
||||
var ConfigDefault = Config{
|
||||
Database: "fiber.db",
|
||||
Bucket: "fiber_storage",
|
||||
Timeout: 60 * time.Second,
|
||||
ReadOnly: false,
|
||||
Reset: false,
|
||||
}
|
||||
```
|
111
bbolt/bbolt.go
Normal file
111
bbolt/bbolt.go
Normal file
@@ -0,0 +1,111 @@
|
||||
package bbolt
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/utils"
|
||||
"go.etcd.io/bbolt"
|
||||
)
|
||||
|
||||
// Storage interface that is implemented by storage providers
|
||||
type Storage struct {
|
||||
conn *bbolt.DB
|
||||
bucket string
|
||||
}
|
||||
|
||||
// New creates a new storage
|
||||
func New(config ...Config) *Storage {
|
||||
// Set default config
|
||||
cfg := configDefault(config...)
|
||||
|
||||
conn, err := bbolt.Open(cfg.Database, 0666, &bbolt.Options{
|
||||
Timeout: cfg.Timeout,
|
||||
ReadOnly: cfg.ReadOnly,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Reset bucket if field selected
|
||||
if cfg.Reset {
|
||||
if err := removeBucket(cfg, conn); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Create bucket if not exists
|
||||
if err := createBucket(cfg, conn); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return &Storage{
|
||||
conn: conn,
|
||||
bucket: cfg.Bucket,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Get value by key
|
||||
func (s *Storage) Get(key string) ([]byte, error) {
|
||||
if len(key) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var value []byte
|
||||
|
||||
err := s.conn.View(func(tx *bbolt.Tx) error {
|
||||
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
|
||||
value = b.Get(utils.UnsafeBytes(key))
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
return value, err
|
||||
}
|
||||
|
||||
// Set key with value
|
||||
func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
|
||||
if len(key) <= 0 || len(value) <= 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return s.conn.Update(func(tx *bbolt.Tx) error {
|
||||
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
|
||||
|
||||
return b.Put(utils.UnsafeBytes(key), value)
|
||||
})
|
||||
}
|
||||
|
||||
// Delete entry by key
|
||||
func (s *Storage) Delete(key string) error {
|
||||
if len(key) <= 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return s.conn.Update(func(tx *bbolt.Tx) error {
|
||||
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
|
||||
|
||||
return b.Delete(utils.UnsafeBytes(key))
|
||||
})
|
||||
}
|
||||
|
||||
// Reset all entries
|
||||
func (s *Storage) Reset() error {
|
||||
return s.conn.Update(func(tx *bbolt.Tx) error {
|
||||
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
|
||||
|
||||
return b.ForEach(func(k, _ []byte) error {
|
||||
return b.Delete(k)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Close the database
|
||||
func (s *Storage) Close() error {
|
||||
return s.conn.Close()
|
||||
}
|
||||
|
||||
// Return database client
|
||||
func (s *Storage) Conn() *bbolt.DB {
|
||||
return s.conn
|
||||
}
|
101
bbolt/bbolt_test.go
Normal file
101
bbolt/bbolt_test.go
Normal file
@@ -0,0 +1,101 @@
|
||||
package bbolt
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gofiber/utils"
|
||||
)
|
||||
|
||||
var testStore = New()
|
||||
|
||||
func Test_Bbolt_Set(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_Bbolt_Set_Override(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
}
|
||||
|
||||
func Test_Bbolt_Get(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, val, result)
|
||||
}
|
||||
|
||||
func Test_Bbolt_Get_NotExist(t *testing.T) {
|
||||
|
||||
result, err := testStore.Get("notexist")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_Bbolt_Delete(t *testing.T) {
|
||||
var (
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set(key, val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Delete(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_Bbolt_Reset(t *testing.T) {
|
||||
var (
|
||||
val = []byte("doe")
|
||||
)
|
||||
|
||||
err := testStore.Set("john1", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Set("john2", val, 0)
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
err = testStore.Reset()
|
||||
utils.AssertEqual(t, nil, err)
|
||||
|
||||
result, err := testStore.Get("john1")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
|
||||
result, err = testStore.Get("john2")
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, true, len(result) == 0)
|
||||
}
|
||||
|
||||
func Test_Bbolt_Close(t *testing.T) {
|
||||
utils.AssertEqual(t, nil, testStore.Close())
|
||||
}
|
||||
|
||||
func Test_Bbolt_Conn(t *testing.T) {
|
||||
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||
}
|
63
bbolt/config.go
Normal file
63
bbolt/config.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package bbolt
|
||||
|
||||
import "time"
|
||||
|
||||
// Config defines the config for storage.
|
||||
type Config struct {
|
||||
// Database path
|
||||
//
|
||||
// Optional. Default is "fiber.db"
|
||||
Database string
|
||||
|
||||
// Bbolt bucket name
|
||||
//
|
||||
// Optional. Default is "fiber_storage"
|
||||
Bucket string
|
||||
|
||||
// Timeout is the amount of time to wait to obtain a file lock.
|
||||
// Only available on Darwin and Linux.
|
||||
//
|
||||
// Optional. Default is set to 60 * time.Second.
|
||||
Timeout time.Duration
|
||||
|
||||
// Open database in read-only mode.
|
||||
//
|
||||
// Optional. Default is false
|
||||
ReadOnly bool
|
||||
|
||||
// Reset clears any existing keys in existing Bucket
|
||||
//
|
||||
// Optional. Default is false
|
||||
Reset bool
|
||||
}
|
||||
|
||||
// ConfigDefault is the default config
|
||||
var ConfigDefault = Config{
|
||||
Database: "fiber.db",
|
||||
Bucket: "fiber_storage",
|
||||
Timeout: 60 * time.Second,
|
||||
ReadOnly: false,
|
||||
Reset: false,
|
||||
}
|
||||
|
||||
// Helper function to set default values
|
||||
func configDefault(config ...Config) Config {
|
||||
// Return default config if nothing provided
|
||||
if len(config) < 1 {
|
||||
return ConfigDefault
|
||||
}
|
||||
|
||||
// Override default config
|
||||
cfg := config[0]
|
||||
|
||||
// Set default values
|
||||
if cfg.Database == "" {
|
||||
cfg.Database = ConfigDefault.Database
|
||||
}
|
||||
|
||||
if cfg.Bucket == "" {
|
||||
cfg.Bucket = ConfigDefault.Bucket
|
||||
}
|
||||
|
||||
return cfg
|
||||
}
|
10
bbolt/go.mod
Normal file
10
bbolt/go.mod
Normal file
@@ -0,0 +1,10 @@
|
||||
module github.com/gofiber/storage/bbolt
|
||||
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/gofiber/utils v1.0.1
|
||||
go.etcd.io/bbolt v1.3.7
|
||||
)
|
||||
|
||||
require golang.org/x/sys v0.4.0 // indirect
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user