Documentation
¶
Overview ¶
Package fed implements federation (server-to-server requests).
Index ¶
- Variables
- type BlockList
- type Client
- type Listener
- type Queue
- type Resolver
- func (s *Resolver) Get(ctx context.Context, keys [2]httpsig.Key, url string) (*http.Response, error)
- func (r *Resolver) Resolve(ctx context.Context, keys [2]httpsig.Key, host, name string, ...) (*ap.Actor, error)
- func (r *Resolver) ResolveID(ctx context.Context, keys [2]httpsig.Key, id string, flags ap.ResolverFlag) (*ap.Actor, error)
- type Syncer
Constants ¶
This section is empty.
Variables ¶
var ( ErrActorGone = errors.New("actor is gone") ErrNoLocalActor = errors.New("no such local user") ErrActorNotCached = errors.New("actor is not cached") ErrBlockedDomain = errors.New("domain is blocked") ErrInvalidScheme = errors.New("invalid scheme") ErrInvalidHost = errors.New("invalid host") ErrInvalidID = errors.New("invalid actor ID") ErrSuspendedActor = errors.New("actor is suspended") ErrYoungActor = errors.New("actor is too young") ErrNotInstanceActor = errors.New("not application actor") )
Functions ¶
This section is empty.
Types ¶
type BlockList ¶
type BlockList struct {
// contains filtered or unexported fields
}
BlockList is a list of blocked domains.
func NewBlockList ¶
type Listener ¶
type Listener struct {
Domain string
Closed bool
Config *cfg.Config
DB *sql.DB
Resolver *Resolver
ActorKeys [2]httpsig.Key
Addr string
Cert string
Key string
Plain bool
}
func (*Listener) ListenAndServe ¶
ListenAndServe handles HTTP requests from other servers.
func (*Listener) NewHandler ¶
NewHandler returns a http.Handler that handles ActivityPub requests.
type Queue ¶
func (*Queue) Process ¶
Process polls the queue of outgoing activities and delivers them to other servers. Delivery happens in batches, with multiple workers, timeout and retries. The listing of additional activities and recipients runs in parallel with delivery. During wide deliveries (e.g. public posts), additional requests to the same server are skipped, greatly reducing the number of outgoing requests when many recipients reside on the same server.
type Resolver ¶
type Resolver struct {
BlockedDomains *BlockList
// contains filtered or unexported fields
}
Resolver retrieves actor objects given their ID. Actors are cached, updated periodically and deleted if gone from the remote server.
func NewResolver ¶
func NewResolver(blockedDomains *BlockList, domain string, cfg *cfg.Config, client Client, db *sql.DB) *Resolver
NewResolver returns a new Resolver.