Documentation ¶
Overview ¶
Package service implements the common utils function for daemon services.
Index ¶
- Constants
- func ExcludeURL(urls []*url.URL, host string) (ex []*url.URL)
- func MatchURL(opts *config.Options, s string) (urls []*url.URL)
- func UploadToDiscord(opts *config.Options, art reduxer.Artifact) (files []*discord.File)
- func UploadToSlack(client *slack.Client, opts *config.Options, art reduxer.Artifact, ...) (err error)
- func UploadToTelegram(opts *config.Options, art reduxer.Artifact, caption string) telegram.Album
- func Wayback(ctx context.Context, opts *config.Options, urls []*url.URL, do doFunc) error
- type Option
- type Options
Constants ¶
const ( MsgWaybackRetrying = "wayback timeout, retrying." MsgWaybackTimeout = "wayback timeout, please try later." )
Variables ¶
This section is empty.
Functions ¶
func ExcludeURL ¶ added in v0.18.0
ExcludeURL removes URLs based on hostname; it is only available for multiple URLs. The URLs given should be de-duplicated advance.
func UploadToDiscord ¶ added in v0.17.0
UploadToDiscord composes files that share with Discord by a given artifact.
func UploadToSlack ¶ added in v0.17.0
func UploadToSlack(client *slack.Client, opts *config.Options, art reduxer.Artifact, channel, timestamp, caption string) (err error)
UploadToSlack upload files to channel and attach as a reply by the given artifact
func UploadToTelegram ¶ added in v0.17.0
UploadToTelegram composes files into an album by the given artifact.
Types ¶
type Option ¶ added in v0.19.0
type Option func(*Options)
Option is a function that modifies the provided Options instance.
func Config ¶ added in v0.19.0
Config returns an Option function that sets the Config field of Options.
type Options ¶ added in v0.19.0
type Options struct { // Config holds the configuration options. Config *config.Options // Pool holds the connection pool to be used. Pool *pooling.Pool // Publish holds the publish service to be used. Publish *publish.Publish // Storage holds the storage service to be used. Storage *storage.Storage }
Options represents the configuration for services.
func ParseOptions ¶ added in v0.19.0
ParseOptions returns the Options instance with modifications applied using the provided Option functions.
Directories ¶
Path | Synopsis |
---|---|
Package discord implements the discord bot daemon service.
|
Package discord implements the discord bot daemon service. |
Package httpd implements the tor network service.
|
Package httpd implements the tor network service. |
Package mastodon implements the mastodon daemon service.
|
Package mastodon implements the mastodon daemon service. |
Package matrix implements the matrix daemon service.
|
Package matrix implements the matrix daemon service. |
Package relaychat implements the internet relay chat daemon service.
|
Package relaychat implements the internet relay chat daemon service. |
Package slack implements the slack bot daemon service.
|
Package slack implements the slack bot daemon service. |
Package telegram implements the telegram bot daemon service.
|
Package telegram implements the telegram bot daemon service. |
Package twitter implements the twitter daemon service.
|
Package twitter implements the twitter daemon service. |