license

package
v0.0.0-...-ae147c6 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidLicense  is ...
	ErrInvalidLicense = errors.New("invalid license")

	// ErrMalformedLicense is a ...
	ErrMalformedLicense = errors.New("malformed license")

	// ErrPublicKeyNotSet is ...
	ErrPublicKeyNotSet = errors.New("public key is not set")
)

Functions

This section is empty.

Types

type License

type License struct {
	IssuedBy     string          `json:"iss,omitempty"`
	CustomerID   string          `json:"cus,omitempty"`
	SubscriberID string          `json:"sub,omitempty"`
	Type         string          `json:"typ,omitempty"`
	Limit        Limits          `json:"lim,omitempty"`
	IssuedAt     time.Time       `json:"iat,omitempty"`
	ExpiresAt    time.Time       `json:"exp,omitempty"`
	Metadata     json.RawMessage `json:"dat,omitempty"`
}

License is a ...

type Limit

type Limit struct {
	Key   string   `json:"key"`
	Value int      `json:"value,omitempty"`
	List  []string `json:"list,omitempty"`
}

Limit is ...

type Limits

type Limits struct {
	Limits []Limit `json:"limits"`
}

Limits is ...

type Private

type Private struct {
	License License
	// contains filtered or unexported fields
}

Private is ...

func DecodePrivateKey

func DecodePrivateKey(privateKey []byte) (*Private, error)

DecodePrivateKey is decode private key from base64

func (*Private) Encode

func (l *Private) Encode() ([]byte, error)

Encode is a generate new license

func (*Private) Expired

func (l *Private) Expired() bool

Expired is a ...

type Public

type Public struct {
	License License
	// contains filtered or unexported fields
}

Public is ...

func DecodePublicKey

func DecodePublicKey(publicKey []byte) (*Public, error)

DecodePublicKey and decode public key from base64

func (*Public) Decode

func (l *Public) Decode(data []byte) (*Public, error)

Decode license file

func (*Public) Expired

func (l *Public) Expired() bool

Expired is a ...

func (*Public) Info

func (l *Public) Info() License

Info is ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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