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
53
54
55
56
57
/**
* @Author: xueyanghan
* @File: types.go
* @Version: 1.0.0
* @Description: desc.
* @Date: 2023/8/16 18:27
*/
package config
import "chainweaver.org.cn/chainweaver/mira/mira-common/config"
// Conf -
var Conf *Config
// Config - config
type Config struct {
Common CommonConfig `yaml:"common"`
Log config.LogConfig `yaml:"log"`
Crypto config.CryptoConfig `yaml:"crypto"`
DB config.DBConfig `yaml:"database"`
Mias MIASClientConfig `yaml:"mias_grpc"`
MinioConfig config.MinioConfig `yaml:"minio"`
KeyServiceConfig KeyServiceConfig `yaml:"key_service"`
NetworkManagerUrl string `yaml:"mira-network-manager-url"`
JobServiceUrl string `yaml:"mira-job-service-url"`
CrtBytes []byte
KeyBytes []byte
}
// CommonConfig - common config
type CommonConfig struct {
Port int `yaml:"port"`
UrlPrefix string `yaml:"url_prefix"`
TLS TLSConfig `yaml:"tls"`
}
// TLSConfig - tls config for grpc server
type TLSConfig struct {
Enable bool `yaml:"enable"`
CrtPath string `yaml:"crt_path"`
KeyPath string `yaml:"key_path"`
CaPath string `yaml:"ca_path"`
}
type MIASClientConfig struct {
Addr string `yaml:"addr"`
Enable bool `yaml:"enable"`
CrtPath string `yaml:"crt_path"`
KeyPath string `yaml:"key_path"`
CaPath string `yaml:"ca_path"`
ServerDNS string `yaml:"server_dns"`
}
type KeyServiceConfig struct {
KeyServiceDBName string `yaml:"key_service_db_name"`
}