Categorygithub.com/ryanjyoder/couchdb
modulepackage
2.0.0+incompatible
Repository: https://github.com/ryanjyoder/couchdb.git
Documentation: pkg.go.dev

# README

couchdb

Build Status Go Report Card Coverage Status GoDoc

CouchDB client for Go.

Example

package main

import (
	"log"

	"github.com/zemirco/couchdb"
)

func main() {
	u, err := url.Parse("http://127.0.0.1:5984/")
	if err != nil {
		panic(err)
	}
	// create a new client
	client, err := couchdb.NewClient(u)
	if err != nil {
		panic(err)
	}
	// get some information about your CouchDB
	info, err := client.Info()
	if err != nil {
		panic(err)
	}
	log.Println(info)

}

More examples.

Test

go test

License

MIT

# Packages

No description provided by the author

# Functions

NewAuthClient returns new couchdb client with basic authentication.
NewClient returns new couchdb client for given url.
NewUser returns new user instance.
RandDBName returns random CouchDB database name.

# Structs

Attachment describes attachments of a document.
BulkDoc describes POST /db/_bulk_docs request object.
Client holds all info for database client.
Credentials has information about POST _session form parameters.
Database performs actions on certain database.
DatabaseInfo has info about the specified database.
DatabaseResponse is body for successful database calls.
DesignDocument is a special type of CouchDB document that contains application code.
DesignDocumentView contains map/reduce functions.
Document is base struct which should be embedded by any other couchdb document.
DocumentResponse is response for multipart/related file upload.
Element is single element inside Admins/Members in security document.
Error describes CouchDB error.
GetSessionResponse returns complete information about authenticated user.
PostSessionResponse is response from posting to session api.
PurgeResponse is response from POST request to the _purge URL.
QueryParameters is struct to define url query parameters for design documents.
Replication is a document from the _replicator database.
ReplicationHistory is part of the ReplicationResponse JSON object.
ReplicationRequest is JSON object for post request to _replicate URL.
ReplicationResponse is JSON object for response from post request to _replicate URL.
Row is single row inside design document query response.
SecurityDocument describes document _security document.
Server gives access to the welcome string and version information.
Task describes currently running task.
User is special CouchDB document format.
View performs actions and certain view documents.
ViewResponse is response for querying design documents.

# Interfaces

ClientService is an interface for dealing with a single CouchDB database.
CouchDoc describes interface for every couchdb document.
DatabaseService is an interface for dealing with a single CouchDB database.
ViewService is an interface for dealing with a view inside a CouchDB database.

# Type aliases

RFC1123 is time format used by CouchDB for history fields.
Timestamp is time format used by CouchDB for the _replication_state_time field.