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, key httpsig.Key, url string) (*http.Response, error)
- func (r *Resolver) Resolve(ctx context.Context, key httpsig.Key, host, name string, flags ap.ResolverFlag) (*ap.Actor, error)
- func (r *Resolver) ResolveID(ctx context.Context, key 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") )
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 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. If possible, wide deliveries (e.g. public posts) are performed using the sharedInbox endpoint, greatly reducing the number of outgoing requests when many recipients share the same endpoint.
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.