Documentation ¶
Index ¶
- Constants
- func ClearTestDatabase(ctx context.Context, db *database.Database)
- func MatchGroupBase(addFields ...gstruct.Fields) types.GomegaMatcher
- func MatchGroupBasePtr(addFields ...gstruct.Fields) types.GomegaMatcher
- func MatchGroupBasePtrVisTokenCounts(counts VisTokenCounts, rawDescCounts VisTokenCounts) types.GomegaMatcher
- func MatchVisibilityTokens(rawTokens ...string) types.GomegaMatcher
- func NewTestDb() *mongo.Database
- type VisTokenCounts
Constants ¶
const DatabaseName = "lookoutpoint-test"
DatabaseName of the test database
const MongoDBURI = "mongodb://localhost:27017/?retryWrites=false"
MongoDBURI assumes we're running mongod locally
Variables ¶
This section is empty.
Functions ¶
func ClearTestDatabase ¶
ClearTestDatabase clears the provided database
func MatchGroupBase ¶
func MatchGroupBase(addFields ...gstruct.Fields) types.GomegaMatcher
MatchGroupBase is a helper function to create a matcher to match a struct with an embedded docs.GroupBase member. Also supports other sub-fields with format <Field>.<SubField>.
func MatchGroupBasePtr ¶
func MatchGroupBasePtr(addFields ...gstruct.Fields) types.GomegaMatcher
MatchGroupBasePtr is the same as MatchGroupbase except that it matches gainst a pointer to a struct
func MatchGroupBasePtrVisTokenCounts ¶ added in v1.0.0
func MatchGroupBasePtrVisTokenCounts(counts VisTokenCounts, rawDescCounts VisTokenCounts) types.GomegaMatcher
MatchGroupBasePtrVisTokenCounts checks visibility tokens and visibility token counts based on the provided self photo counts and descendant photo counts.
func MatchVisibilityTokens ¶
func MatchVisibilityTokens(rawTokens ...string) types.GomegaMatcher
MatchVisibilityTokens creates a matcher against a VisibilityTokens field in a pointer to a struct. The visibility tokens field is assumed to be a slice and the tokens are matched as a set (i.e. order does not matter). Automatically adds a VisTokenAll.
Types ¶
type VisTokenCounts ¶ added in v1.0.0
VisTokenCounts is a map of visibility token values to visibility token counts. Use with MatchGroupBasePtrVisTokenCounts.