rpc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Overview

Package rpc implements handlers for incoming Secure Scuttlebutt RPC requests.

Index

Constants

View Source
const (
	// MaxBlobChunkSizeInBytes specifies the max size of one response payload
	// when sending blobs. Larger blobs are broken into several payloads. This
	// is done to give other pieces of code some wire time and avoid blocking
	// the connection completely when sending the blob.
	MaxBlobChunkSizeInBytes = 100 * 1000
)

Variables

This section is empty.

Functions

func NewMuxClosingHandlers

func NewMuxClosingHandlers(
	createHistoryStream *HandlerCreateHistoryStream,
) []mux.SynchronousHandler

NewMuxClosingHandlers is a convenience function used to create a list of all handlers implemented by this program.

func NewMuxHandlers

func NewMuxHandlers(
	blobsGet *HandlerBlobsGet,
	blobsCreateWants *HandlerBlobsCreateWants,
	ebtReplicate *HandlerEbtReplicate,
	tunnelConnect *HandlerTunnelConnect,
) []mux.Handler

NewMuxHandlers is a convenience function used to create a list of all handlers implemented by this program.

Types

type AcceptTunnelConnectHandler

type AcceptTunnelConnectHandler interface {
	Handle(ctx context.Context, cmd commands.AcceptTunnelConnect) error
}

type CreateHistoryStreamQueryHandler

type CreateHistoryStreamQueryHandler interface {
	Handle(ctx context.Context, query queries.CreateHistoryStream)
}

CreateHistoryStreamQueryHandler is here to make testing easier. See docs for the CreateHistoryStream application query.

type CreateHistoryStreamResponseWriter

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

func (CreateHistoryStreamResponseWriter) CloseWithError

func (rw CreateHistoryStreamResponseWriter) CloseWithError(err error) error

func (CreateHistoryStreamResponseWriter) WriteMessage

type CreateWantsCommandHandler

type CreateWantsCommandHandler interface {
	Handle(ctx context.Context, cmd commands.CreateWants) (<-chan messages.BlobWithSizeOrWantDistance, error)
}

type EbtReplicateCommandHandler

type EbtReplicateCommandHandler interface {
	Handle(ctx context.Context, cmd commands.HandleIncomingEbtReplicate) error
}

type GetBlobQueryHandler

type GetBlobQueryHandler interface {
	Handle(query queries.GetBlob) (io.ReadCloser, error)
}

type HandlerBlobsCreateWants

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

func NewHandlerBlobsCreateWants

func NewHandlerBlobsCreateWants(handler CreateWantsCommandHandler) *HandlerBlobsCreateWants

func (HandlerBlobsCreateWants) Handle

func (HandlerBlobsCreateWants) Procedure

func (h HandlerBlobsCreateWants) Procedure() rpc.Procedure

type HandlerBlobsGet

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

func NewHandlerBlobsGet

func NewHandlerBlobsGet(handler GetBlobQueryHandler) *HandlerBlobsGet

func (HandlerBlobsGet) Handle

func (h HandlerBlobsGet) Handle(ctx context.Context, s mux.Stream, req *rpc.Request) error

func (HandlerBlobsGet) Procedure

func (h HandlerBlobsGet) Procedure() rpc.Procedure

type HandlerCreateHistoryStream

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

func (*HandlerCreateHistoryStream) Handle

func (*HandlerCreateHistoryStream) Procedure

func (h *HandlerCreateHistoryStream) Procedure() rpc.Procedure

type HandlerEbtReplicate

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

func NewHandlerEbtReplicate

func NewHandlerEbtReplicate(handler EbtReplicateCommandHandler) *HandlerEbtReplicate

func (HandlerEbtReplicate) Handle

func (h HandlerEbtReplicate) Handle(ctx context.Context, s mux.Stream, req *rpc.Request) error

func (HandlerEbtReplicate) Procedure

func (h HandlerEbtReplicate) Procedure() rpc.Procedure

type HandlerTunnelConnect

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

func NewHandlerTunnelConnect

func NewHandlerTunnelConnect(handler AcceptTunnelConnectHandler) *HandlerTunnelConnect

func (HandlerTunnelConnect) Handle

func (h HandlerTunnelConnect) Handle(ctx context.Context, s mux.Stream, req *rpc.Request) error

func (HandlerTunnelConnect) Procedure

func (h HandlerTunnelConnect) Procedure() rpc.Procedure

Jump to

Keyboard shortcuts

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