Sha256: 332691a3251a373b995b8b936a8f370c739219d846ee80b169ac3cb9767c1fc2

Contents?: true

Size: 584 Bytes

Versions: 14

Compression:

Stored size: 584 Bytes

Contents

package global

import (
	"encoding/json"
	"fmt"
	"os"
)

type ConfigStruct struct {
	StatsDServerIP string `json:"stats_d_server"`
	SysLogIP       string `json:"syslog_server"`
	RootFolder     string
}

var Config ConfigStruct

func LoadConfig(config string, rootfolder string) error {
	fmt.Println("Loading Config: ", config)

	file, err := os.Open(config)
	if err != nil {
		return fmt.Errorf("Unable to open config")
	}

	decoder := json.NewDecoder(file)
	Config = ConfigStruct{}
	err = decoder.Decode(&Config)
	Config.RootFolder = rootfolder

	fmt.Println(Config)

	return nil
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
minke-generator-go-0.8.7 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.6 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.5 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.4 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.3 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.2 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.1 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.8.0 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.7.2 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.7.1 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.7.0 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.6.0 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.5.0 lib/generators/gomicroservice/scaffold/global/global.go
minke-generator-go-0.4.0 lib/generators/gomicroservice/scaffold/global/global.go