license

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine struct {
	MachineCode string
	// contains filtered or unexported fields
}

func NewMachine

func NewMachine(pubPem, priPem []byte) *Machine

func NewMachineFromFile

func NewMachineFromFile(pubFile, priFile string) (*Machine, error)

func (*Machine) GenerateRequest

func (m *Machine) GenerateRequest() (string, error)

func (*Machine) SignLicense

func (m *Machine) SignLicense(reqRaw string, org string, duration time.Duration, params map[string]string) (string, error)

func (*Machine) VerifyLicense

func (m *Machine) VerifyLicense(license string) (*Response, error)

type Request

type Request struct {
	Timestamp   int64  `json:"timestamp"`
	MachineCode string `json:"machine_code"`
}

type Response

type Response struct {
	Org               string            `json:"org"`
	NotAfterTimestamp int64             `json:"not_after_timestamp"`
	Params            map[string]string `json:"params"`
	MachineCode       string            `json:"machine_code"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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