transport

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

Error represents a fedihelper specific error.

func NewError

func NewError(m string) *Error

NewError wraps a message in a Error object.

func NewErrorf

func NewErrorf(m string, args ...interface{}) *Error

NewErrorf wraps a message in a Error object.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message as a string.

type Transport

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

Transport handled signing outgoing requests to federated instances.

func New

func New(clock pub.Clock, client pub.HttpClient, pubKeyID string, privkey crypto.PrivateKey) (*Transport, error)

New creates a new Transport module.

func (*Transport) InstanceGet

func (t *Transport) InstanceGet(ctx context.Context, uri *url.URL, accepts ...libhttp.Mime) ([]byte, error)

func (*Transport) InstancePost

func (t *Transport) InstancePost(ctx context.Context, uri *url.URL, body []byte, contentType libhttp.Mime, accepts ...libhttp.Mime) ([]byte, error)

Jump to

Keyboard shortcuts

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