activitypub

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	POST_TEMPLATE  = "" /* 179-byte string literal not displayed */
	MATCH_TEMPLATE = "^Signature: (.*)$"
)
View Source
const MASTODON_API_STATUS = "https://%s/api/v1/statuses/%s"

Variables

View Source
var (
	Servers = struct {
		Mastodon ServerSoftware
		Misskey  ServerSoftware
		Pleroma  ServerSoftware
	}{
		Mastodon: "mastodon",
		Misskey:  "misskey",
		Pleroma:  "pleroma",
	}
)

Functions

func Init

func Init()

Types

type ActivityPub

type ActivityPub struct {
	*validator.Base
}

func (*ActivityPub) DetectServerSoftware

func (ap *ActivityPub) DetectServerSoftware() (server ServerSoftware, err error)

func (*ActivityPub) ExtractSignature

func (ap *ActivityPub) ExtractSignature() (err error)

func (*ActivityPub) GeneratePostPayload

func (ap *ActivityPub) GeneratePostPayload() (_ map[string]string)

func (*ActivityPub) GenerateSignPayload

func (ap *ActivityPub) GenerateSignPayload() (payload string)

func (*ActivityPub) GetMastodonText

func (ap *ActivityPub) GetMastodonText() (err error)

GetMastodonText can also deal with Pleroma server.

func (*ActivityPub) GetMisskeyText

func (ap *ActivityPub) GetMisskeyText() (err error)

func (*ActivityPub) SplitID

func (ap *ActivityPub) SplitID() (username, server string, err error)

func (*ActivityPub) Validate

func (ap *ActivityPub) Validate() (err error)

type MastodonResponse

type MastodonResponse struct {
	Account MastodonResponseAccount `json:"account"`
	Content string                  `json:"content"`
}

type MastodonResponseAccount

type MastodonResponseAccount struct {
	// ASCII
	Username string `json:"username"`
	// Digits
	Id string `json:"id"`
}

type NodeInfo

type NodeInfo struct {
	Links []NodeInfoLink `json:"links"`
}
type NodeInfoLink struct {
	Rel  string `json:"rel"`
	Href string `json:"href"`
}

type ServerSoftware

type ServerSoftware string

Jump to

Keyboard shortcuts

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