Skip to content
Snippets Groups Projects
Select Git revision
  • ce608c1874607dbd349c3b8d528a4294708dcad9
  • master default protected
  • fix/PRXS-3401-ValidateValidationOpts
  • feature/PRXS-3383-CollectionsRankSortAPI
  • feature/3149-LocaleCodeAsID-Feature
  • feature/PRXS-3383-CollectionsSort
  • feature/3109-SerializeFeature
  • release/0.33
  • feature/3109-RecoverySchema
  • feature/3109-feature
  • fix/PRXS-3369-ValidateFields
  • refactor/PRXS-3306-MovePkgGroup1
  • refactor/6-pkg-refactor-expr
  • fix/PRXS-3360-TemplateBuilderPatch
  • feature/3293-MongoV2
  • feature/3272-GoVersionUp
  • feature/PRXS-3218-HideTemplateActions
  • feature/PRXS-3234-PruneIdents
  • feature/3146-UpdateItemStorageInterface
  • feature/3274-ObjectIndexesFixes
  • feature/PRXS-3143-3235-ReferenceOptions
  • v0.33.1
  • v0.32.0
  • v0.31.1
  • v0.31.0
  • v0.30.0
  • v0.29.0
  • v0.28.0
  • v0.27.0-alpha.1+16
  • v0.27.0-alpha.1+15
  • v0.27.0-alpha.1+14
  • v0.27.0-alpha.1+13
  • v0.27.0-alpha.1+12
  • v0.27.0-alpha.1+11
  • v0.27.0-alpha.1+10
  • v0.27.0-alpha.1+9
  • v0.27.0-alpha.1+8
  • v0.27.0-alpha.1+7
  • v0.27.0-alpha.1+6
  • v0.27.0-alpha.1+5
  • v0.27.0-alpha.1+4
41 results

dummy.go

Blame
  • user avatar
    Danis Kirasirov authored
    ce608c18
    History
    dummy.go 663 B
    package items
    
    import (
    	"context"
    )
    
    type FindResultDummy struct {
    	Items []*Item
    	Total int
    	Error error
    }
    type Dummy struct {
    	Items
    	FindResult *FindResultDummy
    }
    
    func (d *Dummy) Find(_ context.Context, _, _, _ string, _ *Filter, _ ...*FindOptions) ([]*Item, int, error) {
    	return d.FindResult.Items, d.FindResult.Total, d.FindResult.Error
    }
    
    type DummyWithOptions struct {
    	Items
    	Total int
    }
    
    func (d *DummyWithOptions) Find(_ context.Context, _, _, _ string, _ *Filter, opts ...*FindOptions) ([]*Item, int, error) {
    	fo := MergeFindOptions(opts...)
    	limit := fo.Limit
    	if limit == 0 {
    		limit = fo.PageSize
    	}
    	return make([]*Item, limit), d.Total, nil
    }