couchdb2go

package module
v0.0.0-...-dffe428 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

README

couchdb2-go

WIP Go HTTP wrapper over Couchdb2 API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Readln

func Readln(r *bufio.Reader) (ln []byte, err error)

Types

type ActiveTasksResponse

type ActiveTasksResponse []struct {
	ErrorResponse
	ChangesDone           int         `json:"changes_done,omitempty"`
	Database              string      `json:"database,omitempty"`
	Pid                   string      `json:"pid"`
	Progress              int         `json:"progress"`
	StartedOn             int         `json:"started_on"`
	TotalChanges          int         `json:"total_changes,omitempty"`
	Type                  string      `json:"type"`
	UpdatedOn             int         `json:"updated_on"`
	DesignDocument        string      `json:"design_document,omitempty"`
	CheckpointedSourceSeq int         `json:"checkpointed_source_seq,omitempty"`
	Continuous            bool        `json:"continuous,omitempty"`
	DocID                 interface{} `json:"doc_id,omitempty"`
	DocWriteFailures      int         `json:"doc_write_failures,omitempty"`
	DocsRead              int         `json:"docs_read,omitempty"`
	DocsWritten           int         `json:"docs_written,omitempty"`
	MissingRevisionsFound int         `json:"missing_revisions_found,omitempty"`
	ReplicationID         string      `json:"replication_id,omitempty"`
	RevisionsChecked      int         `json:"revisions_checked,omitempty"`
	Source                string      `json:"source,omitempty"`
	SourceSeq             int         `json:"source_seq,omitempty"`
	Target                string      `json:"target,omitempty"`
}

type AllDbsResponse

type AllDbsResponse []string

type AllDocsRequest

type AllDocsRequest struct {
	Conflicts        bool   `json:"conflicts, omitempty"`
	Descending       bool   `json:"descending, omitempty"`
	EndKey           string `json:"endkey, omitempty"`
	End_key          string `json:"end_key, omitempty"`
	EndKey_DocID     string `json:"endkey_docid, omitempty"`
	End_Key_Doc_ID   string `json:"end_key_doc_id, omitempty"`
	IncludeDocs      bool   `json:"include_docs, omitempty"`
	InclusiveEnd     bool   `json:"inclusive_end, omitempty"`
	Key              string `json:"key, omitempty"`
	Keys             string `json:"keys, omitempty"`
	Limit            int    `json:"limit, omitempty"`
	Skip             int    `json:"skip, omitempty"`
	Stale            string `json:"stale, omitempty"`
	StartKey         string `json:"startkey, omitempty"`
	Start_Key        string `json:"start_key, omitempty"`
	StartKey_DocID   string `json:"startkey_docid, omitempty"`
	Start_Key_Doc_ID string `json:"start_key_doc_id, omitempty"`
	UpdateSeq        bool   `json:"update_seq, omitempty"`
}

type AllDocsResponse

type AllDocsResponse struct {
	ErrorResponse
	Offset int `json:"offset"`
	Rows   []struct {
		ID    string `json:"id"`
		Key   string `json:"key"`
		Value struct {
			Rev string `json:"rev"`
		} `json:"value"`
	} `json:"rows"`
	TotalRows int `json:"total_rows"`
}

type BulkResponse

type BulkResponse []CreateDocumentResponse

type ChangesRequest

type ChangesRequest struct {
	DocsIds         []string `json:"docs_ids"`
	Conflicts       bool     `json:"conflicts"`
	Descending      bool     `json:"descending"`
	Feed            string   `json:"feed"`
	Filter          string   `json:"filter"`
	HeartBeat       int      `json:"heartbeat"`
	IncludeDocs     bool     `json:"include_docs"`
	Attachments     bool     `json:"attachments"`
	AttEncodingInfo bool     `json:"att_encoding_info"`
	LastEventId     int      `json:"last-event-id"`
	Limit           int      `json:"limit"`
	Since           int      `json:"since"`
	Style           string   `json:"string"`
	Timeout         int      `json:"timeout"`
	View            string   `json:"view"`
}

type ChangesResponse

type ChangesResponse struct {
	ErrorResponse
	LastSeq int         `json:"last_seq"`
	Results []*DbResult `json:"results"`
}

type Client

type Client interface {
	Meta() (*MetaResponse, error)
	ActiveTasks() (*ActiveTasksResponse, error)
	AllDbs() (*AllDbsResponse, error)
	DbUpdates(r *DbUpdatesRequest) (*DbUpdatesResponse, error)
	Membership() (*MembershipResponse, error)
	Log(*LogRequest) (*LogResponse, error)
	Replicate() (*ReplicateResponse, error)
	Restart() (*RestartResponse, error)
	Stats() (*StatsResponse, error)
	UUIDs(uint8) (*UUIDsResponse, error)
	Config() (*ConfigResponse, error)
	Config
}

func NewClient

func NewClient(t time.Duration, addr string, user, pass string) (c Client)

type Config

type Config interface {
	Section(string) (*ConfigSectionResponse, error)
}

type ConfigResponse

type ConfigResponse struct {
	ErrorResponse
	Attachments struct {
		CompressibleTypes string `json:"compressible_types"`
		CompressionLevel  string `json:"compression_level"`
	} `json:"attachments"`
	CouchHttpdAuth struct {
		AuthCacheSize          string `json:"auth_cache_size"`
		AuthenticationDb       string `json:"authentication_db"`
		AuthenticationRedirect string `json:"authentication_redirect"`
		RequireValidUser       string `json:"require_valid_user"`
		Timeout                string `json:"timeout"`
	} `json:"couch_httpd_auth"`
	Couchdb struct {
		DatabaseDir            string `json:"database_dir"`
		DelayedCommits         string `json:"delayed_commits"`
		MaxAttachmentChunkSize string `json:"max_attachment_chunk_size"`
		MaxDbsOpen             string `json:"max_dbs_open"`
		MaxDocumentSize        string `json:"max_document_size"`
		OsProcessTimeout       string `json:"os_process_timeout"`
		URIFile                string `json:"uri_file"`
		UtilDriverDir          string `json:"util_driver_dir"`
		ViewIndexDir           string `json:"view_index_dir"`
	} `json:"couchdb"`
	Daemons struct {
		AuthCache        string `json:"auth_cache"`
		DbUpdateNotifier string `json:"db_update_notifier"`
		ExternalManager  string `json:"external_manager"`
		Httpd            string `json:"httpd"`
		QueryServers     string `json:"query_servers"`
		StatsAggregator  string `json:"stats_aggregator"`
		StatsCollector   string `json:"stats_collector"`
		Uuids            string `json:"uuids"`
		ViewManager      string `json:"view_manager"`
	} `json:"daemons"`
	Httpd struct {
		AllowJsonp             string `json:"allow_jsonp"`
		AuthenticationHandlers string `json:"authentication_handlers"`
		BindAddress            string `json:"bind_address"`
		DefaultHandler         string `json:"default_handler"`
		MaxConnections         string `json:"max_connections"`
		Port                   string `json:"port"`
		SecureRewrites         string `json:"secure_rewrites"`
		VhostGlobalHandlers    string `json:"vhost_global_handlers"`
	} `json:"httpd"`
	HttpdDbHandlers struct {
		Changes     string `json:"_changes"`
		Compact     string `json:"_compact"`
		Design      string `json:"_design"`
		TempView    string `json:"_temp_view"`
		ViewCleanup string `json:"_view_cleanup"`
	} `json:"httpd_db_handlers"`
	HttpdDesignHandlers struct {
		Info    string `json:"_info"`
		List    string `json:"_list"`
		Rewrite string `json:"_rewrite"`
		Show    string `json:"_show"`
		Update  string `json:"_update"`
		View    string `json:"_view"`
	} `json:"httpd_design_handlers"`
	HttpdGlobalHandlers struct {
		NAMING_FAILED string `json:"/"`
		ActiveTasks   string `json:"_active_tasks"`
		AllDbs        string `json:"_all_dbs"`
		Config        string `json:"_config"`
		Log           string `json:"_log"`
		Oauth         string `json:"_oauth"`
		Replicate     string `json:"_replicate"`
		Restart       string `json:"_restart"`
		Session       string `json:"_session"`
		Stats         string `json:"_stats"`
		Utils         string `json:"_utils"`
		Uuids         string `json:"_uuids"`
		FaviconIco    string `json:"favicon.ico"`
	} `json:"httpd_global_handlers"`
	Log struct {
		File        string `json:"file"`
		IncludeSasl string `json:"include_sasl"`
		Level       string `json:"level"`
	} `json:"log"`
	QueryServerConfig struct {
		ReduceLimit string `json:"reduce_limit"`
	} `json:"query_server_config"`
	QueryServers struct {
		Javascript string `json:"javascript"`
	} `json:"query_servers"`
	Replicator struct {
		MaxHTTPPipelineSize string `json:"max_http_pipeline_size"`
		MaxHTTPSessions     string `json:"max_http_sessions"`
	} `json:"replicator"`
	Stats struct {
		Rate    string `json:"rate"`
		Samples string `json:"samples"`
	} `json:"stats"`
	Uuids struct {
		Algorithm string `json:"algorithm"`
	} `json:"uuids"`
}

type ConfigSectionResponse

type ConfigSectionResponse struct {
	ErrorResponse
	AllowJsonp             string `json:"allow_jsonp"`
	AuthenticationHandlers string `json:"authentication_handlers"`
	BindAddress            string `json:"bind_address"`
	DefaultHandler         string `json:"default_handler"`
	EnableCors             string `json:"enable_cors"`
	LogMaxChunkSize        string `json:"log_max_chunk_size"`
	Port                   string `json:"port"`
	SecureRewrites         string `json:"secure_rewrites"`
	VhostGlobalHandlers    string `json:"vhost_global_handlers"`
}

type CouchDb2ConnDetails

type CouchDb2ConnDetails struct {
	Client   *http.Client
	Address  string
	Username string
	Password string
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(timeout time.Duration, addr string, user, pass string, _ bool) (conn *CouchDb2ConnDetails)

func (*CouchDb2ConnDetails) GetConnection

func (c *CouchDb2ConnDetails) GetConnection() *CouchDb2ConnDetails

type CreateDocumentResponse

type CreateDocumentResponse struct {
	ErrorResponse
	ID  string `json:"id"`
	Ok  bool   `json:"ok"`
	Rev string `json:"rev, omitempty"`
}

type Database

type Database interface {
	Exists(string) (*bool, error)
	Meta(string) (*DbMetaResponse, error)
	CreateDb(string) (*OkKoResponse, error)
	DeleteDb(string) (*OkKoResponse, error)
	CreateDocument(db string, doc interface{})
	CreateDocumentExtra(db string, doc interface{}, batch bool, fullCommit bool)
	Documents(db string, req *AllDocsRequest) (*AllDocsResponse, error)
	DocumentsWithIDs(db string, req *DocsWithIDsRequest) (*AllDocsResponse, error)
	Bulk(db string, docs []interface{}, newEdits bool) (*BulkResponse, error)
	Find(db string, req *FindRequest) (*FindResponse, error)
	SetIndex(db string, req *SetIndexRequest) (*SetIndexResponse, error)
	Index(db string) (*IndexResponse, error)
	Delete(db string, designDoc string, name string) (*OkKoResponse, error)
	Explain(db string, req *FindRequest) (*ExplainResponse, error)
	Changes(db string, req map[string]string) (*ChangesResponse, error)
	//ChangesContinuous(db string, queryReq map[string]string, inCh chan *DbResult, quitCh chan struct{}) (chan *DbResult, chan<- struct{}, error)
	ChangesContinuousRaw(db string, queryReq map[string]string, inCh chan *DbResult, quitCh chan struct{}) (<-chan *DbResult, chan<- struct{}, error)
	ChangesContinuousBytes(db string, queryReq map[string]string) (*http.Response, error)
	Compact(db string) (*OkKoResponse, error)
	CompactDesignDoc(db string, ddoc string) (*OkKoResponse, error)
	EnsureFullCommit(db string) (*EnsureFullCommitResponse, error)
	ViewCleanup(db string) (*OkKoResponse, error)
	Security(db string) (*SecurityResponse, error)
	SetSecurity(db string, req *SecurityRequest) (*OkKoResponse, error)
	DoPurge(db string, req map[string]interface{}) (*DoPurgeResponse, error)
	MissingKeys(db string, req map[string]interface{}) (*MissingKeysResponse, error)
	RevsDiff(db string, req *RevsDiffRequest) (*RevsDiffResponse, error)
	RevsLimit(db string) (int, error)
	SetRevsLimit(db string, n int) (*OkKoResponse, error)
}

func NewDatabase

func NewDatabase(timeout time.Duration, addr string, user, pass string, secure bool) (dat Database)

type DatabasesClient

type DatabasesClient struct {
	*CouchDb2ConnDetails
}

func (*DatabasesClient) Bulk

func (d *DatabasesClient) Bulk(db string, docs []interface{}, newEdits bool) (*BulkResponse, error)

func (*DatabasesClient) Changes

func (d *DatabasesClient) Changes(db string, queryReq map[string]string) (*ChangesResponse, error)

func (*DatabasesClient) ChangesContinuousBytes

func (d *DatabasesClient) ChangesContinuousBytes(db string, queryReq map[string]string) (*http.Response, error)

func (*DatabasesClient) ChangesContinuousRaw

func (d *DatabasesClient) ChangesContinuousRaw(db string, queryReq map[string]string, out chan *DbResult, quit chan struct{}) (<-chan *DbResult, chan<- struct{}, error)

func (*DatabasesClient) Compact

func (d *DatabasesClient) Compact(db string) (*OkKoResponse, error)

func (*DatabasesClient) CompactDesignDoc

func (d *DatabasesClient) CompactDesignDoc(db string, ddoc string) (*OkKoResponse, error)

func (*DatabasesClient) CreateDb

func (d *DatabasesClient) CreateDb(string) (*OkKoResponse, error)

func (*DatabasesClient) CreateDocument

func (d *DatabasesClient) CreateDocument(db string, doc interface{})

func (*DatabasesClient) CreateDocumentExtra

func (d *DatabasesClient) CreateDocumentExtra(db string, doc interface{}, batch bool, fullCommit bool)

func (*DatabasesClient) Delete

func (d *DatabasesClient) Delete(db string, designDoc string, name string) (*OkKoResponse, error)

func (*DatabasesClient) DeleteDb

func (d *DatabasesClient) DeleteDb(string) (*OkKoResponse, error)

func (*DatabasesClient) DoPurge

func (d *DatabasesClient) DoPurge(db string, req map[string]interface{}) (*DoPurgeResponse, error)

func (*DatabasesClient) Documents

func (d *DatabasesClient) Documents(db string, req *AllDocsRequest) (*AllDocsResponse, error)

func (*DatabasesClient) DocumentsWithIDs

func (d *DatabasesClient) DocumentsWithIDs(db string, req *DocsWithIDsRequest) (*AllDocsResponse, error)

func (*DatabasesClient) EnsureFullCommit

func (d *DatabasesClient) EnsureFullCommit(db string) (*EnsureFullCommitResponse, error)

func (*DatabasesClient) Exists

func (d *DatabasesClient) Exists(string) (*bool, error)

func (*DatabasesClient) Explain

func (d *DatabasesClient) Explain(db string, req *FindRequest) (*ExplainResponse, error)

func (*DatabasesClient) Find

func (d *DatabasesClient) Find(db string, req *FindRequest) (*FindResponse, error)

func (*DatabasesClient) GetConnection

func (d *DatabasesClient) GetConnection() *CouchDb2ConnDetails

func (*DatabasesClient) Index

func (d *DatabasesClient) Index(db string) (*IndexResponse, error)

func (*DatabasesClient) Meta

func (*DatabasesClient) MissingKeys

func (d *DatabasesClient) MissingKeys(db string, req map[string]interface{}) (*MissingKeysResponse, error)

func (*DatabasesClient) RevsDiff

func (d *DatabasesClient) RevsDiff(db string, req *RevsDiffRequest) (*RevsDiffResponse, error)

func (*DatabasesClient) RevsLimit

func (d *DatabasesClient) RevsLimit(db string) (int, error)

func (*DatabasesClient) Security

func (d *DatabasesClient) Security(db string) (*SecurityResponse, error)

func (*DatabasesClient) SetIndex

func (d *DatabasesClient) SetIndex(db string, req *SetIndexRequest) (*SetIndexResponse, error)

func (*DatabasesClient) SetRevsLimit

func (d *DatabasesClient) SetRevsLimit(db string, n int) (*OkKoResponse, error)

func (*DatabasesClient) SetSecurity

func (d *DatabasesClient) SetSecurity(db string, req *SecurityRequest) (*OkKoResponse, error)

func (*DatabasesClient) ViewCleanup

func (d *DatabasesClient) ViewCleanup(db string) (*OkKoResponse, error)

type DbMetaResponse

type DbMetaResponse struct {
	ErrorResponse
	CommittedUpdateSeq int    `json:"committed_update_seq"`
	CompactRunning     bool   `json:"compact_running"`
	DataSize           int    `json:"data_size"`
	DbName             string `json:"db_name"`
	DiskFormatVersion  int    `json:"disk_format_version"`
	DiskSize           int    `json:"disk_size"`
	DocCount           int    `json:"doc_count"`
	DocDelCount        int    `json:"doc_del_count"`
	InstanceStartTime  string `json:"instance_start_time"`
	PurgeSeq           int    `json:"purge_seq"`
	UpdateSeq          int    `json:"update_seq"`
}

type DbResult

type DbResult struct {
	LastSeq
	*ErrorResponse
	Changes []struct {
		Rev string `json:"rev"`
	} `json:"changes"`
	ID        string                 `json:"id"`
	Seq       json.Number            `json:"seq,Number"`
	Deleted   bool                   `json:"deleted,omitempty"`
	DbName    string                 `json:"database,omitempty"`
	Doc       map[string]interface{} `json:"doc,omitempty"`
	HeartBeat bool                   `json:heartbeat,omitempty`
}

type DbUpdatesRequest

type DbUpdatesRequest struct {
	Feed      string `json:"feed"`
	Timeout   int    `json:"timeout"`
	HeartBeat bool   `json:"heartbeat"`
}

type DbUpdatesResponse

type DbUpdatesResponse struct {
	ErrorResponse
	DbName string `json:"db_name"`
	Ok     bool   `json:"ok"`
	Type   string `json:"type"`
}

type Deleted

type Deleted struct {
	Deleted bool   `json:"_deleted"`
	Id      string `json:"_id"`
	Rev     string `json:"_rev"`
}

type DesignDocsClient

type DesignDocsClient struct {
	*CouchDb2ConnDetails
}

func (*DesignDocsClient) View

func (d *DesignDocsClient) View(db string, req ViewRequest) (res ViewResponse, err error)

func (*DesignDocsClient) ViewWithType

func (d *DesignDocsClient) ViewWithType(db string, req ViewRequest, t interface{}) (res ViewResponse, err error)

type DesignDocuments

type DesignDocuments interface {
	View(db string, req ViewRequest) (res ViewResponse, err error)
	ViewWithType(db string, req ViewRequest, t interface{}) (res ViewResponse, err error)
}

func NewDesignDocuments

func NewDesignDocuments(timeout time.Duration, addr string, user, pass string, secured bool) (doc DesignDocuments)

func NewDesignDocumentsWithConnection

func NewDesignDocumentsWithConnection(conn *CouchDb2ConnDetails) (doc DesignDocuments)

type DoPurgeResponse

type DoPurgeResponse struct {
	ErrorResponse
	PurgeSeq int `json:"purge_seq"`
	Purged   struct {
		C6114C65E295552Ab1019E2B046B10E []string `json:"c6114c65e295552ab1019e2b046b10e"`
	} `json:"purged"`
}

type DocsWithIDsRequest

type DocsWithIDsRequest struct {
	Keys []string `json:"keys"`
}

type Documents

type Documents interface {
	Headers(db string, id string) (size *int, rev string, err error)
	Document(db string, id string) ([]byte, error)
	DocumentWithType(db string, id string, t interface{}) error
	UpdateDocument(db string, id string, req map[string]interface{}) (*OkKoResponse, error)
	DeleteDocument(db string, id string) (*OkKoResponse, error)
}

func NewDocuments

func NewDocuments(timeout time.Duration, addr string, user, pass string, secured bool) (doc Documents)

func NewDocumentsWithConnection

func NewDocumentsWithConnection(conn *CouchDb2ConnDetails) (doc Documents)

type DocumentsClient

type DocumentsClient struct {
	*CouchDb2ConnDetails
}

func (*DocumentsClient) DeleteDocument

func (d *DocumentsClient) DeleteDocument(db string, id string) (*OkKoResponse, error)

func (*DocumentsClient) Document

func (d *DocumentsClient) Document(db string, id string) ([]byte, error)

func (*DocumentsClient) DocumentWithType

func (d *DocumentsClient) DocumentWithType(db string, id string, t interface{}) (err error)

func (*DocumentsClient) Headers

func (d *DocumentsClient) Headers(db string, id string) (size *int, rev string, err error)

func (*DocumentsClient) UpdateDocument

func (d *DocumentsClient) UpdateDocument(db string, id string, req map[string]interface{}) (*OkKoResponse, error)

type EnsureFullCommitResponse

type EnsureFullCommitResponse struct {
	OkKoResponse
	InstanceStartTime string `json:"instance_start_time"`
}

type ErrorResponse

type ErrorResponse struct {
	ErrorS string `json:"error, omitempty"`
	Reason string `json:"reason, omitempty"`
}

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type ExplainResponse

type ExplainResponse struct {
	ErrorResponse
	Dbname string `json:"dbname"`
	Index  struct {
		Ddoc string `json:"ddoc"`
		Name string `json:"name"`
		Type string `json:"type"`
		Def  struct {
			Fields []struct {
				Year string `json:"year"`
			} `json:"fields"`
		} `json:"def"`
	} `json:"index"`
	Selector struct {
		Year struct {
			Gt int `json:"$gt"`
		} `json:"year"`
	} `json:"selector"`
	Opts struct {
		UseIndex []interface{} `json:"use_index"`
		Bookmark string        `json:"bookmark"`
		Limit    int           `json:"limit"`
		Skip     int           `json:"skip"`
		Sort     struct {
		} `json:"sort"`
		Fields    []string `json:"fields"`
		R         []int    `json:"r"`
		Conflicts bool     `json:"conflicts"`
	} `json:"opts"`
	Limit  int      `json:"limit"`
	Skip   int      `json:"skip"`
	Fields []string `json:"fields"`
	Range  struct {
		StartKey []int `json:"start_key"`
		EndKey   []struct {
		} `json:"end_key"`
	} `json:"range"`
}

type FindRequest

type FindRequest struct {
	Selector map[string]interface{} `json:"selector"`
	Fields   []string               `json:"fields"`
	Sort     []struct {
		Year string `json:"year"`
	} `json:"sort"`
	Limit int `json:"limit"`
	Skip  int `json:"skip"`
}

type FindResponse

type FindResponse struct {
	ErrorResponse
	Docs []map[string]interface{} `json:"docs"`
}

type HeartBeatResult

type HeartBeatResult struct{}

type IndexResponse

type IndexResponse struct {
	ErrorResponse
	TotalRows int `json:"total_rows"`
	Indexes   []struct {
		Ddoc interface{} `json:"ddoc"`
		Name string      `json:"name"`
		Type string      `json:"type"`
		Def  struct {
			Fields []struct {
				ID string `json:"_id"`
			} `json:"fields"`
		} `json:"def"`
	} `json:"indexes"`
}

type LastSeq

type LastSeq struct {
	Last_Seq *string `json:"last_seq"`
}

type LogRequest

type LogRequest struct {
	ErrorResponse
	Bytes  uint32 `json:"bytes"`
	Offset uint32 `json:"offset"`
}

type LogResponse

type LogResponse string

type MembershipResponse

type MembershipResponse struct {
	ErrorResponse
	AllNodes     []string `json:"all_nodes"`
	ClusterNodes []string `json:"cluster_nodes"`
}

type MetaResponse

type MetaResponse struct {
	ErrorResponse
	CouchDB string `json:"couchdb"`
	UUID    string `json:"uuid"`
	Vendor  struct {
		Name    string `json:"name"`
		Version string `json:"version"`
	} `json:"vendor"`
	Version string `json:"version"`
}

type MissingKeysResponse

type MissingKeysResponse struct {
	ErrorResponse
	MissedRevs []map[string]interface{} `json:"missed_revs"`
}

type OkKoResponse

type OkKoResponse struct {
	ErrorResponse
	Ok bool `json:"ok"`
}

type ReplicateRequest

type ReplicateRequest struct {
	Cancel       bool     `json:"cancel"`
	Continuous   bool     `json:"continuous"`
	CreateTarget bool     `json:"create_target"`
	DocIds       []string `json:"doc_ids"`
	Proxy        string   `json:"proxy"`
	Source       string   `json:"source"`
	Target       string   `json:"target"`
}

type ReplicateResponse

type ReplicateResponse struct {
	ErrorResponse
	History []struct {
		DocWriteFailures int    `json:"doc_write_failures"`
		DocsRead         int    `json:"docs_read"`
		DocsWritten      int    `json:"docs_written"`
		EndLastSeq       int    `json:"end_last_seq"`
		EndTime          string `json:"end_time"`
		MissingChecked   int    `json:"missing_checked"`
		MissingFound     int    `json:"missing_found"`
		RecordedSeq      int    `json:"recorded_seq"`
		SessionID        string `json:"session_id"`
		StartLastSeq     int    `json:"start_last_seq"`
		StartTime        string `json:"start_time"`
	} `json:"history"`
	Ok                   bool   `json:"ok"`
	ReplicationIDVersion int    `json:"replication_id_version"`
	SessionID            string `json:"session_id"`
	SourceLastSeq        int    `json:"source_last_seq"`
}

type RestartResponse

type RestartResponse struct {
	ErrorResponse
	Ok bool `json:"ok"`
}

type RevsDiffRequest

type RevsDiffRequest map[string][]string

type RevsDiffResponse

type RevsDiffResponse map[string]struct {
	ErrorResponse
	Missing           []string `json:"missing"`
	PossibleAncestors []string `json:"possible_ancestors"`
}

type SecurityRequest

type SecurityRequest struct {
	SecurityResponse
}

type SecurityResponse

type SecurityResponse struct {
	ErrorResponse
	Admins struct {
		Names []string `json:"names"`
		Roles []string `json:"roles"`
	} `json:"admins"`
	Members struct {
		Names []string `json:"names"`
		Roles []string `json:"roles"`
	} `json:"members"`
}

type SetIndexRequest

type SetIndexRequest struct {
	Index map[string]interface{} `json:"index"`
	Ddoc  string                 `json:"ddocs"`
	Name  string                 `json:"name"`
}

type SetIndexResponse

type SetIndexResponse struct {
	ErrorResponse
	Result string `json:"result"`
	ID     string `json:"id"`
	Name   string `json:"name"`
}

type StatsResponse

type StatsResponse struct {
	ErrorResponse
	Couchdb struct {
		RequestTime struct {
			Current     float64 `json:"current"`
			Description string  `json:"description"`
			Max         float64 `json:"max"`
			Mean        float64 `json:"mean"`
			Min         float64 `json:"min"`
			Stddev      float64 `json:"stddev"`
			Sum         float64 `json:"sum"`
		} `json:"request_time"`
	} `json:"couchdb"`
}

type UUIDsResponse

type UUIDsResponse struct {
	ErrorResponse
	Uuids []string `json:"uuids"`
}

type ViewRequest

type ViewRequest struct {
	QueryParams   map[string]string
	DesignDocName string
	ViewName      string
}

type ViewResponse

type ViewResponse struct {
	TotalRows int `json:"total_rows"`
	Offset    int `json:"offset"`
	Rows      []map[string]interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL