runner

package
v0.0.0-...-9f76edf Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

* Package runner provides a functionalities to run a set of some processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TwitterAPIIsAvailable

func TwitterAPIIsAvailable(twitterAPI *core.TwitterAPI) error

TwitterAPIIsAvailable returns nil if twitterAPI client is available to use, which means that twitterAPI's methods are callable and it is verified by a valid credential.

Types

type BatchRunner

type BatchRunner interface {
	Run() ([]interface{}, []data.Action, error)
	// IsAvailable returns true if this runner is available.
	// You should check the availability by calling this and if this
	// returns false, you can't call Run.
	IsAvailable() error
}

BatchRunner wraps a batch process and provides a feature to run it.

type BatchRunnerUsedWithStream

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

BatchRunnerUsedWithStream implements mybot batch processing and is intended to be used with stream processing.

func NewBatchRunnerUsedWithStream

func NewBatchRunnerUsedWithStream(
	twitterAPI *core.TwitterAPI,
	slackAPI *core.SlackAPI,
	visionAPI core.VisionMatcher,
	languageAPI core.LanguageMatcher,
	config core.Config,
) *BatchRunnerUsedWithStream

NewBatchRunnerUsedWithStream returns new BatchRunnerUsedWithStream with specified arguments.

func (BatchRunnerUsedWithStream) IsAvailable

func (r BatchRunnerUsedWithStream) IsAvailable() error

IsAvailable returns true if Twitter API is available because it is data fetcher and all other API depends on it. It is the responsibility of Twitter API to check other APIs are available.

func (BatchRunnerUsedWithStream) Run

func (r BatchRunnerUsedWithStream) Run() ([]interface{}, []data.Action, error)

Run processes Twitter search/favorite API result and then makes notifications of it based on r.config.

Jump to

Keyboard shortcuts

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