mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-19 16:14:39 +00:00
chore (maitenance): cleanup whitelabeling funcs
This commit is contained in:
@@ -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
|
||||
|
||||
Vendored
+4
-17
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user