Documentation
¶
Index ¶
- Variables
- type ChangeOptions
- type Changes
- type ChangesResponse
- type Client
- func (c *Client) BulkDocs(ctx context.Context, stack *Stack) error
- func (c *Client) Changes(ctx context.Context, opts ChangeOptions) (*ChangesResponse, error)
- func (c *Client) Check(ctx context.Context) error
- func (c *Client) Create(ctx context.Context) error
- func (c *Client) EnsureFullCommit(ctx context.Context) error
- func (c *Client) GetDocumentComplete(ctx context.Context, docid string, diff *Diff) (*CompleteDoc, error)
- func (c *Client) GetReplicationLog(ctx context.Context, id string) (*ReplicationLog, error)
- func (c *Client) Info(ctx context.Context) (*Info, error)
- func (c *Client) RecordReplicationCheckpoint(ctx context.Context, repLog *ReplicationLog, replicationID string) error
- func (c *Client) RemoveReplicationCheckpoint(ctx context.Context, replicationID string) error
- func (c *Client) RevDiff(ctx context.Context, r RevDiffRequest) (DiffResponse, error)
- func (c *Client) SetLogger(logger logger.Logger)
- func (c *Client) UploadDocumentWithAttachments(ctx context.Context, doc *CompleteDoc) error
- type CompleteDoc
- type Diff
- type DiffResponse
- type History
- type Info
- type Remote
- type ReplicationLog
- type Results
- type RevDiffRequest
- type Sizes
- type Stack
- type Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrFailed = errors.New("operation failed") )
Functions ¶
This section is empty.
Types ¶
type ChangeOptions ¶
type ChangesResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Changes ¶
func (c *Client) Changes(ctx context.Context, opts ChangeOptions) (*ChangesResponse, error)
func (*Client) EnsureFullCommit ¶
EnsureFullCommit 2.4.2.5.4. Ensure In Commit
func (*Client) GetDocumentComplete ¶
func (c *Client) GetDocumentComplete(ctx context.Context, docid string, diff *Diff) (*CompleteDoc, error)
GetDocumentComplete 2.4.2.5.1. Fetch Changed Documents
func (*Client) GetReplicationLog ¶
func (*Client) RecordReplicationCheckpoint ¶
func (c *Client) RecordReplicationCheckpoint(ctx context.Context, repLog *ReplicationLog, replicationID string) error
RecordReplicationCheckpoint 2.4.2.5.5. Record Replication Checkpoint
func (*Client) RemoveReplicationCheckpoint ¶
func (*Client) RevDiff ¶
func (c *Client) RevDiff(ctx context.Context, r RevDiffRequest) (DiffResponse, error)
func (*Client) UploadDocumentWithAttachments ¶
func (c *Client) UploadDocumentWithAttachments(ctx context.Context, doc *CompleteDoc) error
UploadDocumentWithAttachments 2.4.2.5.3. Upload Document with Attachments
type CompleteDoc ¶
type CompleteDoc struct { ID string Data map[string]interface{} // contains filtered or unexported fields }
func NewCompleteDoc ¶
func NewCompleteDoc(docid string, resp *http.Response) (*CompleteDoc, error)
func (*CompleteDoc) Close ¶
func (d *CompleteDoc) Close() error
func (*CompleteDoc) HasChangedAttachments ¶
func (d *CompleteDoc) HasChangedAttachments() bool
func (*CompleteDoc) InlineAttachments ¶
func (d *CompleteDoc) InlineAttachments() error
InlineAttachments inline the attachments using the base64 encoding.
func (*CompleteDoc) Reader ¶
func (d *CompleteDoc) Reader() (io.ReadCloser, string, error)
Reader returns a multipart mime representation of the complete doc
func (*CompleteDoc) Size ¶
func (d *CompleteDoc) Size() int64
type Diff ¶
type Diff struct { // Missing contains missing revisions Missing []string `json:"missing"` }
type DiffResponse ¶
type History ¶
type History struct { DocWriteFailures int `json:"doc_write_failures"` // Number of failed writes DocsRead int `json:"docs_read"` // Number of read documents DocsWritten int `json:"docs_written"` // Number of written documents EndLastSeq string `json:"end_last_seq"` // Last processed Update Sequence ID EndTime Time `json:"end_time"` // Replication completion timestamp in RFC 5322 format MissingChecked int `json:"missing_checked"` // Number of checked revisions on Source MissingFound int `json:"missing_found"` // Number of missing revisions found on Target RecordedSeq string `json:"recorded_seq"` // Recorded intermediate Checkpoint. Required SessionID string `json:"session_id"` // Unique session ID. Commonly, a random UUID value is used. Required StartLastSeq string `json:"start_last_seq"` // Start update Sequence ID StartTime Time `json:"start_time"` // Replication start timestamp in RFC 5322 format }
type Info ¶
type Info struct { CommittedUpdateSeq int `json:"committed_update_seq"` CompactRunning bool `json:"compact_running"` DbName string `json:"db_name"` DiskFormatVersion int `json:"disk_format_version"` DocCount int `json:"doc_count"` DocDelCount int `json:"doc_del_count"` InstanceStartTime string `json:"instance_start_time"` PurgeSeq string `json:"purge_seq"` Sizes Sizes `json:"sizes"` UpdateSeq string `json:"update_seq"` }
type Remote ¶
func (Remote) GenerateReplicationID ¶
type ReplicationLog ¶
type ReplicationLog struct { ID string `json:"_id"` Rev string `json:"_rev,omitempty"` History []*History `json:"history"` ReplicationIDVersion int `json:"replication_id_version"` // Replication protocol version. Defines Replication ID calculation algorithm, HTTP API calls and the others routines. Required SessionID string `json:"session_id"` // Unique ID of the last session. Shortcut to the session_id field of the latest history object. Required SourceLastSeq string `json:"source_last_seq"` // Last processed Checkpoint. Shortcut to the recorded_seq field of the latest history object. Required }
type RevDiffRequest ¶
type Stack ¶
type Stack []*CompleteDoc
Click to show internal directories.
Click to hide internal directories.