scenario

package
v1.1.48 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMongoActive

func CheckMongoActive(t *testing.T)

func CreateSdk added in v1.0.1

func CreateSdk() *v2_gots_sdk.ApiSdk

func GetBaseTestAsset

func GetBaseTestAsset(elem ...string) string

func GetDatabase added in v1.1.5

func GetDatabase() *gorm.DB

func GetDb

func GetDb() *gorm.DB

TODO: bakalan deprecated soale ada test scenario

func GetMongoDatabase added in v1.1.5

func GetMongoDatabase(t *testing.T) *mongo.Database

func GetTokopediaApiClient

func GetTokopediaApiClient() (*api.TokopediaApi, func())

func NewMongoDatabase added in v1.0.2

func NewMongoDatabase(ctx context.Context, dburi string, dbname string) *mongo.Database

func RunWebSdk added in v1.0.1

func RunWebSdk(t *testing.T, handler RunHandler)

Types

type ConfigTest

type ConfigTest struct {
	MongoUri string `json:"mongo_uri"`
}
var CfgTest *ConfigTest

func CheckConfig

func CheckConfig(t *testing.T) *ConfigTest

func (*ConfigTest) GetHostPort

func (cfg *ConfigTest) GetHostPort() (string, string)

type FilterTextHandler added in v1.1.10

type FilterTextHandler func(cfg *legacy_source.FilterText)

type FilterTextModifier added in v1.1.10

type FilterTextModifier func(cfg *legacy_source.FilterText) error

type GrabBasicHandler added in v1.1.10

type GrabBasicHandler func(cfg *legacy.GrabBasic)

type GrabBasicModifier added in v1.1.10

type GrabBasicModifier func(cfg *legacy.GrabBasic) error

type GrabTokopediaHandler added in v1.1.10

type GrabTokopediaHandler func(cfg *legacy.GrabTokopedia)

type GrabTokopediaModifier added in v1.1.10

type GrabTokopediaModifier func(cfg *legacy.GrabTokopedia) error

type MarkupConfigHandler added in v1.1.10

type MarkupConfigHandler func(cfg *legacy.LegacyMarkupConfig)

type MarkupConfigModifier added in v1.1.10

type MarkupConfigModifier func(cfg *legacy.LegacyMarkupConfig) error

type RunHandler added in v1.0.1

type RunHandler func(sdk *v2_gots_sdk.ApiSdk, sendApi SendRequest) error

type Scenario added in v1.0.2

type Scenario struct {
	Base string
	// contains filtered or unexported fields
}

func NewScenario added in v1.0.2

func NewScenario(t *testing.T) *Scenario

func (*Scenario) CreateFile added in v1.1.10

func (scen *Scenario) CreateFile(data []byte, fname string) func()

func (*Scenario) Path added in v1.1.2

func (scen *Scenario) Path(data ...string) string

func (*Scenario) WithBase added in v1.0.2

func (scen *Scenario) WithBase(handler func(dirbase string, scen *Scenario))

func (*Scenario) WithBaseConfig added in v1.1.10

func (scen *Scenario) WithBaseConfig(handler func(base *legacy_source.BaseConfig))

func (*Scenario) WithCopySqliteDatabase added in v1.0.2

func (scen *Scenario) WithCopySqliteDatabase(handler func(db *gorm.DB))

func (*Scenario) WithFilterText added in v1.1.10

func (scen *Scenario) WithFilterText(modifier FilterTextModifier, handler FilterTextHandler)

func (*Scenario) WithGrabBasic added in v1.1.10

func (scen *Scenario) WithGrabBasic(modifier GrabBasicModifier, handler GrabBasicHandler)

func (*Scenario) WithGrabTokopedia added in v1.1.10

func (scen *Scenario) WithGrabTokopedia(modifier GrabTokopediaModifier, handler GrabTokopediaHandler)

func (*Scenario) WithMarkupConfig added in v1.1.10

func (scen *Scenario) WithMarkupConfig(modifier MarkupConfigModifier, handler MarkupConfigHandler)

func (*Scenario) WithMongoDatabase added in v1.0.2

func (scen *Scenario) WithMongoDatabase(cfg *config.UploadBaseConfig, handler func(mongodb *mongo.Database))

func (*Scenario) WithSqliteDatabase added in v1.0.2

func (scen *Scenario) WithSqliteDatabase(handler func(db *gorm.DB))

func (*Scenario) WithUploadConfig added in v1.0.2

func (scen *Scenario) WithUploadConfig(cfgmodifier func(cfg *config.UploadBaseConfig) error, handler func(cfg *config.UploadBaseConfig))

type SendRequest added in v1.0.1

type SendRequest func(req *pdc_api.Api) *httptest.ResponseRecorder

Jump to

Keyboard shortcuts

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