Code Monkey home page Code Monkey logo

couchdb-go's Introduction

couchdb-go

Build Status

Description

This is my golang CouchDB driver. There are many like it, but this one is mine.

Installation

go get github.com/rhinoman/couchdb-go

Documentation

See the Godoc: http://godoc.org/github.com/rhinoman/couchdb-go

Example Usage

Connect to a server and create a new document:

type TestDocument struct {
	Title string
	Note string
}

...

var timeout = time.Duration(500 * time.Millisecond)
conn, err := couchdb.NewConnection("127.0.0.1",5984,timeout)
auth := couchdb.BasicAuth{Username: "user", Password: "password" }
db := conn.SelectDB("myDatabase", &auth)

theDoc := TestDocument{
	Title: "My Document",
	Note: "This is a note",
}

theId := genUuid() //use whatever method you like to generate a uuid
//The third argument here would be a revision, if you were updating an existing document
rev, err := db.Save(theDoc, theId, "")  
//If all is well, rev should contain the revision of the newly created
//or updated Document

couchdb-go's People

Contributors

rhinoman avatar mffrench avatar pyyoshi avatar cnight avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.