Documentation ¶
Overview ¶
Package piclient handles the http requests made to Politeia APIs.
Index ¶
- func DropURLRegex(URLPath, param string) string
- func HandleGetRequests(client *http.Client, URLPath string) ([]byte, error)
- func RetrieveAllProposals(client *http.Client, APIRootPath, URLParams string) (*pitypes.Proposals, error)
- func RetrieveProposalByToken(client *http.Client, APIRootPath, token string) (*pitypes.Proposal, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropURLRegex ¶
DropURLRegex replaces "{token:[A-z0-9]{64}}" in a URL with provided the parameter.
func HandleGetRequests ¶
HandleGetRequests accepts a http client and API URL path as arguments. If the parameters are valid, a GET request is made to the API URL passed. The body returned is decoded into []byte and returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.