Skip to content

Commit

Permalink
Add String() for License status
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-vanyasin committed Dec 8, 2023
1 parent 2563a7d commit 0e3ced7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package license

import (
"context"
"strconv"
)

type Status int
Expand Down Expand Up @@ -67,6 +68,28 @@ func (s Status) Valid() bool {
func (s Status) Validate(feature Feature, subFeatures ...Feature) Status {
return s
}
func (s Status) String() string {
switch s {
case StatusMissing:
return "Missing"
case StatusInvalid:
return "Invalid"
case StatusInvalidSignature:
return "InvalidSignature"
case StatusNotYetValid:
return "NotYetValid"
case StatusNotAnymoreValid:
return "NotAnymoreValid"
case StatusFeatureNotEnabled:
return "FeatureNotEnabled"
case StatusFeatureExpired:
return "FeatureExpired"
case StatusValid:
return "Valid"
default:
return strconv.Itoa(int(s))
}
}

type Feature string

Expand Down

0 comments on commit 0e3ced7

Please sign in to comment.