collection

package
v0.0.0-...-b93a6bd Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package collection contains functions and assertions for interacting with collections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDByName

func IDByName(t cbtest.T, provider provider.ConfigAndClient, collectionName string) string

IDByName gets a collection ID from a given name. Panics on failure.

func IDByNameE

func IDByNameE(t cbtest.T, provider provider.ConfigAndClient, collectionName string) (string, error)

IDByNameE gets a collection ID from a given name. Returns error on failure.

func Total

func Total(t cbtest.T, provider provider.ConfigAndClient, collectionID string) int

Total returns the total number of rows in the collection. Panics on failure.

func TotalE

func TotalE(t cbtest.T, provider provider.ConfigAndClient, collectionID string) (int, error)

TotalE returns the total number of rows in the collection. Returns error on failure.

Types

type DataResponse

type DataResponse struct {
	Page        int                      `json:"CURRENTPAGE" mapstructure:"CURRENTPAGE"`
	PrevPageURL string                   `json:"PREVPAGEURL" mapstructure:"PREVPAGEURL"`
	NextPageURL string                   `json:"NEXTPAGEURL" mapstructure:"NEXTPAGEURL"`
	Items       []map[string]interface{} `json:"DATA" mapstructure:"DATA"`
	TotalItems  int                      `json:"TOTAL" mapstructure:"TOTAL"`
}

DataResponse represents a response from a collection get data call.

func GetData

func GetData(t cbtest.T, provider provider.ConfigAndClient, collectionID string, query *cb.Query) *DataResponse

GetData wraps around ClearBlade Go SDK GetData and provides the response as a structure. Panics on failure.

func GetDataE

func GetDataE(t cbtest.T, provider provider.ConfigAndClient, collectionID string, query *cb.Query) (*DataResponse, error)

GetDataE wraps around ClearBlade Go SDK GetData and provides the response as a structure. Returns error on failure.

type Matcher

type Matcher matcher.Matcher

Matcher is an alias to matcher.Matcher.

func HaveTotal

func HaveTotal(count int) Matcher

HaveTotal checks whenever the actual value contains a count field with the expected count.

Jump to

Keyboard shortcuts

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