GitXplorerGitXplorer
t

go-mongodb-config

public
5 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
3b492556abe820d333d6a772726f65f9be9c0928

add docs

ttimvaillancourt committed 7 years ago
Unverified
1253d1c62a4de5973878148246acd130a7cf8b20

Merge pull request #6 from timvaillancourt/gofmt_v1

ttimvaillancourt committed 7 years ago
Unverified
fd54b42775b771d78ab9a2b0d0eb1eacbad4c491

Add LoadUri() and goreportcard.com

ttimvaillancourt committed 7 years ago
Unverified
d8908a20dd206f8bff26212ab9a218aff7ed15c8

Merge pull request #5 from timvaillancourt/gofmt_v1

ttimvaillancourt committed 7 years ago
Unverified
530d6b4a69ea4c10f45889a53bc8db2e033d4d45

Add LICENSE

ttimvaillancourt committed 7 years ago
Unverified
91faf66f7e4206cc2c3814621bbc4b68c1ed1cde

Merge pull request #4 from timvaillancourt/gofmt_v1

ttimvaillancourt committed 7 years ago

README

The README file for this repository.

go-mongodb-config

Build Status Go Report Card codecov

A package for reading/writing MongoDB yaml-based configurations

Docs

Usage

Create 'Config' struct from file (YAML-based only):

import (
	mongodb_config "github.com/timvaillancourt/go-mongodb-config/config"
)

func main() {
	config, err := mongodb_config.Load("/etc/mongod.conf")
	if err != nil {
		panic(err)
	}
	...
}

Create 'Config' struct from uri:

import (
        mongodb_config "github.com/timvaillancourt/go-mongodb-config/config"
)

func main() {
        config, err := mongodb_config.LoadUri("http://example.com/etc/mongod.conf")
        if err != nil {
                panic(err)
        }
        ...
}

Write 'Config' struct to file:

import (
	mongodb_config "github.com/timvaillancourt/go-mongodb-config/config"
)
 
func main() {
	config := mongodb_config.New()
	...
	err := config.Write("/etc/mongod.conf")
	if err != nil {
		panic(err)
	}
}