single

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: BSD-2-Clause, BSD-2-Clause Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Net    single.Cmix
	Rng    csprng.Source
	E2eGrp *cyclic.Group
}

Request allows for making REST-like requests to a RestServer using single-use messages Can be used as stateful or declared inline without state

func (*Request) AsyncRequest

func (s *Request) AsyncRequest(recipient contact.Contact, method restlike.Method, path restlike.URI,
	content restlike.Data, headers *restlike.Headers, cb restlike.RequestCallback, singleParams single.RequestParams) error

AsyncRequest provides several Method of sending Data to the given URI and will return the Message to the given Callback when received

func (*Request) Request

func (s *Request) Request(recipient contact.Contact, method restlike.Method, path restlike.URI,
	content restlike.Data, headers *restlike.Headers, singleParams single.RequestParams) (*restlike.Message, error)

Request provides several Method of sending Data to the given URI and blocks until the Message is returned

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements the RestServer interface using single-use

func NewServer

func NewServer(receptionId *id.ID, privKey *cyclic.Int, grp *cyclic.Group, net single.ListenCmix) *Server

NewServer builds a RestServer with single-use and the provided arguments, then registers necessary external services

func (*Server) Close

func (r *Server) Close()

Close the internal RestServer endpoints and external services

func (*Server) GetEndpoints

func (r *Server) GetEndpoints() *restlike.Endpoints

GetEndpoints returns the association of a Callback with a specific URI and a variety of different REST Method

Jump to

Keyboard shortcuts

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