Documentation
¶
Index ¶
- Constants
- func StripHtml(reader io.Reader) (string, error)
- func StripHtmlFromNode(nd *html.Node) string
- func StripHtmlFromString(in string) (string, error)
- type Application
- type Config
- type Fedi
- func (s *Fedi) Client() *mastodon.Client
- func (s *Fedi) Ctx() context.Context
- func (s *Fedi) CurrentAccount() *mastodon.Account
- func (s *Fedi) GetList(title string) *mastodon.List
- func (s *Fedi) Init(cfg *Config, app Application, log *log.Logger)
- func (s *Fedi) IsFollower(account *mastodon.Account) error
- func (s *Fedi) Log() *log.Logger
- func (s *Fedi) MarkAccount(account *mastodon.Account, mark string) error
- func (s *Fedi) ProcessNotifications()
- func (s *Fedi) TootWithImage(toot mastodon.Toot, ipath string) (err error)
- func (s *Fedi) TootWithImageReader(toot mastodon.Toot, img io.Reader, alt string) error
- func (s *Fedi) WSClient() *mastodon.WSClient
- func (s *Fedi) WatchNotifications()
- type Toot
Constants ¶
View Source
const (
DefaultUserAgent = "fedilib/0.01 (2024-03-23)"
)
Variables ¶
This section is empty.
Functions ¶
func StripHtmlFromNode ¶
func StripHtmlFromString ¶
Types ¶
type Application ¶
type Application interface {
HandleNotification(n *mastodon.Notification)
}
type Config ¶
type Config struct {
// https://botsin.space
Server string `yaml:"server,omitempty" json:"server,omitempty"`
// Client key: kZoi323…
ClientID string `yaml:"client_id,omitempty" json:"client_id,omitempty"`
// Client secret: ose…
ClientSecret string `yaml:"client_secret,omitempty" json:"client_secret,omitempty"`
// Application name: fedilpd
ClientName string `yaml:"client_name,omitempty" json:"client_name,omitempty"`
// Scopes: read write follow
Scopes string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
// Application website: https://berlin.de/presse
Website string `yaml:"website,omitempty" json:"website,omitempty"`
// Redirect URI: urn:ietf:wg:oauth:2.0:oob
RedirectURI string `yaml:"redirect_uri,omitempty" json:"redirect_uri,omitempty"`
// Your access token: Rdn…
Token string `yaml:"token,omitempty" json:"token,omitempty"`
UserAgent string `yaml:"user_agent,omitempty" json:"user_agent,omitempty"`
}
type Fedi ¶
type Fedi struct {
// contains filtered or unexported fields
}
func (*Fedi) CurrentAccount ¶
func (*Fedi) ProcessNotifications ¶
func (s *Fedi) ProcessNotifications()
func (*Fedi) TootWithImage ¶
TootWithImage posts a new status with image (unless empty)
func (*Fedi) TootWithImageReader ¶
TootWithImage posts a new status with image (unless empty)
func (*Fedi) WatchNotifications ¶
func (s *Fedi) WatchNotifications()
Click to show internal directories.
Click to hide internal directories.