mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-18 14:17:34 +08:00
49 lines
997 B
Go
49 lines
997 B
Go
package uixt
|
|
|
|
type InstallOptions struct {
|
|
Reinstall bool
|
|
GrantPermission bool
|
|
Downgrade bool
|
|
RetryTime int
|
|
}
|
|
|
|
type InstallOption func(o *InstallOptions)
|
|
|
|
func NewInstallOptions(options ...InstallOption) *InstallOptions {
|
|
installOptions := &InstallOptions{}
|
|
for _, option := range options {
|
|
option(installOptions)
|
|
}
|
|
return installOptions
|
|
}
|
|
|
|
func WithReinstall(reinstall bool) InstallOption {
|
|
return func(o *InstallOptions) {
|
|
o.Reinstall = reinstall
|
|
}
|
|
}
|
|
|
|
func WithGrantPermission(grantPermission bool) InstallOption {
|
|
return func(o *InstallOptions) {
|
|
o.GrantPermission = grantPermission
|
|
}
|
|
}
|
|
|
|
func WithDowngrade(downgrade bool) InstallOption {
|
|
return func(o *InstallOptions) {
|
|
o.Downgrade = downgrade
|
|
}
|
|
}
|
|
|
|
func WithRetryTime(retryTime int) InstallOption {
|
|
return func(o *InstallOptions) {
|
|
o.RetryTime = retryTime
|
|
}
|
|
}
|
|
|
|
type InstallResult struct {
|
|
Result int `json:"result"`
|
|
ErrorCode int `json:"errorCode"`
|
|
ErrorMsg string `json:"errorMsg"`
|
|
}
|