Documentation ¶
Index ¶
- func CheckPublicationByTitle(w http.ResponseWriter, r *http.Request, s IServer)
- func CreatePublication(w http.ResponseWriter, r *http.Request, s IServer)
- func CreatePurchase(w http.ResponseWriter, r *http.Request, s IServer)
- func CreateUser(w http.ResponseWriter, r *http.Request, s IServer)
- func DecodeJSONPublication(r *http.Request) (webpublication.Publication, error)
- func DecodeJSONPurchase(r *http.Request) (webpurchase.Purchase, error)
- func DecodeJSONUser(r *http.Request) (webuser.User, error)
- func DeletePublication(w http.ResponseWriter, r *http.Request, s IServer)
- func DeleteUser(w http.ResponseWriter, r *http.Request, s IServer)
- func GetDashboardBestSellers(w http.ResponseWriter, r *http.Request, s IServer)
- func GetDashboardInfos(w http.ResponseWriter, r *http.Request, s IServer)
- func GetFilteredLicenses(w http.ResponseWriter, r *http.Request, s IServer)
- func GetLicense(w http.ResponseWriter, r *http.Request, s IServer)
- func GetLicenseOwner(w http.ResponseWriter, r *http.Request, s IServer)
- func GetPublication(w http.ResponseWriter, r *http.Request, s IServer)
- func GetPublications(w http.ResponseWriter, r *http.Request, s IServer)
- func GetPurchase(w http.ResponseWriter, r *http.Request, s IServer)
- func GetPurchaseByLicenseID(w http.ResponseWriter, r *http.Request, s IServer)
- func GetPurchasedLicense(w http.ResponseWriter, r *http.Request, s IServer)
- func GetPurchases(w http.ResponseWriter, r *http.Request, s IServer)
- func GetRepositoryMasterFiles(w http.ResponseWriter, r *http.Request, s IServer)
- func GetUser(w http.ResponseWriter, r *http.Request, s IServer)
- func GetUserPurchases(w http.ResponseWriter, r *http.Request, s IServer)
- func GetUsers(w http.ResponseWriter, r *http.Request, s IServer)
- func PrepareListHeaderResponse(resourceCount int, resourceLink string, pagination Pagination, ...)
- func UpdatePublication(w http.ResponseWriter, r *http.Request, s IServer)
- func UpdatePurchase(w http.ResponseWriter, r *http.Request, s IServer)
- func UpdateUser(w http.ResponseWriter, r *http.Request, s IServer)
- func UploadPublication(w http.ResponseWriter, r *http.Request, s IServer)
- type IServer
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPublicationByTitle ¶
func CheckPublicationByTitle(w http.ResponseWriter, r *http.Request, s IServer)
CheckPublicationByTitle checks if a publication with this title exists
func CreatePublication ¶
func CreatePublication(w http.ResponseWriter, r *http.Request, s IServer)
CreatePublication creates a publication in the database
func CreatePurchase ¶
func CreatePurchase(w http.ResponseWriter, r *http.Request, s IServer)
CreatePurchase creates a purchase in the database
func CreateUser ¶
func CreateUser(w http.ResponseWriter, r *http.Request, s IServer)
CreateUser creates a user in the database
func DecodeJSONPublication ¶
func DecodeJSONPublication(r *http.Request) (webpublication.Publication, error)
DecodeJSONPublication transforms a json string to a User struct
func DecodeJSONPurchase ¶
func DecodeJSONPurchase(r *http.Request) (webpurchase.Purchase, error)
DecodeJSONPurchase transforms a json object into an golang object
func DecodeJSONUser ¶
DecodeJSONUser transforms a json string to a User struct
func DeletePublication ¶
func DeletePublication(w http.ResponseWriter, r *http.Request, s IServer)
DeletePublication removes a publication in the database
func DeleteUser ¶
func DeleteUser(w http.ResponseWriter, r *http.Request, s IServer)
DeleteUser creates a user in the database
func GetDashboardBestSellers ¶
func GetDashboardBestSellers(w http.ResponseWriter, r *http.Request, s IServer)
GetDashboardBestSellers gets the dashboard bestsellers
func GetDashboardInfos ¶
func GetDashboardInfos(w http.ResponseWriter, r *http.Request, s IServer)
GetDashboardInfos searches a publication by its uuid
func GetFilteredLicenses ¶
func GetFilteredLicenses(w http.ResponseWriter, r *http.Request, s IServer)
GetFilteredLicenses searches licenses activated by more than n devices
func GetLicense ¶
func GetLicense(w http.ResponseWriter, r *http.Request, s IServer)
GetLicense gets an existing license by its id (passed as a section of the REST URL). It generates a partial license from the purchase info, fetches the license from the lcp server and returns it to the caller. This API method is called from a link in the license status document.
func GetLicenseOwner ¶
func GetLicenseOwner(w http.ResponseWriter, r *http.Request, s IServer)
GetLicenseOwner retrieves a user by a license uuid he owns
func GetPublication ¶
func GetPublication(w http.ResponseWriter, r *http.Request, s IServer)
GetPublication returns a publication from its numeric id, given as part of the calling url
func GetPublications ¶
func GetPublications(w http.ResponseWriter, r *http.Request, s IServer)
GetPublications returns a list of publications
func GetPurchase ¶
func GetPurchase(w http.ResponseWriter, r *http.Request, s IServer)
GetPurchase gets a purchase by its id in the database
func GetPurchaseByLicenseID ¶
func GetPurchaseByLicenseID(w http.ResponseWriter, r *http.Request, s IServer)
GetPurchaseByLicenseID gets a purchase by a license id in the database
func GetPurchasedLicense ¶
func GetPurchasedLicense(w http.ResponseWriter, r *http.Request, s IServer)
GetPurchasedLicense generates a new license from the corresponding purchase id (passed as a section of the REST URL). It fetches the license from the lcp server and returns it to the caller. This API method is called from the client app (angular) when a license is requested after a purchase.
func GetPurchases ¶
func GetPurchases(w http.ResponseWriter, r *http.Request, s IServer)
GetPurchases searches all purchases for a client
func GetRepositoryMasterFiles ¶
func GetRepositoryMasterFiles(w http.ResponseWriter, r *http.Request, s IServer)
GetRepositoryMasterFiles returns a list of repository masterfiles
func GetUser ¶
func GetUser(w http.ResponseWriter, r *http.Request, s IServer)
GetUser searches a client by his email
func GetUserPurchases ¶
func GetUserPurchases(w http.ResponseWriter, r *http.Request, s IServer)
GetUserPurchases searches all purchases for a client
func GetUsers ¶
func GetUsers(w http.ResponseWriter, r *http.Request, s IServer)
GetUsers returns a list of users
func PrepareListHeaderResponse ¶
func PrepareListHeaderResponse(resourceCount int, resourceLink string, pagination Pagination, w http.ResponseWriter)
PrepareListHeaderResponse set several http headers sets previous and next link headers
func UpdatePublication ¶
func UpdatePublication(w http.ResponseWriter, r *http.Request, s IServer)
UpdatePublication updates an identified publication (id) in the database
func UpdatePurchase ¶
func UpdatePurchase(w http.ResponseWriter, r *http.Request, s IServer)
UpdatePurchase updates a purchase in the database Only updates the license id (uuid), start and end date, status
func UpdateUser ¶
func UpdateUser(w http.ResponseWriter, r *http.Request, s IServer)
UpdateUser updates an identified user (id) in the database
func UploadPublication ¶
func UploadPublication(w http.ResponseWriter, r *http.Request, s IServer)
UploadPublication creates a new publication via a POST request This function is called from the frontend test client
Types ¶
type IServer ¶
type IServer interface { RepositoryAPI() webrepository.WebRepository PublicationAPI() webpublication.WebPublication UserAPI() webuser.WebUser PurchaseAPI() webpurchase.WebPurchase DashboardAPI() webdashboard.WebDashboard LicenseAPI() weblicense.WebLicense }
IServer defines methods for db interaction
type Pagination ¶
Pagination used to paginate listing
func ExtractPaginationFromRequest ¶
func ExtractPaginationFromRequest(r *http.Request) (Pagination, error)
ExtractPaginationFromRequest extract from http.Request pagination information