publisher

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

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 added in v1.2.0

type Mastodon struct {
	Client *mastodon.Client
}

Mastodon publisher.

func NewMastodon added in v1.2.0

func NewMastodon(baseURL, token string) *Mastodon

NewMastodon creates a new Mastodon publisher.

func (*Mastodon) Name added in v1.2.0

func (m *Mastodon) Name() string

Name returns with the name of the publisher.

func (*Mastodon) Publish added in v1.2.0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL