service

package
v0.0.0-...-00b50ba Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stop time.Duration = -1
)

Variables

This section is empty.

Functions

func Accept

func Accept(uuid string)

Accept accepts the api with the given uuid

func Done

func Done(uuid string) time.Duration

Done stops the api with the given uuid

func Wait

func Wait(ctx context.Context)

Types

type DayAt

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

type Func

type Func func() error

type Routine

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

func NewRoutine

func NewRoutine(name string, f Func) *Routine

func (*Routine) Count

func (r *Routine) Count(count int64) *Routine

Count count is the number of times you want to be executed, 0 means unlimited

func (*Routine) EveryDayAt

func (r *Routine) EveryDayAt(hour int, min int, location *time.Location) *Routine

EveryDayAt represents the time of day you want to be executed

func (*Routine) Go

func (r *Routine) Go(delay ...time.Duration) error

Go delay represents the time to delay the first execution. if the delay parameter is not given, it means execution according to routine schedule.

func (*Routine) Repeat

func (r *Routine) Repeat(duration time.Duration) *Routine

Repeat duration represents the time interval between each execution

func (*Routine) RepeatByPassFail

func (r *Routine) RepeatByPassFail(passDuration time.Duration, failDurtaion time.Duration) *Routine

RepeatByPassFail passDuration represents the time interval between each successful execution, failDurtaion represents the time interval between each failed execution

Jump to

Keyboard shortcuts

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