Documentation
¶
Overview ¶
Package proxy defines and implement the public APIs.
Function names follow the convention used in URL helpers on rails: https://guides.rubyonrails.org/routing.html#path-and-url-helpers
For the API specification look at /docs/api.md.
Index ¶
- func AllowCORS(w http.ResponseWriter, r *http.Request)
- func BadRequestError(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})
- func ForbiddenError(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})
- func InternalError(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})
- func NotAllowedHandler(w http.ResponseWriter, r *http.Request)
- func NotFoundErr(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})
- func NotFoundHandler(w http.ResponseWriter, r *http.Request)
- type DKG
- type Form
- type Shuffle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowCORS ¶
func AllowCORS(w http.ResponseWriter, r *http.Request)
AllowCORS defines a basic handler that adds wide Access Control Allow origin headers.
func BadRequestError ¶
func BadRequestError(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})
BadRequestError sets an bad request error
func ForbiddenError ¶
ForbiddenError sets a forbidden error error
func InternalError ¶
InternalError sets an internal server error
func NotAllowedHandler ¶
func NotAllowedHandler(w http.ResponseWriter, r *http.Request)
NotAllowedHandler degines a generic handler for 405
func NotFoundErr ¶
NotFoundErr sets a not found error
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, r *http.Request)
NotFoundHandler defines a generic handler for 404
Types ¶
type DKG ¶
type DKG interface {
// POST /services/dkg
NewDKGActor(http.ResponseWriter, *http.Request)
// GET /services/dkg/{formID}
Actor(http.ResponseWriter, *http.Request)
// PUT /services/dkg/{formID}
EditDKGActor(http.ResponseWriter, *http.Request)
}
DKG defines the public HTTP API of the DKG service
type Form ¶
type Form interface {
// POST /forms
NewForm(http.ResponseWriter, *http.Request)
// POST /forms/{formID}/vote
NewFormVote(http.ResponseWriter, *http.Request)
// PUT /forms/{formID}
EditForm(http.ResponseWriter, *http.Request)
// GET /forms
Forms(http.ResponseWriter, *http.Request)
// GET /forms/{formID}
Form(http.ResponseWriter, *http.Request)
// DELETE /forms/{formID}
DeleteForm(http.ResponseWriter, *http.Request)
}
Form defines the public HTTP API for the form smart contract
type Shuffle ¶
type Shuffle interface {
// PUT /services/shuffle/{formID}
EditShuffle(http.ResponseWriter, *http.Request)
}
Shuffle defines the public HTTP API of the shuffling service
func NewShuffle ¶
func NewShuffle(actor shuffleSrv.Actor, pk kyber.Point) Shuffle
NewShuffle returns a new initialized shuffle