server

package
v0.0.0-...-19a598b Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	FetchObject(context.Context, *url.URL, bool, int, int) (vocab.Type, error)
	FetchRemoteActor(ctx context.Context, s string) (actor.Actor, error)
	DereferenceFollowers(ctx context.Context, property vocab.ActivityStreamsFollowersProperty, i int, i2 int) error
	DereferenceFollowing(ctx context.Context, property vocab.ActivityStreamsFollowingProperty, i int, i2 int) error
	DereferenceOutbox(ctx context.Context, property vocab.ActivityStreamsOutboxProperty, i int, i2 int) error
	DereferenceObjectsInOrderedCollection(ctx context.Context, collection vocab.ActivityStreamsOrderedCollection, i int, i2 int, i3 int) (vocab.ActivityStreamsOrderedCollectionPage, error)
	DereferenceOrderedItems(ctx context.Context, property vocab.ActivityStreamsOrderedItemsProperty, i int, i2 int) error
	DereferenceItem(context.Context, vocab.Type, int, int) (vocab.Type, error)
	FetchRemotePerson(ctx context.Context, identifier string) (vocab.ActivityStreamsPerson, error)
	DereferenceRecipientInboxes(ctx context.Context, deliver activity.Activity) ([]*url.URL, error)
	PostToInbox(ctx context.Context, inbox *url.URL, deliver vocab.Type, id string, key *rsa.PrivateKey) error
	LookupInstanceDetails(ctx context.Context, id *url.URL) (*client.InstanceDetails, error)
	ResolveActorIdentifierToID(ctx context.Context, otherUser string) (*url.URL, error)
	FetchRecipients(context.Context, activity.Activity) ([]*url.URL, error)
	Create(ctx context.Context, create vocab.ActivityStreamsCreate, i int, i2 int) error
	Announce(ctx context.Context, announce vocab.ActivityStreamsAnnounce, i int, i2 int) error
	Invite(context.Context, vocab.ActivityStreamsInvite, int, int) error
}

type Datastore

type Datastore interface {
	GetActorByUsername(context.Context, string) (vocab.ActivityStreamsPerson, error)
	GetActivityByObjectID(context.Context, string, string) (activity.Activity, error)
	GetActivityByActivityID(context.Context, string) (activity.Activity, error)
	GetFollowersByUsername(context.Context, string) (vocab.ActivityStreamsOrderedCollection, error)
	GetFollowingByUsername(context.Context, string) (vocab.ActivityStreamsOrderedCollection, error)
	GetFollowerStatus(context.Context, string, string) (int, error)
	CreateUser(context.Context, *user.User) error
	GetUserByUsername(context.Context, string) (*user.User, error)
	AddFollowerToActor(context.Context, string, string) error
	AddActorToFollows(context.Context, string, string) error
	RemoveFollowerFromActor(context.Context, string, string) error
	GetActorByActorID(context.Context, string) (actor.Person, error)
	AddActivityToActivities(context.Context, vocab.Type, primitive.ObjectID) error
	AddObjectsToActorInbox(context.Context, []vocab.Type, string) error
	AddActivityToActorInbox(context.Context, vocab.Type, string, *url.URL) error
	GetActorInbox(context.Context, string, string, string, bool) (vocab.ActivityStreamsOrderedCollectionPage, error)
	GetActorInboxAsOrderedCollection(context.Context, string, bool) (vocab.ActivityStreamsOrderedCollection, error)
	AddActivityToOutbox(context.Context, vocab.Type, string) error
	GetActorOutbox(context.Context, string, string, string) (vocab.ActivityStreamsOrderedCollectionPage, error)
	GetActorOutboxAsOrderedCollection(context.Context, string) (vocab.ActivityStreamsOrderedCollection, error)
	GetEventInboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
	GetEventInbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
	AddActivityToPublicInbox(context.Context, vocab.Type, primitive.ObjectID, bool) error
	GetPublicInbox(context.Context, string, string, bool, bool) (vocab.ActivityStreamsOrderedCollectionPage, error)
	GetPublicInboxAsOrderedCollection(context.Context, bool, bool) (vocab.ActivityStreamsOrderedCollection, error)
	GetNotificationsInbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
	GetNotificationsInboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
	GetLikedAsOrderedCollection(context.Context, string) (vocab.ActivityStreamsOrderedCollection, error)
	GetLikesUsingObjectID(context.Context, string) (vocab.ActivityStreamsOrderedCollection, error)
	GetLikesAsOrderedCollection(context.Context, *url.URL) (vocab.ActivityStreamsOrderedCollection, error)
	DeleteObjectFromAllInboxes(context.Context, *url.URL) error
	AddHostToSameInstitute(ctx context.Context, instance *url.URL) error
	UpdateActor(context.Context, string, string, string, vocab.ActivityStreamsImage) error
	LikeObject(context.Context, *url.URL, *url.URL, *url.URL) error
	GetLikeStatus(context.Context, *url.URL, *url.URL) (bool, error)
	GetAnnounceStatus(context.Context, *url.URL, *url.URL) (bool, error)
}

type Server

type Server struct {
	URL          *url.URL
	Router       *chi.Mux
	Actor        *actor.Server
	FileHandler  *file.Handler
	Datastore    Datastore
	Redis        *redis.Client
	KeyGenerator actor.KeyGenerator
	Client       Client
	Policy       *bluemonday.Policy
	Secret       string
}

func New

func New(instanceURL *url.URL, datastore Datastore, client Client, keyGenerator actor.KeyGenerator, secret, redisAddress string) (*Server, error)

func (*Server) Webfinger

func (s *Server) Webfinger(w http.ResponseWriter, r *http.Request)

Webfinger allow other services to query if a user on this instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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