refactor: move uixt pkg

This commit is contained in:
lilong.129
2025-03-05 11:04:02 +08:00
parent 9e064ee0ad
commit e107389d6e
122 changed files with 146 additions and 142 deletions
+42
View File
@@ -0,0 +1,42 @@
package option
type InstallOptions struct {
Reinstall bool
GrantPermission bool
Downgrade bool
RetryTimes int
}
type InstallOption func(o *InstallOptions)
func NewInstallOptions(opts ...InstallOption) *InstallOptions {
installOptions := &InstallOptions{}
for _, option := range opts {
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 WithRetryTimes(retryTimes int) InstallOption {
return func(o *InstallOptions) {
o.RetryTimes = retryTimes
}
}