Help us shape the future of Go! Take the 2026 Go Developer Survey

license

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 15 Imported by: 0

README

license

Travis Status Maintainability Code Coverage Go Report Card Go Doc

The License framework is currently under heavy development.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLicense

func CreateLicense(template *License, key crypto.Signer) ([]byte, error)

CreateLicense godoc.

Types

type Customer

type Customer struct {
	Name               string
	Country            string
	City               string
	Organization       string
	OrganizationalUnit string
}

Customer godoc

type Feature

type Feature struct {
	Oid         asn1.ObjectIdentifier `json:"-"`
	Description string                `json:"description"`
	Expire      int64                 `json:"expire,omitempty"`
	Limit       int64                 `json:"limit"`
}

Feature godoc

type License

type License struct {
	ProductName  string    `json:"product"`
	SerialNumber string    `json:"serial"`
	Customer     Customer  `json:"customer"`
	ValidFrom    time.Time `json:"valid_from,omitempty"`
	ValidUntil   time.Time `json:"valid_until,omitempty"`
	MinVersion   Version   `json:"min_version,omitempty"`
	MaxVersion   Version   `json:"max_version,omitempty"`
	Features     []Feature `json:"features"`
}

License godoc

func Load

func Load(asn1Data []byte, publicKey interface{}, validator ValidateSN) (*License, error)

Load Load license from asn encoded file.

type ValidateSN

type ValidateSN func(product, serial string, validFrom, validUntil, minVersion, maxVersion int64) error

ValidateSN godoc

type Version added in v0.1.1

type Version int64

Version lazy semver implementation

func NewVersion added in v0.1.1

func NewVersion(v string) (Version, error)

NewVersion semantic version to integer valid format XXXX.XXXX.XXXX

func (Version) String added in v0.1.1

func (ver Version) String() string

String convert version integer to string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL