Documentation
¶
Index ¶
- Constants
- func BlueskyImport(authClient *auth.Client, archiveFolderPath string, statusMapFile string, ...) error
- func DownloadAttachment(ctx context.Context, mediaDownloadLimiter *rate.Limiter, ...) (string, string, error)
- func Export(authClient *auth.Client, archiveFolderPath string) error
- func Import(authClient *auth.Client, file string, statusMapFile string, ...) error
- func PixelfedImport(authClient *auth.Client, file string, statusMapFile string, ...) error
- type Activity
- type Actor
- type Attachment
- type Emoji
- type Icon
- type MentionOrHashtag
- type Object
- type Outbox
- type PixelfedArchiveStatus
- type PixelfedPlace
- type Tag
- type Visibility
Constants ¶
const ASPublic = "https://www.w3.org/ns/activitystreams#Public"
Variables ¶
This section is empty.
Functions ¶
func BlueskyImport ¶
func DownloadAttachment ¶
func DownloadAttachment( ctx context.Context, mediaDownloadLimiter *rate.Limiter, mediaDownloadClient *http.Client, statusURI string, localDir string, url string, ) (string, string, error)
DownloadAttachment downloads an attachment to a local directory, building the full path from the remote filename. It returns the local path and the MIME type (or "application/octet-stream" if the remote server doesn't send one). It uses slog and takes the status URI for log context.
func Export ¶
Export exports a vaguely Mastodon-compatible archive to file (actually a folder path).
Types ¶
type Activity ¶
type Activity struct {
Type string `json:"type"`
RawObject json.RawMessage `json:"object"`
}
type Attachment ¶
type Attachment struct {
Type string `json:"type"`
MediaType string `json:"mediaType"`
Url string `json:"url"`
Name *string `json:"name"`
RawFocalPoint []float64 `json:"focalPoint,omitempty"`
Icon *Icon `json:"icon,omitempty"`
}
func (*Attachment) FocalPointX ¶
func (a *Attachment) FocalPointX() *float64
func (*Attachment) FocalPointY ¶
func (a *Attachment) FocalPointY() *float64
type MentionOrHashtag ¶
type MentionOrHashtag struct {
Type string `json:"type"`
Name string `json:"name"`
Href string `json:"href"`
}
func (*MentionOrHashtag) GetType ¶
func (m *MentionOrHashtag) GetType() string
type Object ¶
type Object struct {
Id string `json:"id"`
Type string `json:"type"`
Summary *string `json:"summary,omitempty"`
InReplyTo *string `json:"inReplyTo,omitempty"`
Published time.Time `json:"published"`
Url string `json:"url"`
To []string `json:"to,omitempty"`
Cc []string `json:"cc"`
Sensitive bool `json:"sensitive"`
Content string `json:"content"`
ContentMap map[string]string `json:"contentMap,omitempty"`
DirectMessage bool `json:"directMessage"`
Attachments []*Attachment `json:"attachment,omitempty"`
RawTags []json.RawMessage `json:"tag,omitempty"`
}
func (*Object) TargetsSpecificUsersInToOrCc ¶
TargetsSpecificUsersInToOrCc is true if the status is addressed to anything that isn't the public or followers collections or the actor that posted it.
func (*Object) Visibility ¶
func (o *Object) Visibility() Visibility
type PixelfedArchiveStatus ¶
type PixelfedArchiveStatus struct {
models.Status
// ContentText is probably the Pixelfed version of `source`.
// If this is missing, the `content` will be an empty string.
ContentText *string `json:"content_text"`
// Place is an optional location.
Place *PixelfedPlace `json:"place"`
// CommentsDisabled surfaces Pixelfed's own interaction controls.
CommentsDisabled bool `json:"comments_disabled"`
}
PixelfedArchiveStatus is a Mastodon API status with a few extra fields.
func (*PixelfedArchiveStatus) CreateParams ¶
func (p *PixelfedArchiveStatus) CreateParams(inReplyToID *string, mediaIDs []string) (*statuses.StatusCreateParams, error)
type PixelfedPlace ¶
type PixelfedPlace struct {
ID int `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Country string `json:"country"`
}
PixelfedPlace describes a geotagged location. TODO: (Vyr) not currently used. Also, figure out the full set of fields.
type Visibility ¶
type Visibility string
const ( VisibilityPublic Visibility = "public" VisibilityUnlisted Visibility = "unlisted" VisibilityPrivate Visibility = "private" VisibilityDirect Visibility = "direct" )