Documentation

Index

Constants

View Source
const RequestTimout = 10

    RequestTimout is the timeout of a request in seconds.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Interface

    type Interface interface {
    	Name() string
    	Publish(content, imageURL string) error
    }

      Interface is a common interface for publishers like Misskey.

      func NewTokenPublisherByName

      func NewTokenPublisherByName(name, baseURL, token string) Interface

        NewTokenPublisherByName creates a new Publisher with token auth based on its name.

        type Mastodon

        type Mastodon struct {
        	Client *mastodon.Client
        }

          Mastodon publisher.

          func NewMastodon

          func NewMastodon(baseURL, token string) *Mastodon

            NewMastodon creates a new Mastodon publisher.

            func (*Mastodon) Name

            func (m *Mastodon) Name() string

              Name returns with the name of the publisher.

              func (*Mastodon) Publish

              func (m *Mastodon) Publish(content, image string) error

                Publish simply publishes a Toot.

                type Misskey

                type Misskey struct {
                	Client misskey.ClientInterface
                }

                  Misskey publisher.

                  func NewMisskey

                  func NewMisskey(baseURL, token string) *Misskey

                    NewMisskey creates a new Misskey publisher.

                    func (*Misskey) Name

                    func (m *Misskey) Name() string

                      Name returns with the name of the publisher.

                      func (*Misskey) Publish

                      func (m *Misskey) Publish(content, image string) error

                        Publish simply publishes a Note.