invoker

package
v0.0.0-...-4206155 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTootLength = 500
)

Variables

View Source
var (
	ExecutedAdministrationEventsTotal = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "executed_administration_events_total",
		Help:      "Total number of administration events replied through API.",
	})
	ExecutedAdministrationEventsErrorsTotal = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "executed_administration_events_errors_total",
		Help:      "Total number of errors triggered when replying to administration through API.",
	})
)
View Source
var (
	IncrementTotal = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "increment_total",
		Help:      "Total number of increment through API.",
	})
	IncrementErrorTotal = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "increment_error_total",
		Help:      "Total number of errors triggered when incrementing through API.",
	}, []string{"type"})
)
View Source
var (
	RepliedEventsTotal = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "replied_events_total",
		Help:      "Total number of events replied through API.",
	})
	RepliedEventsErrorTotal = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "replied_events_error_total",
		Help:      "Total number of errors triggered when replying through API.",
	})
)
View Source
var (
	DisplayNameRegex = regexp.MustCompile(`(.*)(昨日: (\d+) \/ 今日: (\d+))`)
	UpdatesTotal     = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "updates_total",
		Help:      "Total number of updates through API.",
	})
	UpdatesErrorTotal = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: "ejaculation_counter",
		Name:      "updates_error_total",
		Help:      "Total number of errors triggered when updating through API.",
	}, []string{"type"})
)
View Source
var (
	MentionRegexp = regexp.MustCompile(`(@[a-z0-9_]+([a-z0-9_\.-]+[a-z0-9_]+)?)@[[:word:].-]+[a-z0-9]+`)
)

Functions

func NewAdministration

func NewAdministration(
	client *mastodon.Client,
	db client.DB,
) service.Administration

func NewIncrement

func NewIncrement(
	environment config.Environment,
	client *mastodon.Client,
	db client.DB,
) service.Increment

func NewReply

func NewReply(client *mastodon.Client) service.Reply

func NewUpdate

func NewUpdate(
	environment config.Environment,
	client *mastodon.Client,
	db client.DB,
) service.Update

Types

This section is empty.

Jump to

Keyboard shortcuts

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