mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-20 08:16:40 +00:00
34 lines
554 B
Go
34 lines
554 B
Go
package env
|
|
|
|
func IsWhiteLabel() bool {
|
|
return APPNAME != "Filestash"
|
|
}
|
|
|
|
func WhiteLabelText(a, b string) string {
|
|
if IsWhiteLabel() {
|
|
return b
|
|
}
|
|
return a
|
|
}
|
|
|
|
type licenseOption struct {
|
|
license string
|
|
product string
|
|
}
|
|
|
|
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 }
|
|
}
|