-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
47 lines (39 loc) · 792 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
39
40
41
42
43
44
45
46
47
package nprxy
import (
"time"
)
// Config for nprxy
type Config struct {
LogJSON bool
Services []ServiceConfig
}
// ServiceConfig general service configuration
type ServiceConfig struct {
Name string
Listen ListenerConfig
Upstream string
Grace time.Duration
DisableLog bool
// RPC properties
Timeout time.Duration
HTTP HTTPConfig
}
// ListenerConfig configuration of inbound channel
type ListenerConfig struct {
Address string
Kind string
TLSCert string `json:"tls_cert"`
TLSKey string `json:"tls_key"`
}
// HTTPConfig configuration for HTTP protocol
type HTTPConfig struct {
Kind string
Authn *Parameters
Authz *Parameters
LogBody bool
}
// Parameters of config
type Parameters struct {
Kind string
Params map[string]interface{}
}