license

package
v0.0.0-...-1518e3e Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package license handles creation and retrieval of license data. This also handles some updates to existing licenses.

This file specifically deals with the download history of a license.

Package license handles creation and retrieval of license data. This also handles some updates to existing licenses.

This file specifically deals with the notes for a license. Notes are useful for random documentation purposes.

Package license handles creation and retrieval of license data. This also handles some updates to existing licenses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(w http.ResponseWriter, r *http.Request)

Add saves the data used to create a license. First, we handle saving the common license data, then we handle saving the custom field results, then we generate the license file and sign it, we update the saved license data with the signature, and finally we verify the license file by creating it, rereading it, and checking the signature with the public key.

func AddNote

func AddNote(w http.ResponseWriter, r *http.Request)

AddNote adds a note for a license.

func AddViaAPI

func AddViaAPI(w http.ResponseWriter, r *http.Request)

AddViaAPI handles transforming the data provided by the request to create a license via the public API to the format the interal API/Add func expects. This is done to keep the public API simpler: the user building the request can provide the main license data in key:value pairs rather than a struct/object, and the user can provide the list of custom fields in an object of field-name:value pairings rather than an array of objects. This takes the user provided data and builds the internal license struct and slice of custom field results structs before calling Add() to handle the actual validation and saving of the license.

Note that when adding a license via the public API, the request can have either the AppID or KeyPairID. If the AppID is provided, then the default key pair's ID is used. If the KeyPairID is provided, we simply use the parent app's ID.

func All

func All(w http.ResponseWriter, r *http.Request)

All gets the list of licenses, optionally filtered if needed.

func Disable

func Disable(w http.ResponseWriter, r *http.Request)

Disable marks a license as inactive.

func Download

func Download(w http.ResponseWriter, r *http.Request)

Download retrieves the license data as a text file. This file is complete, is is signed, and is the license you would distribute for use in your apps.

This can also be used to display the license data in the browser if needed. This is really only done for diagnostics by an admin.

func History

func History(w http.ResponseWriter, r *http.Request)

func Notes

func Notes(w http.ResponseWriter, r *http.Request)

Notes gets the list of notes for a license.

func One

func One(w http.ResponseWriter, r *http.Request)

One gets the full data for one license.

func Renew

func Renew(w http.ResponseWriter, r *http.Request)

Renew creates a new license from an existing license, just with a new expiration date set. This creates a copy of the existing license's common data and custom field results. The renewal relationship is also saved to link the licenses together.

Types

This section is empty.

Jump to

Keyboard shortcuts

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