activitypub

package
v0.0.0-...-37004a0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrActorNotFound = errutil.NewError(errutil.TypeNotFound, "actor not found")
)

define errors

View Source
var (
	ErrUnsupportedActivityType = errutil.NewError(errutil.TypeBadRequest, "unsupported activity type")
)

Functions

func GetInboxURL

func GetInboxURL(actorURI string) (string, error)

func Subscribe

func Subscribe(consumer *Consumer, handler *Handler, logger *log.Logger) error

Types

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(log *log.Logger, pubsub *te.Client, handler *Handler) *Consumer

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func ProvideHandler

func ProvideHandler(config config.Config, store *store.Store[repository.ActivityHubRepository]) *Handler

func (*Handler) CreateAccount

func (h *Handler) CreateAccount(ctx context.Context, username string, name string, summary string) (acc models.Account, err error)

func (*Handler) GetActor

func (h *Handler) GetActor(ctx context.Context, actor string) (acc models.Account, err error)

func (*Handler) GetFollowers

func (h *Handler) GetFollowers(ctx context.Context, actorname string) (follower []models.Follower, err error)

func (*Handler) ReceiveInboxActivity

func (h *Handler) ReceiveInboxActivity(ctx context.Context, activity externalmodel.Activity) error

func (*Handler) SendPost

func (h *Handler) SendPost(ctx context.Context, sendingActorID string, sendToURI string, content string) error

func (*Handler) SendPostToFollowers

func (h *Handler) SendPostToFollowers(ctx context.Context, sendingActorID string, content string) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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