Deliver Atom feed items on Misskey
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
476 B

package publisher
// Interface is a common interface for publishers like Misskey.
type Interface interface {
Name() string
Publish(content, imageURL string) error
}
// NewTokenPublisherByName creates a new Publisher with token auth
// based on its name.
func NewTokenPublisherByName(name, baseURL, token string) Interface {
if name == misskeyName {
return NewMisskey(baseURL, token)
}
if name == mastodonName {
return NewMastodon(baseURL, token)
}
return nil
}