Commit Graph

42 Commits

Author SHA1 Message Date
Carl Bergquist
3f136e0da9
tech: replace bmizerany/assert with stretchr/testify (#16625)
bmizerany is old and unsupported. so we are replacing it
with stretchr which is an drop in replacement and something
we want to use more in Grafana.
2019-04-17 10:25:58 +02:00
Carl Bergquist
490515aec6
build: partially replace gometalinter with golangci-lint (#16610)
we still use gometalinter for goconst since it doesn't 
report errors for duplicated in test files
2019-04-16 10:27:07 +02:00
Oleg Gaidarenko
67cbc7d4cf
Chore: use remote cache instead of session storage (#16114)
Replaces session storage in auth_proxy middleware with remote cache

Fixes #15161
2019-04-08 14:31:46 +03:00
Oleg Gaidarenko
04b3afcd15
Chore: Implement revive (#16200)
Since we do not like some of the default golint rules,
this commit proposes to use https://github.com/mgechev/revive.

And potential revive speed-up should't hurt :).

Right now, presented config (./conf/revive.toml) is permissive,
we might improve it over time however. Fixes for found revive
issues in the code are very limited so it wouldn't be large to review.

Also in this commit:

* Add annotations for makefile commands and declare phony targets

* Rename "gometalinter" script and CI command to "lint"
  since we are doing there a bit more then using gometalinter package

* Add Makefile rules to .editorconfig

* Documentation which mentioned "golint" replaced with revive

Fixes #16109
Ref #16160
2019-03-27 17:53:49 +01:00
Oleg Gaidarenko
c5bc723a6e Correct table names of sql storage for remotecache 2019-03-20 13:24:56 +01:00
bergquist
6d42d43b22 use constants for cache type 2019-03-14 15:48:20 +01:00
bergquist
0a86a1d7b6 updates old distcache names 2019-03-14 09:23:35 +01:00
bergquist
c001cfe1d9 dont allow inifinite expiration 2019-03-14 09:22:03 +01:00
bergquist
5186273731 return error if cache type is invalid 2019-03-14 08:57:38 +01:00
bergquist
7aeab0a235 use Get instead of Find 2019-03-11 11:04:56 +01:00
bergquist
b2967fbb37 avoid exposing cache client directly 2019-03-11 10:49:56 +01:00
bergquist
7e7427637c renames distcache -> remotecache 2019-03-11 10:49:55 +01:00
bergquist
66e71b66dd renames key to cache_key
apparently key is a reserved keyword in mysql.
and the error messages doesnt mention that.
can I please have 6h back?
2019-03-11 10:49:55 +01:00
bergquist
daa3b17951 code layouts and comments 2019-03-11 10:49:42 +01:00
bergquist
9a78c23165 rename put -> set 2019-03-11 10:49:10 +01:00
bergquist
98f5432659 memcache -> memcached
https://github.com/memcached/memcached
2019-03-11 10:49:09 +01:00
bergquist
995647be2c removes memory as distcache option
if database caching is to expensive if should
not use distcache in the first place.
2019-03-11 10:49:09 +01:00
bergquist
b933b4efc8 test redis and memcached during integration tests 2019-03-11 10:49:09 +01:00
bergquist
196cdf9710 adds config to default settings 2019-03-11 10:49:09 +01:00
bergquist
f9f2d9fcf3 avoid exporting test helpers 2019-03-11 10:49:09 +01:00
bergquist
33935b09f0 uses set instead of add for memcache
set always sets the value regardless.
2019-03-11 10:49:09 +01:00
bergquist
8db2864fee adds memory as dist storage alt 2019-03-11 10:49:09 +01:00
bergquist
a60bb83a70 extract tests into seperate files 2019-03-11 10:49:09 +01:00
bergquist
c8ff698d90 avoid exposing internal structs and functions 2019-03-11 10:49:04 +01:00
bergquist
11d671c637 add support for memcached 2019-03-08 09:09:28 +01:00
bergquist
5ced863f75 add support for redis storage 2019-03-08 09:09:27 +01:00
bergquist
d99af23946 add garbage collector for database cache 2019-03-08 09:09:27 +01:00
bergquist
996d5059b1 test at interface level instead impl 2019-03-08 09:09:27 +01:00
bergquist
d4f5789660 cache: initial version of db cache 2019-03-08 09:09:27 +01:00
Carl Bergquist
369aa2d5dd
Merge pull request #15628 from bergquist/move_tracing_infra
moves tracing packge into /infra
2019-02-25 16:16:45 +01:00
bergquist
60fef31748 moves social package to /login
ref #14679
2019-02-25 15:30:40 +01:00
bergquist
0c67194b45 moves tracing packge into /infra 2019-02-25 15:29:25 +01:00
bergquist
8a3a3cccc3 moves metric package to /infra
ref #14679
2019-02-24 21:12:51 +01:00
bergquist
3ce99bca66 renames usage state name for auth token
as noted, sessions might not be a good name for this metrics.
while devices would be a better name for users I think we should
align the name with the code as much as possible. The ui listing
all auth_tokens per user should probarbly say "devices" instead
2019-02-11 11:08:31 +01:00
bergquist
2be60887ca adds usage stats for sessions 2019-02-07 16:27:40 +01:00
bergquist
6e7941d396 moves usage stats sender to new package 2019-02-07 14:59:50 +01:00
bergquist
7aa84aeb61 moves migrations to /sqlstore/migrations 2018-12-17 16:36:57 +01:00
bergquist
dbcc2e868d adds integration tests to ci build 2018-12-17 16:36:57 +01:00
bergquist
11cde7ed71 renames main lock function 2018-12-17 16:36:57 +01:00
bergquist
c565b018c5 clean up integration tests 2018-12-17 16:36:57 +01:00
bergquist
823bba8d98 change from db_text to nvarchar 2018-12-17 16:36:57 +01:00
bergquist
dc49bebb00 adds server lock package 2018-12-17 16:36:57 +01:00