querytest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package querytest provides test helpers for query options

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptMatcherFunc

func OptMatcherFunc(want ...query.Option) func([]query.Option) bool

OptMatcherFunc returns a matcher function that validates if the got query options produce the same Query state as the want options.

Types

type Cursor

type Cursor struct {
	mock.Mock
}

Cursor is an autogenerated mock type for the Cursor type

func NewCursor

func NewCursor(t interface {
	mock.TestingT
	Cleanup(func())
}) *Cursor

NewCursor creates a new instance of Cursor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Cursor) CreatedAt

func (_mock *Cursor) CreatedAt() time.Time

CreatedAt provides a mock function for the type Cursor

func (*Cursor) EXPECT

func (_m *Cursor) EXPECT() *Cursor_Expecter

func (*Cursor) Limit

func (_mock *Cursor) Limit() int

Limit provides a mock function for the type Cursor

func (*Cursor) UUID

func (_mock *Cursor) UUID() string

UUID provides a mock function for the type Cursor

type Cursor_CreatedAt_Call

type Cursor_CreatedAt_Call struct {
	*mock.Call
}

Cursor_CreatedAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatedAt'

func (*Cursor_CreatedAt_Call) Return

func (*Cursor_CreatedAt_Call) Run

func (_c *Cursor_CreatedAt_Call) Run(run func()) *Cursor_CreatedAt_Call

func (*Cursor_CreatedAt_Call) RunAndReturn

func (_c *Cursor_CreatedAt_Call) RunAndReturn(run func() time.Time) *Cursor_CreatedAt_Call

type Cursor_Expecter

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

func (*Cursor_Expecter) CreatedAt

func (_e *Cursor_Expecter) CreatedAt() *Cursor_CreatedAt_Call

CreatedAt is a helper method to define mock.On call

func (*Cursor_Expecter) Limit

func (_e *Cursor_Expecter) Limit() *Cursor_Limit_Call

Limit is a helper method to define mock.On call

func (*Cursor_Expecter) UUID

func (_e *Cursor_Expecter) UUID() *Cursor_UUID_Call

UUID is a helper method to define mock.On call

type Cursor_Limit_Call

type Cursor_Limit_Call struct {
	*mock.Call
}

Cursor_Limit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Limit'

func (*Cursor_Limit_Call) Return

func (_c *Cursor_Limit_Call) Return(n int) *Cursor_Limit_Call

func (*Cursor_Limit_Call) Run

func (_c *Cursor_Limit_Call) Run(run func()) *Cursor_Limit_Call

func (*Cursor_Limit_Call) RunAndReturn

func (_c *Cursor_Limit_Call) RunAndReturn(run func() int) *Cursor_Limit_Call

type Cursor_UUID_Call

type Cursor_UUID_Call struct {
	*mock.Call
}

Cursor_UUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UUID'

func (*Cursor_UUID_Call) Return

func (_c *Cursor_UUID_Call) Return(s string) *Cursor_UUID_Call

func (*Cursor_UUID_Call) Run

func (_c *Cursor_UUID_Call) Run(run func()) *Cursor_UUID_Call

func (*Cursor_UUID_Call) RunAndReturn

func (_c *Cursor_UUID_Call) RunAndReturn(run func() string) *Cursor_UUID_Call

type Query

type Query struct {
	mock.Mock
}

Query is an autogenerated mock type for the Query type

func NewQuery

func NewQuery(t interface {
	mock.TestingT
	Cleanup(func())
}) *Query

NewQuery creates a new instance of Query. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Query) Aggregations added in v0.3.0

func (_mock *Query) Aggregations() []query.Aggregation

Aggregations provides a mock function for the type Query

func (*Query) Bucket added in v0.3.0

func (_mock *Query) Bucket() time.Duration

Bucket provides a mock function for the type Query

func (*Query) EXPECT

func (_m *Query) EXPECT() *Query_Expecter

func (*Query) Equal

func (_mock *Query) Equal(another query.Query) bool

Equal provides a mock function for the type Query

func (*Query) Fields added in v0.3.0

func (_mock *Query) Fields() query.SparseFieldsets

Fields provides a mock function for the type Query

func (*Query) Filters

func (_mock *Query) Filters() query.Filters[any]

Filters provides a mock function for the type Query

func (*Query) Group added in v0.3.0

func (_mock *Query) Group() []string

Group provides a mock function for the type Query

func (*Query) IncludedResourceObjects

func (_mock *Query) IncludedResourceObjects() []string

IncludedResourceObjects provides a mock function for the type Query

func (*Query) Merge

func (_mock *Query) Merge(q query.Query)

Merge provides a mock function for the type Query

func (*Query) OrGroups added in v0.3.0

func (_mock *Query) OrGroups() []query.Filters[any]

OrGroups provides a mock function for the type Query

func (*Query) Pagination

func (_mock *Query) Pagination() *query.PaginationParams

Pagination provides a mock function for the type Query

func (*Query) Sorting

func (_mock *Query) Sorting() *query.SortingParams

Sorting provides a mock function for the type Query

type Query_Aggregations_Call added in v0.3.0

type Query_Aggregations_Call struct {
	*mock.Call
}

Query_Aggregations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Aggregations'

func (*Query_Aggregations_Call) Return added in v0.3.0

func (*Query_Aggregations_Call) Run added in v0.3.0

func (_c *Query_Aggregations_Call) Run(run func()) *Query_Aggregations_Call

func (*Query_Aggregations_Call) RunAndReturn added in v0.3.0

func (_c *Query_Aggregations_Call) RunAndReturn(run func() []query.Aggregation) *Query_Aggregations_Call

type Query_Bucket_Call added in v0.3.0

type Query_Bucket_Call struct {
	*mock.Call
}

Query_Bucket_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bucket'

func (*Query_Bucket_Call) Return added in v0.3.0

func (_c *Query_Bucket_Call) Return(duration time.Duration) *Query_Bucket_Call

func (*Query_Bucket_Call) Run added in v0.3.0

func (_c *Query_Bucket_Call) Run(run func()) *Query_Bucket_Call

func (*Query_Bucket_Call) RunAndReturn added in v0.3.0

func (_c *Query_Bucket_Call) RunAndReturn(run func() time.Duration) *Query_Bucket_Call

type Query_Equal_Call

type Query_Equal_Call struct {
	*mock.Call
}

Query_Equal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Equal'

func (*Query_Equal_Call) Return

func (_c *Query_Equal_Call) Return(b bool) *Query_Equal_Call

func (*Query_Equal_Call) Run

func (_c *Query_Equal_Call) Run(run func(another query.Query)) *Query_Equal_Call

func (*Query_Equal_Call) RunAndReturn

func (_c *Query_Equal_Call) RunAndReturn(run func(another query.Query) bool) *Query_Equal_Call

type Query_Expecter

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

func (*Query_Expecter) Aggregations added in v0.3.0

func (_e *Query_Expecter) Aggregations() *Query_Aggregations_Call

Aggregations is a helper method to define mock.On call

func (*Query_Expecter) Bucket added in v0.3.0

func (_e *Query_Expecter) Bucket() *Query_Bucket_Call

Bucket is a helper method to define mock.On call

func (*Query_Expecter) Equal

func (_e *Query_Expecter) Equal(another interface{}) *Query_Equal_Call

Equal is a helper method to define mock.On call

  • another query.Query

func (*Query_Expecter) Fields added in v0.3.0

func (_e *Query_Expecter) Fields() *Query_Fields_Call

Fields is a helper method to define mock.On call

func (*Query_Expecter) Filters

func (_e *Query_Expecter) Filters() *Query_Filters_Call

Filters is a helper method to define mock.On call

func (*Query_Expecter) Group added in v0.3.0

func (_e *Query_Expecter) Group() *Query_Group_Call

Group is a helper method to define mock.On call

func (*Query_Expecter) IncludedResourceObjects

func (_e *Query_Expecter) IncludedResourceObjects() *Query_IncludedResourceObjects_Call

IncludedResourceObjects is a helper method to define mock.On call

func (*Query_Expecter) Merge

func (_e *Query_Expecter) Merge(q interface{}) *Query_Merge_Call

Merge is a helper method to define mock.On call

  • q query.Query

func (*Query_Expecter) OrGroups added in v0.3.0

func (_e *Query_Expecter) OrGroups() *Query_OrGroups_Call

OrGroups is a helper method to define mock.On call

func (*Query_Expecter) Pagination

func (_e *Query_Expecter) Pagination() *Query_Pagination_Call

Pagination is a helper method to define mock.On call

func (*Query_Expecter) Sorting

func (_e *Query_Expecter) Sorting() *Query_Sorting_Call

Sorting is a helper method to define mock.On call

type Query_Fields_Call added in v0.3.0

type Query_Fields_Call struct {
	*mock.Call
}

Query_Fields_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fields'

func (*Query_Fields_Call) Return added in v0.3.0

func (_c *Query_Fields_Call) Return(sparseFieldsets query.SparseFieldsets) *Query_Fields_Call

func (*Query_Fields_Call) Run added in v0.3.0

func (_c *Query_Fields_Call) Run(run func()) *Query_Fields_Call

func (*Query_Fields_Call) RunAndReturn added in v0.3.0

func (_c *Query_Fields_Call) RunAndReturn(run func() query.SparseFieldsets) *Query_Fields_Call

type Query_Filters_Call

type Query_Filters_Call struct {
	*mock.Call
}

Query_Filters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Filters'

func (*Query_Filters_Call) Return

func (_c *Query_Filters_Call) Return(filters query.Filters[any]) *Query_Filters_Call

func (*Query_Filters_Call) Run

func (_c *Query_Filters_Call) Run(run func()) *Query_Filters_Call

func (*Query_Filters_Call) RunAndReturn

func (_c *Query_Filters_Call) RunAndReturn(run func() query.Filters[any]) *Query_Filters_Call

type Query_Group_Call added in v0.3.0

type Query_Group_Call struct {
	*mock.Call
}

Query_Group_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Group'

func (*Query_Group_Call) Return added in v0.3.0

func (_c *Query_Group_Call) Return(strings []string) *Query_Group_Call

func (*Query_Group_Call) Run added in v0.3.0

func (_c *Query_Group_Call) Run(run func()) *Query_Group_Call

func (*Query_Group_Call) RunAndReturn added in v0.3.0

func (_c *Query_Group_Call) RunAndReturn(run func() []string) *Query_Group_Call

type Query_IncludedResourceObjects_Call

type Query_IncludedResourceObjects_Call struct {
	*mock.Call
}

Query_IncludedResourceObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncludedResourceObjects'

func (*Query_IncludedResourceObjects_Call) Return

func (*Query_IncludedResourceObjects_Call) Run

func (*Query_IncludedResourceObjects_Call) RunAndReturn

type Query_Merge_Call

type Query_Merge_Call struct {
	*mock.Call
}

Query_Merge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Merge'

func (*Query_Merge_Call) Return

func (_c *Query_Merge_Call) Return() *Query_Merge_Call

func (*Query_Merge_Call) Run

func (_c *Query_Merge_Call) Run(run func(q query.Query)) *Query_Merge_Call

func (*Query_Merge_Call) RunAndReturn

func (_c *Query_Merge_Call) RunAndReturn(run func(q query.Query)) *Query_Merge_Call

type Query_OrGroups_Call added in v0.3.0

type Query_OrGroups_Call struct {
	*mock.Call
}

Query_OrGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrGroups'

func (*Query_OrGroups_Call) Return added in v0.3.0

func (_c *Query_OrGroups_Call) Return(filterss []query.Filters[any]) *Query_OrGroups_Call

func (*Query_OrGroups_Call) Run added in v0.3.0

func (_c *Query_OrGroups_Call) Run(run func()) *Query_OrGroups_Call

func (*Query_OrGroups_Call) RunAndReturn added in v0.3.0

func (_c *Query_OrGroups_Call) RunAndReturn(run func() []query.Filters[any]) *Query_OrGroups_Call

type Query_Pagination_Call

type Query_Pagination_Call struct {
	*mock.Call
}

Query_Pagination_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pagination'

func (*Query_Pagination_Call) Return

func (_c *Query_Pagination_Call) Return(paginationParams *query.PaginationParams) *Query_Pagination_Call

func (*Query_Pagination_Call) Run

func (_c *Query_Pagination_Call) Run(run func()) *Query_Pagination_Call

func (*Query_Pagination_Call) RunAndReturn

func (_c *Query_Pagination_Call) RunAndReturn(run func() *query.PaginationParams) *Query_Pagination_Call

type Query_Sorting_Call

type Query_Sorting_Call struct {
	*mock.Call
}

Query_Sorting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sorting'

func (*Query_Sorting_Call) Return

func (_c *Query_Sorting_Call) Return(sortingParams *query.SortingParams) *Query_Sorting_Call

func (*Query_Sorting_Call) Run

func (_c *Query_Sorting_Call) Run(run func()) *Query_Sorting_Call

func (*Query_Sorting_Call) RunAndReturn

func (_c *Query_Sorting_Call) RunAndReturn(run func() *query.SortingParams) *Query_Sorting_Call

Jump to

Keyboard shortcuts

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