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 ¶
- func Add(w http.ResponseWriter, r *http.Request)
- func AddNote(w http.ResponseWriter, r *http.Request)
- func AddViaAPI(w http.ResponseWriter, r *http.Request)
- func All(w http.ResponseWriter, r *http.Request)
- func Disable(w http.ResponseWriter, r *http.Request)
- func Download(w http.ResponseWriter, r *http.Request)
- func History(w http.ResponseWriter, r *http.Request)
- func Notes(w http.ResponseWriter, r *http.Request)
- func One(w http.ResponseWriter, r *http.Request)
- func Renew(w http.ResponseWriter, r *http.Request)
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 Notes ¶
func Notes(w http.ResponseWriter, r *http.Request)
Notes gets the list of notes for a 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.