ap

package
v0.0.0-...-f6da3f2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const APTimeFormat = "2006-01-02T15:04:05Z07:00"

Variables

This section is empty.

Functions

func ShouldRenderObject

func ShouldRenderObject(r *http.Request) bool

Types

type APTime

type APTime time.Time

func TimeFromULID

func TimeFromULID(id ulid.ULID) APTime

func (APTime) MarshalJSON

func (t APTime) MarshalJSON() ([]byte, error)

func (APTime) Time

func (t APTime) Time() time.Time

func (*APTime) UnmarshalJSON

func (t *APTime) UnmarshalJSON(data []byte) error

type ActorPublicKey

type ActorPublicKey struct {
	ID           string `json:"id"`
	Owner        string `json:"owner"`
	PublicKeyPEM string `json:"publicKeyPem"`
}

type Note

type Note struct {
	Object

	ID           string `json:"id"`           // ActivityPub ID
	Content      string `json:"content"`      // Post content
	AttributedTo string `json:"attributedTo"` // ActivityPub ID of blog
	Published    APTime `json:"published"`    // Time published
	URL          string `json:"url"`          // Profile
}

func PostToNote

func PostToNote(app *app.App, b database.Blog, p database.Post) Note

type Object

type Object struct {
	Context []string `json:"@context"`
	Type    string   `json:"type"`
}

type Person

type Person struct {
	Object

	ID                string         `json:"id"`                // ActivityPub ID
	Name              string         `json:"name"`              // Display name
	PreferredUsername string         `json:"preferredUsername"` // Username
	Summary           string         `json:"summary"`           // Bio
	URL               string         `json:"url"`               // Profile page
	Inbox             string         `json:"inbox"`             // Blog inbox
	Outbox            string         `json:"outbox"`            // Blog outbox
	PublicKey         ActorPublicKey `json:"publicKey"`         // Public key
}

func BlogToPerson

func BlogToPerson(app *app.App, b database.Blog) Person

Jump to

Keyboard shortcuts

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