piclient

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: ISC Imports: 7 Imported by: 1

Documentation

Overview

Package piclient handles the http requests made to Politeia APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropURLRegex

func DropURLRegex(URLPath, param string) string

DropURLRegex replaces "{token:[A-z0-9]{64}}" in a URL with provided the parameter.

func HandleGetRequests

func HandleGetRequests(client *http.Client, URLPath string) ([]byte, error)

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.

func RetrieveAllProposals

func RetrieveAllProposals(client *http.Client, APIRootPath, URLParams string) (
	*pitypes.Proposals, error)

RetrieveAllProposals returns a list of Proposals whose maximum count is defined by piapi.ProposalListPageSize. Data returned is queried from Politeia API.

func RetrieveProposalByToken

func RetrieveProposalByToken(client *http.Client, APIRootPath, token string) (*pitypes.Proposal, error)

RetrieveProposalByToken returns a single proposal identified by the token hash provided if it exists. Data returned is queried from Politeia API.

Types

This section is empty.

Jump to

Keyboard shortcuts

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