Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGETSigner ¶ added in v0.3.4
NewGETSigner returns a new httpsig.Signer instance initialized with GTS GET preferences.
Types ¶
type Controller ¶
type Controller interface { // NewTransport returns an http signature transport with the given public key ID (URL location of pubkey), and the given private key. NewTransport(pubKeyID string, privkey *rsa.PrivateKey) (Transport, error) // NewTransportForUsername searches for account with username, and returns result of .NewTransport(). NewTransportForUsername(ctx context.Context, username string) (Transport, error) }
Controller generates transports for use in making federation requests to other servers.
func NewController ¶
func NewController(db db.DB, federatingDB federatingdb.DB, clock pub.Clock, client pub.HttpClient) Controller
NewController returns an implementation of the Controller interface for creating new transports
type Transport ¶
type Transport interface { pub.Transport // DereferenceMedia fetches the given media attachment IRI, returning the reader and filesize. DereferenceMedia(ctx context.Context, iri *url.URL) (io.ReadCloser, int, error) // DereferenceInstance dereferences remote instance information, first by checking /api/v1/instance, and then by checking /.well-known/nodeinfo. DereferenceInstance(ctx context.Context, iri *url.URL) (*gtsmodel.Instance, error) // Finger performs a webfinger request with the given username and domain, and returns the bytes from the response body. Finger(ctx context.Context, targetUsername string, targetDomains string) ([]byte, error) }
Transport wraps the pub.Transport interface with some additional functionality for fetching remote media.
Since the transport has the concept of 'shortcuts' for fetching data locally rather than remotely, it is not *always* the case that calling a Transport function does an http call, but it usually will for remote hosts or resources for which a shortcut isn't provided by the transport controller (also in this package).