Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains(s interface{}, elem interface{}) bool
Contains finds if item exists in an array
func JSONMarshal ¶
JSONMarshal marshals JSON without escaping: needed for keeping unescaped html tags
Types ¶
type Client ¶
type Client interface { Use(string) (Database, error) UseOrCreate(string) (Database, error) Destroy(string) error }
Client .
func NewClient ¶
func NewClient(username, password, rootStrURL string, options ...cloudant.ClientOption) (Client, error)
NewClient returns a new client (with max. retry 3 using a random 5-30 secs delay).
func NewMockClient ¶
func NewMockClient(content CloudantContent) (Client, error)
NewMockClient mocks the creation of a new Cloudant instance
type CloudantContent ¶
type CloudantContent struct { Info cloudant.Info Databases map[string]DatabaseContent }
CloudantContent holds content for mock Cloudant instance
type Database ¶
type Database interface { Get(string, *cloudant.DocQuery, interface{}) error Insert(interface{}) (*cloudant.DocumentMeta, error) Destroy(string, string) error ViewRaw(string, string, *cloudant.ViewQuery) ([]byte, error) }
Database .
type DatabaseContent ¶
type DatabaseContent struct { Docs map[string][]byte Views map[string][]string // map design URL, e.g. /_design/search~view/_view/versions?descending=true&include_docs=true&key=PLAN-abcd&limit=1 to list of doc IDs from docs }
DatabaseContent holds mock content for mock database
Click to show internal directories.
Click to hide internal directories.