aboutsummaryrefslogtreecommitdiff
path: root/resources/profile.go
blob: 83b2159a5aa2e3d8e5ca06ecfe0f1ed8de44f557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package resources

import "path"

type Profile struct {
	Context  []string `json:"@context"`
	Type     string   `json:"type"`
	Id       string   `json:"id"`
	Inbox    string   `json:"inbox"`
	Outbox   string   `json:"outbox"`
	Summary  string   `json:"summary"`
	Username string   `json:"preferredUsername"`
}

type PublicKey struct {
}

func RenderProfile(name, domain string) *Profile {
	p := Profile{
		Context: []string{"https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"},
		Type:    "Service",
		Inbox:   path.Join("https://", domain, "actors", name, "inbox"),
		Outbox:  path.Join("https://", domain, "actors", name, "outbox"),
	}
	return &p
}