trigger

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	// Do performs the trigger action according to the settings,
	// and returns an error channel, the controller waits for the
	// error and if it's nil, the controller considers the action
	// is successfully scheduled, otherwise the controller considers
	// this is a failure and aborts the process.
	//
	// It's guaranteed that the error channel will receive the first
	// error, and receive at most 1 error, all following errors will
	// not be returned.
	//
	// This returning style can be used to wait for the http action
	// being normal, and then schedule it, otherwise we can interrupt
	// according to the first error.
	Do() chan error

	// Stop stops the scheduled actions.
	Stop()
}

func NewHTTPAction

func NewHTTPAction(intervalStr string, times int, url, method, body string, headers map[string]string) (Action, error)

Jump to

Keyboard shortcuts

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