chore (maitenance): cleanup whitelabeling funcs

This commit is contained in:
MickaelK
2026-09-10 16:06:03 +10:00
parent b305614ae1
commit e301fca3cc
2 changed files with 6 additions and 19 deletions
+2 -2
View File
@@ -175,9 +175,9 @@ var (
WithBase = env.WithBase
TrimBase = env.TrimBase
IsWhiteLabel = env.IsWhiteLabel
LicensedAs = env.LicensedAs
WithBrand = env.WithBrand
WhiteLabelText = env.WhiteLabelText
PROGRAM_LICENSE = env.PROGRAM_LICENSE
PROGRAM_NAME = env.PROGRAM_NAME
)
// files
+4 -17
View File
@@ -11,23 +11,10 @@ func WhiteLabelText(a, b string) string {
return a
}
type licenseOption struct {
license string
product string
func PROGRAM_LICENSE(license string) {
LICENSE = license
}
func LicensedAs(license string, opts ...func(*licenseOption)) {
cfg := licenseOption{
license: license,
product: APPNAME,
}
for _, opt := range opts {
opt(&cfg)
}
LICENSE = cfg.license
APPNAME = cfg.product
}
func WithBrand(name string) func(*licenseOption) {
return func(o *licenseOption) { o.product = name }
func PROGRAM_NAME(name string) {
APPNAME = name
}