Hello community, here is the log from the commit of package go-couch-go for openSUSE:Factory checked in at 2013-08-21 10:29:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/go-couch-go (Old) and /work/SRC/openSUSE:Factory/.go-couch-go.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go-couch-go" Changes: -------- New Changes file: --- /dev/null 2013-07-23 23:44:04.804033756 +0200 +++ /work/SRC/openSUSE:Factory/.go-couch-go.new/go-couch-go.changes 2013-08-21 10:29:52.000000000 +0200 @@ -0,0 +1,39 @@ +------------------------------------------------------------------- +Tue Aug 13 11:45:25 UTC 2013 - [email protected] + +- Update to version 0.0.0+hg20120329.56.80177d89e264: + + Upstream provides no changelog +- Use _service file +- Drop rpmlintrc, both issues are obvious Go issues + +------------------------------------------------------------------- +Tue Aug 13 07:59:11 UTC 2013 - [email protected] + +- Use %{go_exclusivearch} macro + +------------------------------------------------------------------- +Sat Jun 29 10:52:05 UTC 2013 - [email protected] + +- Update package to latest mercurial + +------------------------------------------------------------------- +Fri Oct 7 10:23:09 UTC 2011 - [email protected] + +- update API to Go r60 (via patch, changes submitted upstream) + +------------------------------------------------------------------- +Wed Jun 8 15:14:17 UTC 2011 - [email protected] + +- Use new %go_disable_brp_strip_static_archive macro + +------------------------------------------------------------------- +Sun May 22 10:31:34 UTC 2011 - [email protected] + +- Require couchdb +- Disable tests, they need a running CouchDB + +------------------------------------------------------------------- +Sat May 21 14:36:27 UTC 2011 - [email protected] + +- Initial version + New: ---- README.SUSE _service couch-go-0.0.0+hg20120329.56.80177d89e264.tar.bz2 go-couch-go.changes go-couch-go.spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go-couch-go.spec ++++++ # # spec file for package go-couch-go # # Copyright (c) 2011 Sascha Peilicke <[email protected]> # Copyright (c) 2013 SUSE Linux Products GmbH # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: go-couch-go Version: 0.0.0+hg20120329.56.80177d89e264 Release: 0 Summary: Simple CouchDB API for Google Go Group: Development/Languages/Other License: MIT URL: http://code.google.com/p/couch-go/ Source0: couch-go-%{version}.tar.bz2 Source1: README.SUSE BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: go-devel Requires: couchdb %if 0%{?suse_version} >= 1100 Recommends: go-couch-go-doc %endif %{go_provides} %{go_requires} %description Couch-go is a simple CouchDB (0.9+) API for the Google Go language. It supports basic operations on documents. %package doc Summary: API documenation Group: Documentation/Other Requires: %{name} = %{version} %description doc API, examples and documentation. %prep %setup -q -n couch-go-%{version} %build %goprep code.google.com/p/couch-go %gobuild %install %goinstall %godoc %files %defattr(-,root,root,-) %doc LICENSE %{go_contribdir}/* %files doc %defattr(-,root,root,-) %{go_contribsrcdir}/* %changelog ++++++ README.SUSE ++++++ Basic usage First, create a Database object to represent the DB you'll be interacting with db, err := couch.NewDatabase("127.0.0.1", "5984", "databasename") A CouchDB document is represented by a Go struct type Record struct { Type string Count uint64 Elements []string MyMap map[string]string } You can Insert these documents directly r := Record{...} id, rev, err := db.Insert(r) and Retrieve them by ID. r := new(Record) rev, err := db.Retrieve(id, r) If you want to specify document IDs, rather than have them auto-generated, you can use the InsertWith function r := Record{...} _, rev, err := db.InsertWith(r, "record_001") or embed the _id in your document structure type CompleteRecord struct { Id string "_id" Rev string "_rev" // useful only for Retrieve and Edit Foo string Count uint64 } r := CompleteRecord{Id:"id001", Rev:"", Foo:"abc", Count:0} _, rev, err := db.Insert(r) You can also Edit a document, either by manually specifying the id and current revision r := new(Record) current_rev, err := db.Retrieve(some_id, r) r.Count = r.Count + 1 current_rev, err = db.EditWith(r, some_id, current_rev) if err != nil { // edit failed, out of sync? } or, as with Insert, by embedding _id and _rev fields in the document structure complete_r = new(CompleteRecord) // has Id and Rev current_rev, err := db.Retrieve(some_id, complete_r) complete_r.Count = complete_r.Count + 1 current_rev, err = db.Edit(complete_r) if err != nil { // edit failed, out of sync? } Delete works as expected if err := db.Delete(id, current_rev); err != nil { // delete failed, out of sync? } You can also perform simple queries on views func (p Database) Query(view string, options map[string]interface{}) ([]string, os.Error) Check the source for more details. Gotchas couch-go uses the reflect package (by way of the json package) to read and write documents via the CouchDB API. reflect requires that struct fields are public (ie. begin with a capital letter) to read from and write to them. So, your document structures in Go must contain capitalized field names. The behavior of the Insert and Edit classes of functions depend on the contents of the struct you pass to them ++++++ _service ++++++ <services> <service name="tar_scm" mode="disabled"> <param name="url">https://code.google.com/p/couch-go/</param> <param name="scm">hg</param> <param name="exclude">.hg</param> <param name="versionformat">0.0.0+hg{date(date, \"%Y%m%d\")}.{rev}.{node|short}</param> <param name="revision">tip</param> </service> <service name="recompress" mode="disabled"> <param name="file">couch-go-*.tar</param> <param name="compression">bz2</param> </service> <service name="set_version" mode="disabled"> <param name="basename">couch-go</param> </service> </services> -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
