-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
32 lines (28 loc) · 786 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
package constant
import (
"github.com/PICOF/simple-tiktok/pkg/config"
"github.com/spf13/viper"
)
const (
UserServiceName = "user"
PublishServiceName = "publish"
MessageServiceName = "message"
RelationServiceName = "relation"
FeedServiceName = "feed"
FavoriteServiceName = "favorite"
CommentServiceName = "comment"
)
var (
ServiceConfig *viper.Viper
ETCDAddress []string
ExportEndpoint string
ServerServiceName string
ServerAddress string
)
func init() {
ServiceConfig = config.GetConfig("service")
ETCDAddress = ServiceConfig.GetStringSlice("etcd.address")
ExportEndpoint = ServiceConfig.GetString("exportEndpoint")
ServerServiceName = ServiceConfig.GetString("server.name")
ServerAddress = ServiceConfig.GetString("server.address")
}