Documentation ¶
Index ¶
- Constants
- type Client
- func (cl *Client) CreateDatabase(dbName string) (j map[string]interface{}, err error)
- func (cl *Client) GetDatabase(dbName string) (d *Database, err error)
- func (cl *Client) ListAllDatabases() (j []string, err error)
- func (cl *Client) Replicate(task *ReplicateTask) (j map[string]interface{}, err error)
- func (cl *Client) ServerInfo() (j map[string]interface{}, err error)
- type ClientBase
- type CouchdbError
- type Database
- func (cl *Database) Compact() (j map[string]interface{}, err error)
- func (cl *Database) CompactDesignDoc(designDoc string) (j map[string]interface{}, err error)
- func (cl *Database) CreateDocument(key string, body map[string]interface{}) (j map[string]interface{}, err error)
- func (cl *Database) Delete() (j map[string]interface{}, err error)
- func (cl *Database) DeleteBulkDocuments(body map[string]interface{}) (j map[string]interface{}, err error)
- func (cl *Database) EnsureFullCommit() (j map[string]interface{}, err error)
- func (cl *Database) GetDocument(key string) (d *Document, err error)
- func (cl *Database) GetDocuments(params map[string]string) (j map[string]interface{}, err error)
- func (cl *Database) GetDocumentsByKeys(body map[string]interface{}) (j map[string]interface{}, err error)
- func (cl *Database) GetInfo() (j map[string]interface{}, err error)
- func (cl *Database) GetSecurity() (j map[string]interface{}, err error)
- func (cl *Database) InsertBulkDocuments(body map[string]interface{}) (j map[string]interface{}, err error)
- func (cl *Database) SetSecurity(body map[string]interface{}) (j map[string]interface{}, err error)
- func (cl *Database) UpdateBulkDocuments(body map[string]interface{}) (j map[string]interface{}, err error)
- func (cl *Database) ViewCleanUp() (j map[string]interface{}, err error)
- type Document
- func (cl *Document) CreateAttachment(attname string, data io.Reader, headers map[string]string) (j map[string]interface{}, err error)
- func (cl *Document) CreateAttachmentByReversion(attname, rev string, data io.Reader, headers map[string]string) (j map[string]interface{}, err error)
- func (cl *Document) Delete() (j map[string]interface{}, err error)
- func (cl *Document) DeleteAttachment(attname string) (j map[string]interface{}, err error)
- func (cl *Document) DeleteAttachmentByReversion(attname, rev string) (j map[string]interface{}, err error)
- func (cl *Document) GetAttachment(attname string) (j map[string]interface{}, err error)
- func (cl *Document) GetAttachmentByReversion(attname, rev string) (j map[string]interface{}, err error)
- func (cl *Document) GetInfo() (j map[string]interface{}, err error)
- func (cl *Document) GetInfoByReversion(rev string) (j map[string]interface{}, err error)
- func (cl *Document) GetReversion() (r string, err error)
- func (cl *Document) Leaf() (j map[string]interface{}, err error)
- func (cl *Document) Update(body map[string]interface{}) (j map[string]interface{}, err error)
- type ICache
- type ITransport
- type MemCache
- type ReplicateTask
- type Transport
Constants ¶
View Source
const ( GET = "GET" POST = "POST" DELETE = "DELETE" PUT = "PUT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ClientBase
}
func NewClientByDSN ¶
func NewClientByTransport ¶
func NewClientByTransport(transport ITransport) *Client
func (*Client) CreateDatabase ¶
create database with dbName
func (*Client) GetDatabase ¶
get database
func (*Client) ListAllDatabases ¶
this is a tricky function couchdb only this interface return a list not a key-value map json
func (*Client) Replicate ¶
func (cl *Client) Replicate(task *ReplicateTask) (j map[string]interface{}, err error)
replicate database
func (*Client) ServerInfo ¶
get server info
type ClientBase ¶
type ClientBase struct { Headers map[string]string Username string Password string // contains filtered or unexported fields }
func (*ClientBase) ClearHeaders ¶
func (cl *ClientBase) ClearHeaders()
func (*ClientBase) SetAuth ¶
func (cl *ClientBase) SetAuth(username, password string)
set basic auth
func (*ClientBase) SetHeaders ¶
func (cl *ClientBase) SetHeaders(headers map[string]string)
type CouchdbError ¶
type CouchdbError struct {
// contains filtered or unexported fields
}
func (CouchdbError) Error ¶
func (e CouchdbError) Error() string
type Database ¶
type Database struct { ClientBase Name string }
func NewDatabase ¶
func NewDatabase(dbName string, transport ITransport) *Database
func (*Database) CompactDesignDoc ¶
compact design doc
func (*Database) CreateDocument ¶
func (cl *Database) CreateDocument(key string, body map[string]interface{}) (j map[string]interface{}, err error)
create document
func (*Database) DeleteBulkDocuments ¶
func (*Database) EnsureFullCommit ¶
ensure full commit
func (*Database) GetDocument ¶
get document
func (*Database) GetDocuments ¶
get all docs http://docs.couchdb.org/en/1.6.1/api/database/bulk-api.html#db-bulk-docs
func (*Database) GetDocumentsByKeys ¶
func (cl *Database) GetDocumentsByKeys(body map[string]interface{}) (j map[string]interface{}, err error)
get docs by keys
func (*Database) GetSecurity ¶
get db security
func (*Database) InsertBulkDocuments ¶
func (*Database) SetSecurity ¶
set db security
func (*Database) UpdateBulkDocuments ¶
func (cl *Database) UpdateBulkDocuments(body map[string]interface{}) (j map[string]interface{}, err error)
update/insert/delete bulk documents
func (*Database) ViewCleanUp ¶
clean db view
type Document ¶
type Document struct { Name string DatabaseName string ClientBase }
func NewDocument ¶
func NewDocument(dbName, docName string, transport ITransport) *Document
func (*Document) CreateAttachment ¶
func (cl *Document) CreateAttachment(attname string, data io.Reader, headers map[string]string) (j map[string]interface{}, err error)
create attachement
func (*Document) CreateAttachmentByReversion ¶
func (cl *Document) CreateAttachmentByReversion(attname, rev string, data io.Reader, headers map[string]string) (j map[string]interface{}, err error)
create attachment
func (*Document) DeleteAttachment ¶
delete attachment
func (*Document) DeleteAttachmentByReversion ¶
func (cl *Document) DeleteAttachmentByReversion(attname, rev string) (j map[string]interface{}, err error)
delete attachment
func (*Document) GetAttachment ¶
get attachment
func (*Document) GetAttachmentByReversion ¶
func (cl *Document) GetAttachmentByReversion(attname, rev string) (j map[string]interface{}, err error)
get attachment
func (*Document) GetInfoByReversion ¶
get info by reversion
func (*Document) GetReversion ¶
get reversion of the document
type ITransport ¶
type ITransport interface {
// contains filtered or unexported methods
}
type MemCache ¶
type MemCache struct {
Hash map[string]interface{}
}
func NewMemCache ¶
func NewMemCache() *MemCache
type ReplicateTask ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.