alfari

package module
v0.0.0-...-eb726d4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

README

alfari

The alfari package provides tools to maintain a Mastodon community account.

alfari-logo

Installation

$> go install codeberg.org/bins/alfari/cmd/alfari-srv@latest
$> ALFARI_MASTODON_HANDLE=@[email protected] \
 alfari-srv -addr ":8080" -dir ./db

Documentation

Documentation for alfari is served by GoDoc.

License

alfari is released under the BSD-3 license.

Documentation

Overview

Package alfari provides tools to maintain a Mastodon community account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	BskyID  syntax.DID
	MastoID string // Fully qualified Mastodon handle (ex: @[email protected])
	Creds   Creds
}

func (Account) BskyIdentity

func (acc Account) BskyIdentity(ctx context.Context) (*identity.Identity, error)

type Creds

type Creds struct {
	Bluesky struct {
		User string // Bluesky user handle (ex: alice.bsky.social)
		Host string // Bluesky host server (ex: https://bsky.social)
		Pass string // Bluesky user/app password
	}
	Mastodon struct {
		Server string // Mastodon server (ex: https://mastodon.example.org)
		Client struct {
			ID     string // Mastodon client ID
			Secret string // Mastodon client secret
			Token  string // Mastodon client token
		}
	}
}

type FilterOptions

type FilterOptions func()

type Media

type Media struct {
	BskyID   string // Bluesky blob ID
	MastoUID string // Mastodon user handle (ex: @[email protected])
	Data     []byte // Media payload
	Thumb    []byte // Media thumbnail, if any
	Descr    string // Media description, if any
	Focus    string // Media thumbnail focus, if any (ex: "(0,0)")
	MIME     string // Media MIME type (ex: "image/png", "video/mp4")
}

type Status

type Status int

Status describes the status of a Mastodon toot.

const (
	StatusInvalid Status = iota
	StatusDraft
	StatusPublished
	StatusDiscarded
)

func (Status) String

func (i Status) String() string

type Thread

type Thread struct {
	Toot    Toot
	Replies []*Thread
}

func (Thread) Discarded

func (th Thread) Discarded() bool

func (Thread) Processed

func (th Thread) Processed() bool

func (Thread) Published

func (th Thread) Published() bool

func (Thread) Toots

func (th Thread) Toots() iter.Seq[Toot]

type Toot

type Toot struct {
	Account Account

	BskyID  string // Bluesky record URI
	BskyPID string // Bluesky parent record URI, if any
	BskyRID string // Bluesky root record URI, if any

	CreatedAt time.Time // Bluesky record creation time

	MastoID mastodon.ID    // Mastodon toot ID, if any
	Status  Status         // Mastodon toot status
	Toot    *mastodon.Toot // Mastodon toot
}

func (Toot) Discarded

func (toot Toot) Discarded() bool

func (Toot) Processed

func (toot Toot) Processed() bool

func (Toot) Published

func (toot Toot) Published() bool

Directories

Path Synopsis
Package alfcnv provides tools to convert a Bluesky post into a Mastodon one.
Package alfcnv provides tools to convert a Bluesky post into a Mastodon one.
Package alfdb provides tools to store a Bluesky/Mastodon db-index of records (Bluesky) and statuses (Mastodon).
Package alfdb provides tools to store a Bluesky/Mastodon db-index of records (Bluesky) and statuses (Mastodon).
Package alfsrv provides a server to perform Bluesky posts to Mastodon posts conversion and validation.
Package alfsrv provides a server to perform Bluesky posts to Mastodon posts conversion and validation.
cmd
alfari-followers
Command alfari-followers dumps the timeline of followers.
Command alfari-followers dumps the timeline of followers.
alfari-srv
Command alfari-srv serves an alfsrv server end-point.
Command alfari-srv serves an alfsrv server end-point.
alfari-watch-bs
Command alfari-watch-bs watches a BlueSky account for new posts.
Command alfari-watch-bs watches a BlueSky account for new posts.
internal
assets
Package assets provides embedded resources.
Package assets provides embedded resources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳