Skip to content

plagiari-sm/psm-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psm-config

psm-config is a centralized configuration package written in Go to store information for every service in Plagiarism's Ecosystem.

How to use

package main

import (
	"fmt"

	// import psm-config package
	psmconfig "github.com/plagiari-sm/psm-config"
)

func init() {
	// during init or in main read `--config ./conf/default.yaml` flag
	// and parse configuration file
	psmconfig.NewConfig()
}

func main() {
	// access global configuration variable
	config := psmconfig.Config
	fmt.Println(config)
}

Configuration file example

# devevelopment.yaml
name: svc-listen
env: development
host: 0.0.0.0
port: 8000
mongo:
    port: 27017
    host: 0.0.0.0
    user: username
    pass: password
    path: collection
twitter:
    consumer-key: $TWITTER_CONSUMER_KEY
    consumer-secret: $TWITTER_CONSUMER_SECRET
    access-token: $TWITTER_ACCESS_TOKEN
    access-token-secret: $TWITTER_ACCESS_TOKEN_SECRET

About

Centralized Configuration Package

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages