Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { NewTransport(pubKeyID string, privkey crypto.PrivateKey) (Transport, error) 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, 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.
Click to show internal directories.
Click to hide internal directories.