proxy

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: BSD-3-Clause Imports: 23 Imported by: 0

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

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

func ForbiddenError(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})

ForbiddenError sets a forbidden error error

func InternalError

func InternalError(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})

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

func NotFoundErr(w http.ResponseWriter, r *http.Request, err error, args map[string]interface{})

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

func NewDKG

func NewDKG(mngr txn.Manager, d dkgSrv.DKG, pk kyber.Point) DKG

NewDKG returns a new initialized DKG proxy

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

func NewForm

func NewForm(srv ordering.Service, p pool.Pool,
	ctx serde.Context, fac serde.Factory, pk kyber.Point, txnManaxer txnmanager.Manager) Form

NewForm returns a new initialized form proxy

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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