personal license added
This commit is contained in:
parent
bc51750141
commit
60b325eabf
|
@ -26,8 +26,10 @@ func NewStatusLine(configFileName string, palette console.Palette, license *meta
|
|||
block.Border = false
|
||||
text := fmt.Sprintf(" %s %s | ", console.AppTitle, console.AppVersion)
|
||||
|
||||
if license == nil || !license.Valid {
|
||||
if license == nil || !license.Valid || license.Type == nil {
|
||||
text += console.AppLicenseWarning
|
||||
} else if *license.Type == metadata.TypePersonal {
|
||||
text += fmt.Sprintf("%s | personal license: %s", configFileName, *license.Username)
|
||||
} else if license.Username != nil {
|
||||
text += fmt.Sprintf("%s | licensed to %s", configFileName, *license.Username)
|
||||
if license.Company != nil {
|
||||
|
|
|
@ -6,12 +6,20 @@ import (
|
|||
)
|
||||
|
||||
type License struct {
|
||||
Key *string `yaml:"k"`
|
||||
Username *string `yaml:"u"`
|
||||
Company *string `yaml:"c"`
|
||||
Valid bool `yaml:"v"`
|
||||
Key *string `yaml:"k"`
|
||||
Username *string `yaml:"u"`
|
||||
Company *string `yaml:"c"`
|
||||
Type *LicenseType `yaml:"t"`
|
||||
Valid bool `yaml:"v"`
|
||||
}
|
||||
|
||||
type LicenseType rune
|
||||
|
||||
const (
|
||||
TypePersonal LicenseType = 0
|
||||
TypeCommercial LicenseType = 1
|
||||
)
|
||||
|
||||
const licenseFileName = "license.yml"
|
||||
|
||||
func GetLicense() *License {
|
||||
|
|
Loading…
Reference in New Issue