server

package
v0.0.0-...-e22f0ee Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: LGPL-2.1-or-later Imports: 15 Imported by: 0

Documentation

Overview

An implementaiton of server-to-server/federation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	vocab.Actor

	Followers []string `json:"-"`
	Posts     []post   `json:"-"`
}

Actor represents an ActivityPub actor including content that the server uses in order to store, save, and manipulate actors.

func (*Actor) PostNewNote

func (actor *Actor) PostNewNote(permalink string, content template.HTML, publishedAt time.Time)

func (*Actor) PostNewNoteNow

func (actor *Actor) PostNewNoteNow(permalink string, content template.HTML)

type App

type App struct {
	// BaseURL is the URL where the application is hosted
	BaseURL string

	// ServerName is the hostname of the server (what comes after the username).
	ServerName string

	// Mux is an HTTP muxer for the server
	Mux *http.ServeMux

	// StoragePath is the directory where files generated by the server will be
	// stored.
	StoragePath string

	Name    string // Name is what you call your application.
	Version string // Version is the version of your application.

	OpenRegistration bool // If users can create their own accounts with review.

	// Actors are the ActivityPub actors that are assinged to the server.  You
	// shouldn't append them directly to this array instead use [App.AddActor]
	// to create them.
	Actors []Actor
}

App represents an ActivityPub server.

func (*App) AddActor

func (app *App) AddActor(lang, pageURL, actorType, username, displayName, summary string)

AddActor creates an actor, assigns it to the server, and saves it to the file system.

func (App) GetActor

func (app App) GetActor(username string) (*Actor, *int)

GetActors attempts to return an Actor object for an actor that is assigned to the server with the username provided.

func (App) SetupHTTP

func (app App) SetupHTTP()

SetupHTTP adds handlers to the provided muxer.

Jump to

Keyboard shortcuts

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