xkivik

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

README

Codecov GoDoc

xKivik

Package xKivik provides experimental features that may be considered for inclusion in the proper kivik package over time.

Compatibility

There is no backward compatibility guarantee for anything in this package.

License

This software is released under the terms of the Apache 2.0 license. See LICENCE.md, or read the full license.

Documentation

Overview

Package xkivik provides experimental features for Kivik.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	ID          string                 `json:"_id"`
	Rev         string                 `json:"_rev"`
	Attachments *kivik.Attachments     `json:"_attachments,omitempty"`
	Data        map[string]interface{} `json:"-"`
}

Document represents any CouchDB document.

func (*Document) MarshalJSON

func (d *Document) MarshalJSON() ([]byte, error)

MarshalJSON satisfies the json.Marshaler interface

func (*Document) UnmarshalJSON

func (d *Document) UnmarshalJSON(p []byte) error

UnmarshalJSON satisfies the json.Unmarshaler interface.

type ReplicationResult

type ReplicationResult struct {
	DocWriteFailures int       `json:"doc_write_failures"`
	DocsRead         int       `json:"docs_read"`
	DocsWritten      int       `json:"docs_written"`
	EndTime          time.Time `json:"end_time"`
	MissingChecked   int       `json:"missing_checked"`
	MissingFound     int       `json:"missing_found"`
	StartTime        time.Time `json:"start_time"`
}

ReplicationResult represents the result of a replication.

func Replicate

func Replicate(ctx context.Context, target, source *kivik.DB, options ...kivik.Options) (*ReplicationResult, error)

Replicate performs a replication from source to target, using a limited version of the CouchDB replication protocol.

The following options are supported:

filter (string) - The name of a filter function.
doc_ids (array of string) - Array of document IDs to be synchronized.
copy_security (bool) - When true, the security object is read from the
                       source, and copied to the target, before the
                       replication. Use with caution! The security object
                       is not versioned, and will be unconditionally
                       overwritten!

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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