Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example for implements auth #16

Open
terryzwt opened this issue Jan 29, 2018 · 1 comment
Open

example for implements auth #16

terryzwt opened this issue Jan 29, 2018 · 1 comment

Comments

@terryzwt
Copy link

Thanks for the contribute.

I would like to request example for the auth. thank you.

@codehakase
Copy link

@terryzwt

var DbClient *couchdb.Client

func couchdbAuth(username, password, server string) error {
    u, err := url.Parse(sever)
	if err != nil {
		return err
	}

	if username != "" {
		DbClient, err = couchdb.NewAuthClient(username, password, u)
	} else {
		DbClient, err = couchdb.NewClient(u)
	}
	if err != nil {
		return err
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants