GitXplorerGitXplorer
t

go-mongodb-config

public
5 stars
2 forks
1 issues

Commits

List of commits on branch master.
Verified
4528f591c7189e52f193db4157157705a2a378d6

add better testing to config/config_test.go (#7)

ttimvaillancourt committed 7 years ago
Unverified
a1337e53c96b0db551968678319147ce3f93ee5f

improve travis testing

ttimvaillancourt committed 7 years ago
Unverified
618519223de5eb03913441986d3873d382745704

Add godoc badge

ttimvaillancourt committed 7 years ago
Unverified
2d5f877440ff0ec11e1ba1368372a7003cd2f06d

fix tests

ttimvaillancourt committed 7 years ago
Unverified
900c83991176c73a973f6e89b2ed51260a8ea770

add tests and travis-ci

ttimvaillancourt committed 7 years ago
Unverified
92d8836dc5f5a0c8d46b8c69534f6fefb3d4934f

add docs #2

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)
	}
}