metathings_evaluatord_timer

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DKRON_EXECUTOR_CONFIG_EXPECTED_CODE = "204"
	DKRON_EXECUTOR_CONFIG_METHOD        = "POST"
)

Variables

View Source
var (
	ErrUnknownTimerBackendDriver = errors.New("unknown timer backend driver")
	ErrTimerIdIsEmpty            = errors.New("timer id is empty")
)

Functions

func SetEnabled

func SetEnabled(enabled bool) func(map[string]interface{})

func SetId

func SetId(id string) func(map[string]interface{})

func SetSchedule

func SetSchedule(schedule string) func(map[string]interface{})

func SetTimezone

func SetTimezone(timezone string) func(map[string]interface{})

Types

type DkronTimerApi

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

func NewDkronTimerApi

func NewDkronTimerApi(
	call func(ctx context.Context, method string, path string, body map[string]interface{}) (map[string]interface{}, error),
	body map[string]interface{},
	logger logrus.FieldLogger,
) (*DkronTimerApi, error)

func (*DkronTimerApi) Delete

func (t *DkronTimerApi) Delete(ctx context.Context) error

func (*DkronTimerApi) Enabled

func (t *DkronTimerApi) Enabled() bool

func (*DkronTimerApi) Id

func (t *DkronTimerApi) Id() string

func (*DkronTimerApi) Schedule

func (t *DkronTimerApi) Schedule() string

func (*DkronTimerApi) Set

func (t *DkronTimerApi) Set(ctx context.Context, opts ...TimerOption) error

func (*DkronTimerApi) Timezone

func (t *DkronTimerApi) Timezone() string

type DkronTimerBackend

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

func (*DkronTimerBackend) Create

func (b *DkronTimerBackend) Create(ctx context.Context, opts ...TimerOption) (TimerApi, error)

func (*DkronTimerBackend) Get

type DkronTimerBackendOption

type DkronTimerBackendOption struct {
	Timeout time.Duration
	Url     string
	Webhook string
}

func NewDkronTimerBackendOption

func NewDkronTimerBackendOption() *DkronTimerBackendOption

type NewTimerBackendFactory

type NewTimerBackendFactory func(...interface{}) (TimerBackend, error)

type TimerApi

type TimerApi interface {
	Id() string
	Schedule() string
	Timezone() string
	Enabled() bool

	Set(context.Context, ...TimerOption) error

	Delete(context.Context) error
}

type TimerBackend

type TimerBackend interface {
	Create(context.Context, ...TimerOption) (TimerApi, error)
	Get(context.Context, string) (TimerApi, error)
}

func NewDkronTimerBackend

func NewDkronTimerBackend(args ...interface{}) (TimerBackend, error)

func NewTimerBackend

func NewTimerBackend(name string, args ...interface{}) (TimerBackend, error)

type TimerOption

type TimerOption func(map[string]interface{})

Jump to

Keyboard shortcuts

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