service

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Overview

Package service implements the common utils function for daemon services.

Index

Constants

View Source
const (
	MsgWaybackRetrying = "wayback timeout, retrying."
	MsgWaybackTimeout  = "wayback timeout, please try later."
)

Variables

This section is empty.

Functions

func ExcludeURL added in v0.18.0

func ExcludeURL(urls []*url.URL, host string) (ex []*url.URL)

ExcludeURL removes URLs based on hostname; it is only available for multiple URLs. The URLs given should be de-duplicated advance.

func MatchURL

func MatchURL(s string) (urls []*url.URL)

MatchURL returns a slice string contains URLs extracted from the given string.

func UploadToDiscord added in v0.17.0

func UploadToDiscord(art reduxer.Artifact) (files []*discord.File)

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

func UploadToSlack added in v0.17.0

func UploadToSlack(client *slack.Client, 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

func UploadToTelegram(art reduxer.Artifact, caption string) telegram.Album

UploadToTelegram composes files into an album by the given artifact.

func Wayback added in v0.18.0

func Wayback(ctx context.Context, urls []*url.URL, do doFunc) error

Wayback in a separate goroutine.

Types

type Meili added in v0.18.0

type Meili struct {
	// contains filtered or unexported fields
}

Meili represents a Meilisearch client.

func NewMeili added in v0.18.0

func NewMeili(endpoint, apikey, idxname string) *Meili

NewMeili returns a Meilisearch client.

func (*Meili) Setup added in v0.18.0

func (m *Meili) Setup() error

Setup creates an index if one does not already exist on the server.

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.

Jump to

Keyboard shortcuts

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