-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
38 lines (31 loc) · 801 Bytes
/
config.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
package pg
import (
"github.com/pandudpn/go-payment-gateway/utils"
"github.com/sirupsen/logrus"
)
type env string
const (
Production env = "production"
Staging env = "staging"
)
type Config struct {
// Set the environment gateway
//
// Default: Staging
Environment env `json:"environment"`
// When set to true, this will log your request, response or error to stdout
// Use logrus as logging
//
// Default: true
Logging bool `json:"logging"`
// Format log when Logging is set to true
//
// Default: logrus.TextFormatter | [ts] - [level] - [message]
LogFunc *logrus.Logger `json:"log_func"`
}
// DefaultConfig define all default value of configuration payment gateway
var DefaultConfig = &Config{
Environment: Staging,
Logging: true,
LogFunc: utils.NewLogger(),
}