-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.go
48 lines (39 loc) · 846 Bytes
/
types.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
package tinyconf
import (
"fmt"
"github.com/insei/fmap/v3"
)
var (
ErrNotRegisteredConfig = fmt.Errorf("config is not registered")
ErrValueNotFound = fmt.Errorf("value was not found")
ErrIncorrectTagSettings = fmt.Errorf("incorrect tag settings")
)
type Value struct {
Source string
Value interface{}
}
type Driver interface {
GenDoc(...*Registered) string
GetName() string
GetValue(field fmap.Field) (*Value, error)
}
type Option interface {
apply(*Manager)
}
type Field struct {
Key string
Value interface{}
}
func LogField(key string, value interface{}) Field {
return Field{
Key: key,
Value: value,
}
}
type Logger interface {
Debug(msg string, fields ...Field)
Warn(msg string, fields ...Field)
Error(msg string, fields ...Field)
Info(msg string, fields ...Field)
With(fields ...Field) Logger
}