Versions in this module Expand all Collapse all v1 v1.0.1 Sep 8, 2026 v1.0.0 Sep 6, 2026 Changes in this version + const FormatVersion + const Prefix + const StatusActive + const StatusExpired + const StatusRevoked + const StatusSuspended + const Version + var ErrArtifactSignature = errors.New("licencly: artifact signature does not verify against your artifact key") + var ErrArtifactUnsigned = errors.New("licencly: artifact carries no signature") + var ErrBadSignature = errors.New("licencly: signature does not verify") + var ErrChecksumMismatch = errors.New("licencly: downloaded artifact does not match its checksum") + var ErrExpired = errors.New("licencly: license has expired") + var ErrMalformed = errors.New("licencly: license file is malformed") + var ErrNoMachineID = errors.New("licencly: no stable machine identifier found") + var ErrNotActive = errors.New("licencly: license is not active") + var ErrStale = errors.New("licencly: license is past its offline grace period") + var ErrUnknownKey = errors.New("licencly: license was signed by a key this build does not trust") + var ErrUnknownVersion = errors.New("licencly: unsupported license file version") + var ErrWrongMachine = errors.New("licencly: license was issued to a different machine") + func DefaultCachePath(productSlug string) (string, error) + func IsNetwork(err error) bool + func IsTampering(err error) bool + func MachineID(salt string) (string, error) + func MustParseKeys(keys map[string]string) map[string]ed25519.PublicKey + type APIError struct + Code string + Message string + RetryAfter time.Duration + Status int + func (e *APIError) Error() string + func (e *APIError) NotFound() bool + func (e *APIError) RateLimited() bool + func (e *APIError) SeatLimitReached() bool + type Cache interface + Clear func() error + Load func() (file string, highestSeen time.Time, err error) + Save func(file string, highestSeen time.Time) error + type Claims struct + CustomerRef string + ExpiresAt int64 + Fingerprint string + GraceSeconds int64 + IssuedAt int64 + Key string + KeyID string + LicenseUUID string + MaintenanceExpiresAt int64 + Metadata map[string]any + ProductUUID string + RevalidateAfter int64 + Seats int + Status string + Used int + Version int + func Decode(token string) (Claims, error) + func Verify(token string, pub ed25519.PublicKey) (Claims, error) + func VerifyWithKeys(token string, keys map[string]ed25519.PublicKey) (Claims, error) + func (c Claims) Check(now time.Time, fingerprint string) error + func (c Claims) ExpiresAtTime() time.Time + func (c Claims) MaintenanceActive(now time.Time) bool + func (c Claims) NeedsRevalidation(now time.Time) bool + type Client struct + func New(cfg Config) (*Client, error) + func (c *Client) CheckForUpdate(ctx context.Context, licenseKey string, q UpdateQuery) (UpdateResult, error) + func (c *Client) ClearCache() error + func (c *Client) Deactivate(ctx context.Context, licenseKey string) error + func (c *Client) DownloadArtifact(ctx context.Context, licenseKey string, release *Release, destDir string, ...) (string, error) + func (c *Client) Validate(ctx context.Context, licenseKey string) (Decision, error) + type Config struct + AppVersion string + BaseURL string + Cache Cache + DownloadTimeout time.Duration + Fingerprint string + HTTPClient *http.Client + Hostname string + Now func() time.Time + Platform string + ProductUUID string + PublicKeys map[string]ed25519.PublicKey + Retries int + Timeout time.Duration + type Decision struct + Claims Claims + Err error + FromCache bool + NeedsRevalidation bool + Outcome Outcome + func (d Decision) MaintenanceActive(now time.Time) bool + func (d Decision) OK() bool + type FileCache struct + Path string + func (c *FileCache) Clear() error + func (c *FileCache) Load() (string, time.Time, error) + func (c *FileCache) Save(file string, highestSeen time.Time) error + type MemoryCache struct + func (c *MemoryCache) Clear() error + func (c *MemoryCache) Load() (string, time.Time, error) + func (c *MemoryCache) Save(file string, highestSeen time.Time) error + type NetworkError struct + Err error + func (e *NetworkError) Error() string + func (e *NetworkError) Unwrap() error + type Outcome string + const OutcomeExpired + const OutcomeInvalid + const OutcomeNotActive + const OutcomeStale + const OutcomeValid + const OutcomeWrongMachine + type Release struct + Arch string + ArtifactFilename string + ArtifactSHA256 string + ArtifactSize int64 + Channel string + MinUpgradeFrom string + Notes string + Platform string + Signed bool + UUID string + Version string + type UpdateOutcome string + const MaintenanceLapsed + const NotEntitled + const UpToDate + const UpdateAvailable + const UpgradeBlocked + type UpdateQuery struct + Arch string + Channel string + CurrentVersion string + Platform string + type UpdateResult struct + DownloadURL string + Latest *Release + Outcome UpdateOutcome + Release *Release + func (r UpdateResult) Available() bool + func (r UpdateResult) RenewalWouldUnlock() bool