github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/test/patch_models/config.go (about)

     1  package patch_models
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"github.com/agiledragon/gomonkey/v2"
     7  
     8  	"github.com/machinefi/w3bstream/pkg/depends/kit/sqlx"
     9  	"github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/builder"
    10  	"github.com/machinefi/w3bstream/pkg/models"
    11  )
    12  
    13  func ConfigList(patch *gomonkey.Patches, data []models.Config, err error) *gomonkey.Patches {
    14  	return patch.ApplyMethod(
    15  		reflect.TypeOf(&models.Config{}),
    16  		"List",
    17  		func(_ *models.Config, _ sqlx.DBExecutor, _ builder.SqlCondition, _ ...builder.Addition) ([]models.Config, error) {
    18  			return data, err
    19  		},
    20  	)
    21  }