tootecho

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: AGPL-3.0 Imports: 7 Imported by: 1

README

toot-echo

GoDoc Version Build Status Go Report Card Codecov

Echo adapter for the toot Mastodon API

Toot-echo connects the toot library to the echo router. This makes it easy for you to Mastodon-ize your Go/echo application.

api.PostStatus = func(authorization model.Authorization, values txn.PostStatus) (object.Status, error) {
	// Do the thing that:
	// 1) creates a new `status`
	// 2) writes it to the database
	// 3) returns the value to the caller
}

// Once your handlers are defined, connect Toot to your router like this:
e := echo.New()
tootecho.Register(e, api)

Routers

Currently, toot-echo is the only router adapter I have created for Toot. It should, however, be a simple project to write adapters for other routers. If you'd like to use Toot with a different router, please get in touch and let's work together.

Project Status (Alpha?)

This project is still in early alpha testing, as I continue filling out the Mastodon support in Emissary. Some interfaces may change in the future if I run into trouble making things work with this reference implementation.

However, at this point, feedback from other developers will be immensely helpful in making Tooth a useful tool for the Go community. Please feel free to open issues, or submit pull requests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register[AuthToken toot.ScopesGetter](e *echo.Echo, api toot.API[AuthToken], middleware ...echo.MiddlewareFunc)

func WithHost

func WithHost(next echo.HandlerFunc) echo.HandlerFunc

WithHost middleware guarantees that all incoming HTTP requests include the correct "Host" value in their headers

Types

This section is empty.

Jump to

Keyboard shortcuts

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