Documentation ¶
Index ¶
- Constants
- func AddLogToFile(w http.ResponseWriter, r *http.Request, s Server)
- func CreateLicenseStatusDocument(w http.ResponseWriter, r *http.Request, s Server)
- func FilterLicenseStatuses(w http.ResponseWriter, r *http.Request, s Server)
- func GetLicenseStatusDocument(w http.ResponseWriter, r *http.Request, s Server)
- func LendingCancellation(w http.ResponseWriter, r *http.Request, s Server)
- func LendingRenewal(w http.ResponseWriter, r *http.Request, s Server)
- func LendingReturn(w http.ResponseWriter, r *http.Request, s Server)
- func ListRegisteredDevices(w http.ResponseWriter, r *http.Request, s Server)
- func RegisterDevice(w http.ResponseWriter, r *http.Request, s Server)
- type Server
Constants ¶
const ( LICENSE_STATUS = "status" REGISTER_DEVICE = "register" RENEW_LICENSE = "renew" RETURN_LICENSE = "return" CANCEL_REVOKE_LICENSE = "revoke" )
Possible values of test stage
Variables ¶
This section is empty.
Functions ¶
func AddLogToFile ¶
func AddLogToFile(w http.ResponseWriter, r *http.Request, s Server)
AddLogToFile adds a log message to the log file
func CreateLicenseStatusDocument ¶
func CreateLicenseStatusDocument(w http.ResponseWriter, r *http.Request, s Server)
CreateLicenseStatusDocument creates a license status and adds it to database It is triggered by a notification from the license server
func FilterLicenseStatuses ¶
func FilterLicenseStatuses(w http.ResponseWriter, r *http.Request, s Server)
FilterLicenseStatuses returns a sequence of license statuses, in their id order function for detecting licenses which used a lot of devices
func GetLicenseStatusDocument ¶
func GetLicenseStatusDocument(w http.ResponseWriter, r *http.Request, s Server)
GetLicenseStatusDocument gets a license status from the db by license id checks potential_rights_end and fill it
func LendingCancellation ¶
func LendingCancellation(w http.ResponseWriter, r *http.Request, s Server)
LendingCancellation cancels (before use) or revokes (after use) a license. parameters:
key: license id partial license status: the new status and a message indicating why the status is being changed The new status can be either STATUS_CANCELLED or STATUS_REVOKED
func LendingRenewal ¶
func LendingRenewal(w http.ResponseWriter, r *http.Request, s Server)
LendingRenewal checks that the calling device is registered with the license, then modifies the end date associated with the license and returns an updated license status to the caller. the 'end' parameter is optional; if absent, the end date is computed from the current end date plus a configuration parameter. Note: as per the spec, a non-registered device can renew a loan.
func LendingReturn ¶
func LendingReturn(w http.ResponseWriter, r *http.Request, s Server)
LendingReturn checks that the calling device is activated, then modifies the end date associated with the given license & returns updated and filled license status
func ListRegisteredDevices ¶
func ListRegisteredDevices(w http.ResponseWriter, r *http.Request, s Server)
ListRegisteredDevices returns data about the use of a given license
func RegisterDevice ¶
func RegisterDevice(w http.ResponseWriter, r *http.Request, s Server)
RegisterDevice registers a device for a given license, using the device id & name as parameters; returns the updated license status
Types ¶
type Server ¶
type Server interface { Transactions() transactions.Transactions LicenseStatuses() licensestatuses.LicenseStatuses GoofyMode() bool }
Server interface