api

package
v0.0.0-...-8517269 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MaxIdleConnsPerHost = 28000

Variables

View Source
var OperationCallback func(op string, start time.Time, err error)
View Source
var (
	StatsdClient *g2s.Statsd
)

Functions

func StartStatsdClient

func StartStatsdClient(endpoint string)

Types

type AttachmentContent

type AttachmentContent struct {
	Data string `json:"data"`
}

type BulkDocsEntry

type BulkDocsEntry struct {
	ID  string `json:"id"`
	Rev string `json:"rev"`
}

type Change

type Change struct {
	Seq     interface{}
	ID      string
	Changes []ChangeRev
}

type ChangeRev

type ChangeRev struct {
	Rev string
}

type Checkpoint

type Checkpoint struct {
	LastSequence interface{} `json:"lastSequence"`
}

type Doc

type Doc struct {
	Id          string                       `json:"_id"`
	Rev         string                       `json:"_rev"`
	Channels    []string                     `json:"channels"`
	Data        map[string]string            `json:"data,,omitempty"`
	Revisions   map[string]interface{}       `json:"_revisions"`
	Created     time.Time                    `json:"created"`
	Attachments map[string]AttachmentContent `json:"_attachments,omitempty"`

	// this field is only used by a special sync function on SG which
	// will grant access for this doc to the (puller) user id in target_user
	TargetUser string `json:"target_user"`
}

type RestClient

type RestClient struct {
	Verbose bool
	// contains filtered or unexported fields
}

func (*RestClient) Do

func (c *RestClient) Do(req *http.Request, opName string) (mresp map[string]interface{})

func (*RestClient) DoAndIgnore

func (c *RestClient) DoAndIgnore(req *http.Request, opName string) bool

func (*RestClient) DoRaw

func (c *RestClient) DoRaw(req *http.Request, opName string) (resp *http.Response, serialNumber uint64)

func (*RestClient) Do_returns_json_array

func (c *RestClient) Do_returns_json_array(req *http.Request, opName string) (mresp []interface{})

type Session

type Session struct {
	Name string `json:"name"`
	TTL  int    `json:"ttl"`
}

type SyncGatewayClient

type SyncGatewayClient struct {
	// contains filtered or unexported fields
}

func (*SyncGatewayClient) AddCookie

func (c *SyncGatewayClient) AddCookie(cookie *http.Cookie)

func (*SyncGatewayClient) AddPassword

func (c *SyncGatewayClient) AddPassword(password string)

func (*SyncGatewayClient) AddUser

func (c *SyncGatewayClient) AddUser(name string, auth UserAuth, userType string)

func (*SyncGatewayClient) AddUsername

func (c *SyncGatewayClient) AddUsername(username string)

func (*SyncGatewayClient) CreateSession

func (c *SyncGatewayClient) CreateSession(name string, session Session) http.Cookie

func (*SyncGatewayClient) GetBulkDocs

func (c *SyncGatewayClient) GetBulkDocs(docs []BulkDocsEntry, wakeup time.Time) bool

func (*SyncGatewayClient) GetChangesFeed

func (c *SyncGatewayClient) GetChangesFeed(feedType string, since interface{}, wakeup time.Time) (<-chan *Change, *bool, *http.Response)

func (*SyncGatewayClient) GetLastSeq

func (c *SyncGatewayClient) GetLastSeq() float64

no longer used due to https://github.com/couchbase/sync_gateway/issues/1159#issuecomment-142731185

func (*SyncGatewayClient) GetSingleDoc

func (c *SyncGatewayClient) GetSingleDoc(docid string, revid string, wakeup time.Time) bool

func (*SyncGatewayClient) Init

func (c *SyncGatewayClient) Init(hostname, db string, port, adminPort int, verbose bool)

func (*SyncGatewayClient) PostBulkDocs

func (c *SyncGatewayClient) PostBulkDocs(docs map[string]interface{}) bool

func (*SyncGatewayClient) PostRevsDiff

func (c *SyncGatewayClient) PostRevsDiff(revsDiff map[string][]string)

func (*SyncGatewayClient) PutSingleDoc

func (c *SyncGatewayClient) PutSingleDoc(docid string, doc Doc) bool

func (*SyncGatewayClient) SaveCheckpoint

func (c *SyncGatewayClient) SaveCheckpoint(id string, checkpoint Checkpoint)

func (*SyncGatewayClient) Valid

func (c *SyncGatewayClient) Valid() bool

type UserAuth

type UserAuth struct {
	Name          string   `json:"name"`
	Password      string   `json:"password"`
	AdminChannels []string `json:"admin_channels"`
}

Jump to

Keyboard shortcuts

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