From 3db517715bef6a53225c5c3c06e8fc5fd0bf71e3 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 24 Apr 2022 00:46:49 -0700 Subject: basic pass over view posts, post, catalog and manage page connections --- db/actor.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'db/actor.go') diff --git a/db/actor.go b/db/actor.go index 51c8f41..7e36090 100644 --- a/db/actor.go +++ b/db/actor.go @@ -1,11 +1,13 @@ package db import ( + "encoding/json" "fmt" "regexp" "strings" "github.com/FChannel0/FChannel-Server/activitypub" + "github.com/gofiber/fiber/v2" ) func GetActorFromPath(location string, prefix string) (activitypub.Actor, error) { @@ -49,3 +51,17 @@ func GetActorByName(name string) activitypub.Actor { return actor } + +func GetActorInfo(ctx *fiber.Ctx, id string) error { + actor, err := GetActorFromDB(id) + if err != nil { + return err + } + + enc, _ := json.MarshalIndent(actor, "", "\t") + ctx.Response().Header.Set("Content-Type", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") + + _, err = ctx.Write(enc) + + return err +} -- cgit v1.2.3