activitypub

package
v0.0.0-...-b7c93c8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(signedString string) []byte

func Sign

func Sign(privKey string, keyId string, target string, headers []Pair) (string, error)

func Verify

func Verify(pubKey string, digest string, signature string) (bool, error)

Types

type Actor

type Actor struct {
	Context           []string  `json:"@context,omitempty"`
	Id                string    `json:"id,omitempty"`
	Type              string    `json:"type,omitempty"`
	Following         string    `json:"following,omitempty"`
	Followers         string    `json:"followers,omitempty"`
	Inbox             string    `json:"inbox,omitempty"`
	Outbox            string    `json:"outbox,omitempty"`
	PreferredUsername string    `json:"preferredUsername,omitempty"`
	Name              string    `json:"name,omitempty"`
	Summary           string    `json:"summary,omitempty"`
	Icon              Icon      `json:"icon"`
	Url               string    `json:"url,omitempty"`
	PublicKey         PublicKey `json:"publicKey,omitempty"`
	Endpoints         Endpoints `json:"endpoints"`
}

func ParseActor

func ParseActor(in string) (*Actor, error)

type Endpoints

type Endpoints struct {
	SharedInbox string `json:"sharedInbox,omitempty"`
}

func ParseActorEndpoints

func ParseActorEndpoints(in interface{}) (*Endpoints, error)

type Icon

type Icon struct {
	Type      string `json:"type"`
	MediaType string `json:"mediaType"`
	Url       string `json:"url"`
}

func ParseActorIcon

func ParseActorIcon(in interface{}) (*Icon, error)
type Link struct {
	Rel      string `json:"rel,omitempty"`
	Type     string `json:"type,omitempty"`
	Href     string `json:"href,omitempty"`
	Template string `json:"template,omitempty"`
}

type Nodeinfo

type Nodeinfo struct {
	Version           string   `json:"version,omitempty"`
	Software          Software `json:"software,omitempty"`
	Protocols         []string `json:"protocols,omitempty"`
	Services          Services `json:"services,omitempty"`
	Usage             Usage    `json:"usage,omitempty"`
	OpenRegistrations bool     `json:"openRegistrations,omitempty"`
	Metadata          struct{} `json:"metadata,omitempty"`
}

type Outbox

type Outbox struct {
	Context      []string `json:"@context,omitempty"`
	Id           string   `json:"id,omitempty"`
	Type         string   `json:"type,omitempty"`
	TotalItems   int      `json:"totalItems"`
	OrderedItems []string `json:"orderedItems"`
}

type Pair

type Pair struct {
	K string
	V string
}

type PublicKey

type PublicKey struct {
	Id           string `json:"id,omitempty"`
	Owner        string `json:"owner,omitempty"`
	PublicKeyPem string `json:"publicKeyPem,omitempty"`
}

func ParseActorPublicKey

func ParseActorPublicKey(in interface{}) (*PublicKey, error)

type Services

type Services struct {
	Outbound []string `json:"outbound,omitempty"`
	Inbound  []string `json:"inbound,omitempty"`
}

type Software

type Software struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

type Usage

type Usage struct {
	Users      Users `json:"users,omitempty"`
	LocalPosts int   `json:"inbound,omitempty"`
}

type Users

type Users struct {
	Total          int `json:"total,omitempty"`
	ActiveMonth    int `json:"activeMonth,omitempty"`
	ActiveHalfyear int `json:"activeHalfyear,omitempty"`
}

type Webfinger

type Webfinger struct {
	Subject string   `json:"subject,omitempty"`
	Aliases []string `json:"aliases,omitempty"`
	Links   []Link   `json:"links,omitempty"`
}

Jump to

Keyboard shortcuts

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