publish

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscord added in v0.15.1

func NewDiscord(bot *discord.Session) *discordBot

NewDiscord returns Discord bot client

func NewGitHub added in v0.7.0

func NewGitHub(httpClient *http.Client) *gitHub

NewGitHub returns a gitHub client.

func NewIRC added in v0.9.0

func NewIRC(conn *irc.Connection) *ircBot

NewIRC returns a ircBot struct

func NewMastodon added in v0.8.0

func NewMastodon(client *mstdn.Client) *mastodon

NewMastodon returns a mastodon client.

func NewMatrix added in v0.9.0

func NewMatrix(client *matrix.Client) *matrixBot

NewMatrix returns a matrixBot client.

func NewSlack added in v0.15.1

func NewSlack(bot *slack.Client) *slackBot

NewSlack returns Slack bot client

func NewTelegram added in v0.10.0

func NewTelegram(bot *telegram.Bot) *telegramBot

NewTelegram returns Telegram bot client

func NewTwitter added in v0.8.0

func NewTwitter(client *twitter.Client) *twitterBot

NewTwitter returns a twitterBot client.

func To added in v0.8.3

func To(ctx context.Context, cols []wayback.Collect, args ...string)

To publish to specific destination services nolint:gocyclo

func UploadToDiscord added in v0.15.1

func UploadToDiscord(bundle *reduxer.Bundle) (files []*discord.File)

UploadToDiscord composes files that share with Discord by a given bundle.

func UploadToSlack added in v0.15.1

func UploadToSlack(client *slack.Client, bundle *reduxer.Bundle, channel, timestamp string) (err error)

UploadToSlack upload files to channel and attach as a reply by the given bundle

func UploadToTelegram added in v0.15.1

func UploadToTelegram(bundle *reduxer.Bundle) telegram.Album

UploadToTelegram composes files into an album by the given bundle.

Types

type Flag added in v0.16.0

type Flag uint8

Flag represents a type of uint8

const (
	FlagWeb      Flag = iota // FlagWeb publish from httpd service
	FlagTelegram             // FlagTelegram publish from telegram service
	FlagTwitter              // FlagTwitter publish from twitter srvice
	FlagMastodon             // FlagMastodon publish from mastodon service
	FlagDiscord              // FlagDiscord publish from discord service
	FlagMatrix               // FlagMatrix publish from matrix service
	FlagSlack                // FlagSlack publish from slack service
	FlagIRC                  // FlagIRC publish from relaychat service

	PubBundle = "reduxer-bundle" // Publish bundle key in a context with value
)

func (Flag) String added in v0.16.0

func (f Flag) String() string

String returns the flag as a string.

type Publisher added in v0.14.0

type Publisher interface {
	Publish(ctx context.Context, cols []wayback.Collect, args ...string)
}

Publisher is the interface that wraps the basic Publish method.

Publish publish message to serveral media platforms, e.g. Telegram channel, GitHub Issues, etc. The cols must either be a []wayback.Collect, args use for specific service.

Jump to

Keyboard shortcuts

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