/
resolve_options.go
52 lines (40 loc) · 1.14 KB
/
resolve_options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package dbresolver
import (
"context"
"github.com/rs/zerolog"
)
type resolveOptions struct {
context context.Context
//connPool []gorm.ConnPool
connPool []detailedConnPool
dbResolver *DBResolver
resolver *resolver
cachedNrOfConnections int
}
// GetNrOfConns -> get nr of connections (defined ones) from the pool
func (r *resolveOptions) GetNrOfConns() int {
return r.cachedNrOfConnections
}
// GetConnPools -> get all connections
func (r *resolveOptions) GetConnPools() []detailedConnPool {
return r.connPool
}
func (r *resolveOptions) GetContext() context.Context {
return r.context
}
func (r *resolveOptions) GetDbResolver() *DBResolver {
return r.dbResolver
}
// Logging
func (r *resolveOptions) LInfoF(functionName string) *zerolog.Event {
return r.dbResolver.LInfoF(functionName)
}
func (r *resolveOptions) LDebugF(functionName string) *zerolog.Event {
return r.dbResolver.LDebugF(functionName)
}
func (r *resolveOptions) LWarnF(functionName string) *zerolog.Event {
return r.dbResolver.LWarnF(functionName)
}
func (r *resolveOptions) LErrorF(functionName string) *zerolog.Event {
return r.dbResolver.LErrorF(functionName)
}