Skip to content

Commit

Permalink
Add domains config in setting package
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 4, 2015
1 parent 2be3e1e commit 75be823
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
)

var (
//Global
AppName string
Usage string
Version string
Expand All @@ -29,8 +30,10 @@ var (
DBURI string
DBPasswd string
DBDB int64
BackendDriver string //Container image storage driver name
//Dockyard
BackendDriver string
ImagePath string
Domains string
)

func SetConfig(path string) error {
Expand Down Expand Up @@ -113,6 +116,7 @@ func SetConfig(path string) error {

DBDB, err = conf.Int64("db::db")

//Dockyard
if backenddriver := conf.String("dockyard::driver"); backenddriver != "" {
BackendDriver = backenddriver
} else if backenddriver == "" {
Expand All @@ -125,5 +129,11 @@ func SetConfig(path string) error {
err = fmt.Errorf("Image path config value is null")
}

if domains := conf.String("dockyard::domain"); domains != "" {
Domains = domains
} else if domains == "" {
err = fmt.Errorf("Domains value is null")
}

return err
}

0 comments on commit 75be823

Please sign in to comment.