http

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInboundHandler

func NewInboundHandler(prov transport.Provider) (http.Handler, error)

NewInboundHandler will create a new handler to enforce Did-Comm HTTP transport specs then routes processing to the mandatory 'msgHandler' argument.

Arguments:

  • 'msgHandler' is the handler function that will be executed with the inbound request payload. Users of this library must manage the handling of all inbound payloads in this function.

Types

type Inbound

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

Inbound http type.

func NewInbound

func NewInbound(internalAddr, externalAddr, certFile, keyFile string) (*Inbound, error)

NewInbound creates a new HTTP inbound transport instance.

func (*Inbound) Endpoint

func (i *Inbound) Endpoint() string

Endpoint provides the http connection details.

func (*Inbound) Start

func (i *Inbound) Start(prov transport.Provider) error

Start the http server.

func (*Inbound) Stop

func (i *Inbound) Stop() error

Stop the http server.

type OutboundHTTPClient

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

OutboundHTTPClient represents the Outbound HTTP transport instance.

func NewOutbound

func NewOutbound(opts ...OutboundHTTPOpt) (*OutboundHTTPClient, error)

NewOutbound creates a new instance of Outbound HTTP transport to Post requests to other Agents. An http.Client or tls.Config options is mandatory to create a transport instance.

func (*OutboundHTTPClient) Accept

func (cs *OutboundHTTPClient) Accept(url string) bool

Accept url.

func (*OutboundHTTPClient) AcceptRecipient

func (cs *OutboundHTTPClient) AcceptRecipient([]string) bool

AcceptRecipient checks if there is a connection for the list of recipient keys.

func (*OutboundHTTPClient) Send

func (cs *OutboundHTTPClient) Send(data []byte, destination *service.Destination) (string, error)

Send sends a2a exchange data via HTTP (client side).

func (*OutboundHTTPClient) Start

func (cs *OutboundHTTPClient) Start(prov transport.Provider) error

Start starts outbound transport.

type OutboundHTTPOpt

type OutboundHTTPOpt func(opts *outboundCommHTTPOpts)

OutboundHTTPOpt is an outbound HTTP transport option.

func WithOutboundHTTPClient

func WithOutboundHTTPClient(client *http.Client) OutboundHTTPOpt

WithOutboundHTTPClient option is for creating an Outbound HTTP transport using an http.Client instance.

func WithOutboundTLSConfig

func WithOutboundTLSConfig(tlsConfig *tls.Config) OutboundHTTPOpt

WithOutboundTLSConfig option is for creating an Outbound HTTP transport using a tls.Config instance.

func WithOutboundTimeout

func WithOutboundTimeout(timeout time.Duration) OutboundHTTPOpt

WithOutboundTimeout option is for creating an Outbound HTTP transport using a client timeout value.

Jump to

Keyboard shortcuts

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