Skip to content

Commit

Permalink
(CONFIG) : setup go config service
Browse files Browse the repository at this point in the history
  • Loading branch information
Olili2017 committed Aug 12, 2020
1 parent f903acc commit 48eb6ca
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 3,569 deletions.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion service.config/.nyc_output/processinfo/index.json

This file was deleted.

19 changes: 0 additions & 19 deletions service.config/Dockerfile

This file was deleted.

26 changes: 0 additions & 26 deletions service.config/config.json

This file was deleted.

8 changes: 0 additions & 8 deletions service.config/config.test.js

This file was deleted.

Empty file added service.config/config.yml
Empty file.
17 changes: 17 additions & 0 deletions service.config/domain/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package domain

// Config is an abstraction around the map that holds the config values
type Config struct {
config map[string]interface{}
}

// SetFromBytes sets the internal config based on a byte array of YAML
func (c *Config) SetFromBytes(data []byte) error{

return nil
}

// Get returns the config for a particular service
func (c *Config) Get(serviveName string) (map[string]interface{}, error) {
return nil, nil
}
5 changes: 0 additions & 5 deletions service.config/env.yml

This file was deleted.

20 changes: 20 additions & 0 deletions service.config/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"io/ioutil"
"github.com/Olili2017/tenant-management-system/service.config/domain"
)

func main(){
config := domain.Config{}

data, err := ioutil.ReadFile("/config.yml")
if err != nil {
panic(err)
}

err = config.SetFromBytes(data)
if err != nil {
panic(err)
}
}
Loading

0 comments on commit 48eb6ca

Please sign in to comment.