Initial version, empty shell
This commit is contained in:
19
models/config.go
Normal file
19
models/config.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
import "sync"
|
||||
|
||||
type Config struct {
|
||||
MongoUrl string
|
||||
MongoLogin string
|
||||
MongoPassword string
|
||||
}
|
||||
|
||||
var instance *Config
|
||||
var once sync.Once
|
||||
|
||||
func GetConfig() *Config {
|
||||
once.Do(func() {
|
||||
instance = &Config{}
|
||||
})
|
||||
return instance
|
||||
}
|
||||
11
models/workflow.go
Normal file
11
models/workflow.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := GetConfig()
|
||||
// configure storage
|
||||
fmt.Println(c.MongoUrl)
|
||||
}
|
||||
Reference in New Issue
Block a user