mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(build): fixed dependency and build issue
This commit is contained in:
parent
4fe72ebf69
commit
bdb67d4909
9
Godeps/Godeps.json
generated
9
Godeps/Godeps.json
generated
@ -122,6 +122,10 @@
|
||||
"Comment": "0.2.2",
|
||||
"Rev": "3433f3ea46d9f8019119e7dd41274e112a2359a9"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/jtolds/gls",
|
||||
"Rev": "f1ac7f4f24f50328e6bc838ca4437d1612a0243c"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/klauspost/compress/flate",
|
||||
"Rev": "7b02889a2005228347aef0e76beeaee564d82f8c"
|
||||
@ -151,6 +155,11 @@
|
||||
"ImportPath": "github.com/rainycape/unidecode",
|
||||
"Rev": "836ef0a715aedf08a12d595ed73ec8ed5b288cac"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/smartystreets/goconvey/convey",
|
||||
"Comment": "1.5.0-356-gfbc0a1c",
|
||||
"Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/streadway/amqp",
|
||||
"Rev": "150b7f24d6ad507e6026c13d85ce1f1391ac7400"
|
||||
|
18
Godeps/_workspace/src/github.com/jtolds/gls/LICENSE
generated
vendored
Normal file
18
Godeps/_workspace/src/github.com/jtolds/gls/LICENSE
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
Copyright (c) 2013, Space Monkey, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
64
Godeps/_workspace/src/github.com/jtolds/gls/README.md
generated
vendored
Normal file
64
Godeps/_workspace/src/github.com/jtolds/gls/README.md
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
gls
|
||||
===
|
||||
|
||||
Goroutine local storage
|
||||
|
||||
### Huhwaht? Why? ###
|
||||
|
||||
Every so often, a thread shows up on the
|
||||
[golang-nuts](https://groups.google.com/d/forum/golang-nuts) asking for some
|
||||
form of goroutine-local-storage, or some kind of goroutine id, or some kind of
|
||||
context. There are a few valid use cases for goroutine-local-storage, one of
|
||||
the most prominent being log line context. One poster was interested in being
|
||||
able to log an HTTP request context id in every log line in the same goroutine
|
||||
as the incoming HTTP request, without having to change every library and
|
||||
function call he was interested in logging.
|
||||
|
||||
This would be pretty useful. Provided that you could get some kind of
|
||||
goroutine-local-storage, you could call
|
||||
[log.SetOutput](http://golang.org/pkg/log/#SetOutput) with your own logging
|
||||
writer that checks goroutine-local-storage for some context information and
|
||||
adds that context to your log lines.
|
||||
|
||||
But alas, Andrew Gerrand's typically diplomatic answer to the question of
|
||||
goroutine-local variables was:
|
||||
|
||||
> We wouldn't even be having this discussion if thread local storage wasn't
|
||||
> useful. But every feature comes at a cost, and in my opinion the cost of
|
||||
> threadlocals far outweighs their benefits. They're just not a good fit for
|
||||
> Go.
|
||||
|
||||
So, yeah, that makes sense. That's a pretty good reason for why the language
|
||||
won't support a specific and (relatively) unuseful feature that requires some
|
||||
runtime changes, just for the sake of a little bit of log improvement.
|
||||
|
||||
But does Go require runtime changes?
|
||||
|
||||
### How it works ###
|
||||
|
||||
Go has pretty fantastic introspective and reflective features, but one thing Go
|
||||
doesn't give you is any kind of access to the stack pointer, or frame pointer,
|
||||
or goroutine id, or anything contextual about your current stack. It gives you
|
||||
access to your list of callers, but only along with program counters, which are
|
||||
fixed at compile time.
|
||||
|
||||
But it does give you the stack.
|
||||
|
||||
So, we define 16 special functions and embed base-16 tags into the stack using
|
||||
the call order of those 16 functions. Then, we can read our tags back out of
|
||||
the stack looking at the callers list.
|
||||
|
||||
We then use these tags as an index into a traditional map for implementing
|
||||
this library.
|
||||
|
||||
### What are people saying? ###
|
||||
|
||||
"Wow, that's horrifying."
|
||||
|
||||
"This is the most terrible thing I have seen in a very long time."
|
||||
|
||||
"Where is it getting a context from? Is this serializing all the requests? What the heck is the client being bound to? What are these tags? Why does he need callers? Oh god no. No no no."
|
||||
|
||||
### Docs ###
|
||||
|
||||
Please see the docs at http://godoc.org/github.com/jtolds/gls
|
150
Godeps/_workspace/src/github.com/jtolds/gls/context.go
generated
vendored
Normal file
150
Godeps/_workspace/src/github.com/jtolds/gls/context.go
generated
vendored
Normal file
@ -0,0 +1,150 @@
|
||||
// Package gls implements goroutine-local storage.
|
||||
package gls
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
maxCallers = 64
|
||||
)
|
||||
|
||||
var (
|
||||
stackTagPool = &idPool{}
|
||||
mgrRegistry = make(map[*ContextManager]bool)
|
||||
mgrRegistryMtx sync.RWMutex
|
||||
)
|
||||
|
||||
// Values is simply a map of key types to value types. Used by SetValues to
|
||||
// set multiple values at once.
|
||||
type Values map[interface{}]interface{}
|
||||
|
||||
func currentStack(skip int) []uintptr {
|
||||
stack := make([]uintptr, maxCallers)
|
||||
return stack[:runtime.Callers(2+skip, stack)]
|
||||
}
|
||||
|
||||
// ContextManager is the main entrypoint for interacting with
|
||||
// Goroutine-local-storage. You can have multiple independent ContextManagers
|
||||
// at any given time. ContextManagers are usually declared globally for a given
|
||||
// class of context variables. You should use NewContextManager for
|
||||
// construction.
|
||||
type ContextManager struct {
|
||||
mtx sync.RWMutex
|
||||
values map[uint]Values
|
||||
}
|
||||
|
||||
// NewContextManager returns a brand new ContextManager. It also registers the
|
||||
// new ContextManager in the ContextManager registry which is used by the Go
|
||||
// method. ContextManagers are typically defined globally at package scope.
|
||||
func NewContextManager() *ContextManager {
|
||||
mgr := &ContextManager{values: make(map[uint]Values)}
|
||||
mgrRegistryMtx.Lock()
|
||||
defer mgrRegistryMtx.Unlock()
|
||||
mgrRegistry[mgr] = true
|
||||
return mgr
|
||||
}
|
||||
|
||||
// Unregister removes a ContextManager from the global registry, used by the
|
||||
// Go method. Only intended for use when you're completely done with a
|
||||
// ContextManager. Use of Unregister at all is rare.
|
||||
func (m *ContextManager) Unregister() {
|
||||
mgrRegistryMtx.Lock()
|
||||
defer mgrRegistryMtx.Unlock()
|
||||
delete(mgrRegistry, m)
|
||||
}
|
||||
|
||||
// SetValues takes a collection of values and a function to call for those
|
||||
// values to be set in. Anything further down the stack will have the set
|
||||
// values available through GetValue. SetValues will add new values or replace
|
||||
// existing values of the same key and will not mutate or change values for
|
||||
// previous stack frames.
|
||||
// SetValues is slow (makes a copy of all current and new values for the new
|
||||
// gls-context) in order to reduce the amount of lookups GetValue requires.
|
||||
func (m *ContextManager) SetValues(new_values Values, context_call func()) {
|
||||
if len(new_values) == 0 {
|
||||
context_call()
|
||||
return
|
||||
}
|
||||
|
||||
tags := readStackTags(currentStack(1))
|
||||
|
||||
m.mtx.Lock()
|
||||
values := new_values
|
||||
for _, tag := range tags {
|
||||
if existing_values, ok := m.values[tag]; ok {
|
||||
// oh, we found existing values, let's make a copy
|
||||
values = make(Values, len(existing_values)+len(new_values))
|
||||
for key, val := range existing_values {
|
||||
values[key] = val
|
||||
}
|
||||
for key, val := range new_values {
|
||||
values[key] = val
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
new_tag := stackTagPool.Acquire()
|
||||
m.values[new_tag] = values
|
||||
m.mtx.Unlock()
|
||||
defer func() {
|
||||
m.mtx.Lock()
|
||||
delete(m.values, new_tag)
|
||||
m.mtx.Unlock()
|
||||
stackTagPool.Release(new_tag)
|
||||
}()
|
||||
|
||||
addStackTag(new_tag, context_call)
|
||||
}
|
||||
|
||||
// GetValue will return a previously set value, provided that the value was set
|
||||
// by SetValues somewhere higher up the stack. If the value is not found, ok
|
||||
// will be false.
|
||||
func (m *ContextManager) GetValue(key interface{}) (value interface{}, ok bool) {
|
||||
|
||||
tags := readStackTags(currentStack(1))
|
||||
m.mtx.RLock()
|
||||
defer m.mtx.RUnlock()
|
||||
for _, tag := range tags {
|
||||
if values, ok := m.values[tag]; ok {
|
||||
value, ok := values[key]
|
||||
return value, ok
|
||||
}
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
func (m *ContextManager) getValues() Values {
|
||||
tags := readStackTags(currentStack(2))
|
||||
m.mtx.RLock()
|
||||
defer m.mtx.RUnlock()
|
||||
for _, tag := range tags {
|
||||
if values, ok := m.values[tag]; ok {
|
||||
return values
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Go preserves ContextManager values and Goroutine-local-storage across new
|
||||
// goroutine invocations. The Go method makes a copy of all existing values on
|
||||
// all registered context managers and makes sure they are still set after
|
||||
// kicking off the provided function in a new goroutine. If you don't use this
|
||||
// Go method instead of the standard 'go' keyword, you will lose values in
|
||||
// ContextManagers, as goroutines have brand new stacks.
|
||||
func Go(cb func()) {
|
||||
mgrRegistryMtx.RLock()
|
||||
defer mgrRegistryMtx.RUnlock()
|
||||
|
||||
for mgr, _ := range mgrRegistry {
|
||||
values := mgr.getValues()
|
||||
if len(values) > 0 {
|
||||
mgr_copy := mgr
|
||||
cb_copy := cb
|
||||
cb = func() { mgr_copy.SetValues(values, cb_copy) }
|
||||
}
|
||||
}
|
||||
|
||||
go cb()
|
||||
}
|
139
Godeps/_workspace/src/github.com/jtolds/gls/context_test.go
generated
vendored
Normal file
139
Godeps/_workspace/src/github.com/jtolds/gls/context_test.go
generated
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
package gls
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestContexts(t *testing.T) {
|
||||
mgr1 := NewContextManager()
|
||||
mgr2 := NewContextManager()
|
||||
|
||||
CheckVal := func(mgr *ContextManager, key, exp_val string) {
|
||||
val, ok := mgr.GetValue(key)
|
||||
if len(exp_val) == 0 {
|
||||
if ok {
|
||||
t.Fatalf("expected no value for key %s, got %s", key, val)
|
||||
}
|
||||
return
|
||||
}
|
||||
if !ok {
|
||||
t.Fatalf("expected value %s for key %s, got no value",
|
||||
exp_val, key)
|
||||
}
|
||||
if exp_val != val {
|
||||
t.Fatalf("expected value %s for key %s, got %s", exp_val, key,
|
||||
val)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Check := func(exp_m1v1, exp_m1v2, exp_m2v1, exp_m2v2 string) {
|
||||
CheckVal(mgr1, "key1", exp_m1v1)
|
||||
CheckVal(mgr1, "key2", exp_m1v2)
|
||||
CheckVal(mgr2, "key1", exp_m2v1)
|
||||
CheckVal(mgr2, "key2", exp_m2v2)
|
||||
}
|
||||
|
||||
Check("", "", "", "")
|
||||
mgr2.SetValues(Values{"key1": "val1c"}, func() {
|
||||
Check("", "", "val1c", "")
|
||||
mgr1.SetValues(Values{"key1": "val1a"}, func() {
|
||||
Check("val1a", "", "val1c", "")
|
||||
mgr1.SetValues(Values{"key2": "val1b"}, func() {
|
||||
Check("val1a", "val1b", "val1c", "")
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
Check("", "", "", "")
|
||||
}()
|
||||
Go(func() {
|
||||
defer wg.Done()
|
||||
Check("val1a", "val1b", "val1c", "")
|
||||
})
|
||||
wg.Wait()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func ExampleContextManager_SetValues() {
|
||||
var (
|
||||
mgr = NewContextManager()
|
||||
request_id_key = GenSym()
|
||||
)
|
||||
|
||||
MyLog := func() {
|
||||
if request_id, ok := mgr.GetValue(request_id_key); ok {
|
||||
fmt.Println("My request id is:", request_id)
|
||||
} else {
|
||||
fmt.Println("No request id found")
|
||||
}
|
||||
}
|
||||
|
||||
mgr.SetValues(Values{request_id_key: "12345"}, func() {
|
||||
MyLog()
|
||||
})
|
||||
MyLog()
|
||||
|
||||
// Output: My request id is: 12345
|
||||
// No request id found
|
||||
}
|
||||
|
||||
func ExampleGo() {
|
||||
var (
|
||||
mgr = NewContextManager()
|
||||
request_id_key = GenSym()
|
||||
)
|
||||
|
||||
MyLog := func() {
|
||||
if request_id, ok := mgr.GetValue(request_id_key); ok {
|
||||
fmt.Println("My request id is:", request_id)
|
||||
} else {
|
||||
fmt.Println("No request id found")
|
||||
}
|
||||
}
|
||||
|
||||
mgr.SetValues(Values{request_id_key: "12345"}, func() {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
MyLog()
|
||||
}()
|
||||
wg.Wait()
|
||||
wg.Add(1)
|
||||
Go(func() {
|
||||
defer wg.Done()
|
||||
MyLog()
|
||||
})
|
||||
wg.Wait()
|
||||
})
|
||||
|
||||
// Output: No request id found
|
||||
// My request id is: 12345
|
||||
}
|
||||
|
||||
func BenchmarkGetValue(b *testing.B) {
|
||||
mgr := NewContextManager()
|
||||
mgr.SetValues(Values{"test_key": "test_val"}, func() {
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
val, ok := mgr.GetValue("test_key")
|
||||
if !ok || val != "test_val" {
|
||||
b.FailNow()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func BenchmarkSetValues(b *testing.B) {
|
||||
mgr := NewContextManager()
|
||||
for i := 0; i < b.N/2; i++ {
|
||||
mgr.SetValues(Values{"test_key": "test_val"}, func() {
|
||||
mgr.SetValues(Values{"test_key2": "test_val2"}, func() {})
|
||||
})
|
||||
}
|
||||
}
|
13
Godeps/_workspace/src/github.com/jtolds/gls/gen_sym.go
generated
vendored
Normal file
13
Godeps/_workspace/src/github.com/jtolds/gls/gen_sym.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
package gls
|
||||
|
||||
var (
|
||||
symPool = &idPool{}
|
||||
)
|
||||
|
||||
// ContextKey is a throwaway value you can use as a key to a ContextManager
|
||||
type ContextKey struct{ id uint }
|
||||
|
||||
// GenSym will return a brand new, never-before-used ContextKey
|
||||
func GenSym() ContextKey {
|
||||
return ContextKey{id: symPool.Acquire()}
|
||||
}
|
34
Godeps/_workspace/src/github.com/jtolds/gls/id_pool.go
generated
vendored
Normal file
34
Godeps/_workspace/src/github.com/jtolds/gls/id_pool.go
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
package gls
|
||||
|
||||
// though this could probably be better at keeping ids smaller, the goal of
|
||||
// this class is to keep a registry of the smallest unique integer ids
|
||||
// per-process possible
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
type idPool struct {
|
||||
mtx sync.Mutex
|
||||
released []uint
|
||||
max_id uint
|
||||
}
|
||||
|
||||
func (p *idPool) Acquire() (id uint) {
|
||||
p.mtx.Lock()
|
||||
defer p.mtx.Unlock()
|
||||
if len(p.released) > 0 {
|
||||
id = p.released[len(p.released)-1]
|
||||
p.released = p.released[:len(p.released)-1]
|
||||
return id
|
||||
}
|
||||
id = p.max_id
|
||||
p.max_id++
|
||||
return id
|
||||
}
|
||||
|
||||
func (p *idPool) Release(id uint) {
|
||||
p.mtx.Lock()
|
||||
defer p.mtx.Unlock()
|
||||
p.released = append(p.released, id)
|
||||
}
|
93
Godeps/_workspace/src/github.com/jtolds/gls/stack_tags.go
generated
vendored
Normal file
93
Godeps/_workspace/src/github.com/jtolds/gls/stack_tags.go
generated
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
package gls
|
||||
|
||||
// so, basically, we're going to encode integer tags in base-16 on the stack
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
const (
|
||||
bitWidth = 4
|
||||
)
|
||||
|
||||
func addStackTag(tag uint, context_call func()) {
|
||||
if context_call == nil {
|
||||
return
|
||||
}
|
||||
markS(tag, context_call)
|
||||
}
|
||||
|
||||
func markS(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark0(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark1(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark2(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark3(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark4(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark5(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark6(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark7(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark8(tag uint, cb func()) { _m(tag, cb) }
|
||||
func mark9(tag uint, cb func()) { _m(tag, cb) }
|
||||
func markA(tag uint, cb func()) { _m(tag, cb) }
|
||||
func markB(tag uint, cb func()) { _m(tag, cb) }
|
||||
func markC(tag uint, cb func()) { _m(tag, cb) }
|
||||
func markD(tag uint, cb func()) { _m(tag, cb) }
|
||||
func markE(tag uint, cb func()) { _m(tag, cb) }
|
||||
func markF(tag uint, cb func()) { _m(tag, cb) }
|
||||
|
||||
var pc_lookup = make(map[uintptr]int8, 17)
|
||||
var mark_lookup [16]func(uint, func())
|
||||
|
||||
func init() {
|
||||
setEntries := func(f func(uint, func()), v int8) {
|
||||
pc_lookup[reflect.ValueOf(f).Pointer()] = v
|
||||
if v >= 0 {
|
||||
mark_lookup[v] = f
|
||||
}
|
||||
}
|
||||
setEntries(markS, -0x1)
|
||||
setEntries(mark0, 0x0)
|
||||
setEntries(mark1, 0x1)
|
||||
setEntries(mark2, 0x2)
|
||||
setEntries(mark3, 0x3)
|
||||
setEntries(mark4, 0x4)
|
||||
setEntries(mark5, 0x5)
|
||||
setEntries(mark6, 0x6)
|
||||
setEntries(mark7, 0x7)
|
||||
setEntries(mark8, 0x8)
|
||||
setEntries(mark9, 0x9)
|
||||
setEntries(markA, 0xa)
|
||||
setEntries(markB, 0xb)
|
||||
setEntries(markC, 0xc)
|
||||
setEntries(markD, 0xd)
|
||||
setEntries(markE, 0xe)
|
||||
setEntries(markF, 0xf)
|
||||
}
|
||||
|
||||
func _m(tag_remainder uint, cb func()) {
|
||||
if tag_remainder == 0 {
|
||||
cb()
|
||||
} else {
|
||||
mark_lookup[tag_remainder&0xf](tag_remainder>>bitWidth, cb)
|
||||
}
|
||||
}
|
||||
|
||||
func readStackTags(stack []uintptr) (tags []uint) {
|
||||
var current_tag uint
|
||||
for _, pc := range stack {
|
||||
pc = runtime.FuncForPC(pc).Entry()
|
||||
val, ok := pc_lookup[pc]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if val < 0 {
|
||||
tags = append(tags, current_tag)
|
||||
current_tag = 0
|
||||
continue
|
||||
}
|
||||
current_tag <<= bitWidth
|
||||
current_tag += uint(val)
|
||||
}
|
||||
return
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/go-macaron/binding"
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/go-macaron/binding"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
// Register adds http routes
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
"github.com/grafana/grafana/pkg/metrics"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -20,9 +20,9 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
func Logger() macaron.Handler {
|
||||
|
@ -7,13 +7,13 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/go-macaron/session"
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
"github.com/macaron-contrib/session"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
func TestMiddlewareContext(t *testing.T) {
|
||||
|
@ -3,11 +3,11 @@ package middleware
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
func Quota(target string) macaron.Handler {
|
||||
|
@ -3,12 +3,12 @@ package middleware
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/go-macaron/session"
|
||||
_ "github.com/go-macaron/session/memcache"
|
||||
_ "github.com/go-macaron/session/mysql"
|
||||
_ "github.com/go-macaron/session/postgres"
|
||||
_ "github.com/go-macaron/session/redis"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package middleware
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/go-macaron/gzip"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
func Gziper() macaron.Handler {
|
||||
|
Loading…
Reference in New Issue
Block a user