Documentation
¶
Index ¶
- Constants
- type Activities
- func NewActivities(path string, refType spi.ReferenceType, cfg *Config, activityStore spi.Store, ...) *Activities
- func NewInbox(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
- func NewLiked(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
- func NewLikes(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
- func NewShares(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
- type Activity
- type AuthHandler
- type Config
- type Outbox
- type ReadOutbox
- type Reference
- func NewFollowers(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Reference
- func NewFollowing(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Reference
- func NewReference(path string, refType spi.ReferenceType, sortOrder spi.SortOrder, ordered bool, ...) *Reference
- func NewWitnesses(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Reference
- func NewWitnessing(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Reference
- type Services
Constants ¶
const ( // PublicKeysPath specifies the service's "keys" endpoint. PublicKeysPath = "/keys/{id}" // FollowersPath specifies the service's 'followers' endpoint. FollowersPath = "/followers" // FollowingPath specifies the service's 'following' endpoint. FollowingPath = "/following" // OutboxPath specifies the service's 'outbox' endpoint. OutboxPath = "/outbox" // InboxPath specifies the service's 'inbox' endpoint. InboxPath = "/inbox" // WitnessesPath specifies the service's 'witnesses' endpoint. WitnessesPath = "/witnesses" // WitnessingPath specifies the service's 'witnessing' endpoint. WitnessingPath = "/witnessing" // LikedPath specifies the service's 'liked' endpoint. LikedPath = "/liked" SharesPath = "/shares" // LikesPath specifies the object's 'likes' endpoint. LikesPath = "/likes" // ActivitiesPath specifies the object's 'activities' endpoint. ActivitiesPath = "/activities/{id}" )
const MainKeyID = "main-key"
MainKeyID is the ID of the service's public key.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activities ¶
type Activities struct {
// contains filtered or unexported fields
}
Activities implements a REST handler that retrieves activities.
func NewActivities ¶
func NewActivities(path string, refType spi.ReferenceType, cfg *Config, activityStore spi.Store, getObjectIRI getObjectIRIFunc, getID getIDFunc, verifier signatureVerifier) *Activities
NewActivities returns a new activities REST handler.
func NewInbox ¶
func NewInbox(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
NewInbox returns a new 'inbox' REST handler that retrieves a service's inbox.
func NewLiked ¶
func NewLiked(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
NewLiked returns a new 'liked' REST handler that retrieves a service's 'Like' activities, i.e. the Like activities that were posted by the given service.
func NewLikes ¶
func NewLikes(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
NewLikes returns a new 'likes' REST handler that retrieves an object's 'Like' activities.
func NewShares ¶
func NewShares(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Activities
NewShares returns a new 'shares' REST handler that retrieves an object's 'Announce' activities.
func (Activities) Handler ¶
func (h Activities) Handler() common.HTTPRequestHandler
Handler returns the handler that should be invoked when an HTTP GET is requested to the target endpoint. This handler must be registered with an HTTP server.
func (Activities) Method ¶
func (h Activities) Method() string
Method returns the HTTP method, which is always GET.
type Activity ¶ added in v0.1.1
type Activity struct {
// contains filtered or unexported fields
}
Activity implements a REST handler that retrieves a single activity by ID.
func NewActivity ¶ added in v0.1.1
NewActivity returns a new 'activities/{id}' REST handler that retrieves a single activity by ID.
func (Activity) Handler ¶ added in v0.1.1
func (h Activity) Handler() common.HTTPRequestHandler
Handler returns the handler that should be invoked when an HTTP GET is requested to the target endpoint. This handler must be registered with an HTTP server.
func (Activity) Method ¶ added in v0.1.1
func (h Activity) Method() string
Method returns the HTTP method, which is always GET.
type AuthHandler ¶ added in v0.1.2
type AuthHandler struct {
*Config
// contains filtered or unexported fields
}
AuthHandler handles authorization of an HTTP request. Both bearer token and HTTP signature authorization are performed.
func NewAuthHandler ¶ added in v0.1.2
func NewAuthHandler(cfg *Config, endpoint, method string, s store.Store, verifier signatureVerifier, authorizeActor authorizeActorFunc) *AuthHandler
NewAuthHandler returns a new authorization handler.
type Config ¶
type Config struct {
auth.Config
BasePath string
ObjectIRI *url.URL
PageSize int
VerifyActorInSignature bool
}
Config contains configuration parameters for the handler.
type Outbox ¶
type Outbox struct {
*Config
*AuthHandler
// contains filtered or unexported fields
}
Outbox implements a REST handler for posts to a service's outbox.
func NewPostOutbox ¶
NewPostOutbox returns a new REST handler to post activities to the outbox.
func (*Outbox) Handler ¶
func (h *Outbox) Handler() common.HTTPRequestHandler
Handler returns the handler that should be invoked when an HTTP POST is requested to the target endpoint. This handler must be registered with an HTTP server.
type ReadOutbox ¶ added in v0.1.1
type ReadOutbox struct {
*Activities
}
ReadOutbox defines an endpoint that retrieves activities from the outbox. The caller has access to all activities if they are authorized, otherwise only public activities are returned.
func NewOutbox ¶
func NewOutbox(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *ReadOutbox
NewOutbox returns a new 'outbox' REST handler that retrieves a service's outbox.
func (ReadOutbox) Handler ¶ added in v0.1.1
func (h ReadOutbox) Handler() common.HTTPRequestHandler
Handler returns the handler that should be invoked when an HTTP GET is requested to the target endpoint. This handler must be registered with an HTTP server.
func (ReadOutbox) Method ¶ added in v0.1.1
func (h ReadOutbox) Method() string
Method returns the HTTP method, which is always GET.
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
Reference implements a REST handler that retrieves references as a collection of IRIs.
func NewFollowers ¶
NewFollowers returns a new 'followers' REST handler that retrieves a service's list of followers.
func NewFollowing ¶
NewFollowing returns a new 'following' REST handler that retrieves a service's list of following.
func NewReference ¶
func NewReference(path string, refType spi.ReferenceType, sortOrder spi.SortOrder, ordered bool, cfg *Config, activityStore spi.Store, getObjectIRI getObjectIRIFunc, getID getIDFunc, verifier signatureVerifier) *Reference
NewReference returns a new reference REST handler.
func NewWitnesses ¶
NewWitnesses returns a new 'witnesses' REST handler that retrieves a service's list of witnesses.
func NewWitnessing ¶
NewWitnessing returns a new 'witnessing' REST handler that retrieves collection of the services that the local service is witnessing.
func (Reference) Handler ¶
func (h Reference) Handler() common.HTTPRequestHandler
Handler returns the handler that should be invoked when an HTTP GET is requested to the target endpoint. This handler must be registered with an HTTP server.
func (Reference) Method ¶
func (h Reference) Method() string
Method returns the HTTP method, which is always GET.
type Services ¶
type Services struct {
// contains filtered or unexported fields
}
Services implements the 'services' REST handler to retrieve a given ActivityPub service (actor).
func NewPublicKeys ¶
NewPublicKeys returns a new public keys REST handler.
func NewServices ¶
NewServices returns a new 'services' REST handler.
func (Services) Handler ¶
func (h Services) Handler() common.HTTPRequestHandler
Handler returns the handler that should be invoked when an HTTP GET is requested to the target endpoint. This handler must be registered with an HTTP server.
func (Services) Method ¶
func (h Services) Method() string
Method returns the HTTP method, which is always GET.