crontab

package
v0.0.0-...-401433d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SharedKey         = "crontab"
	EnvironmentSecret = "CF_CRONTAB_SECRET"
	DefaultAppName    = "cf-crontab"
	InternalDomain    = "apps.internal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Amqp

type Amqp struct {
	Exchange     string `json:"exchange"`
	ExchangeType string `json:"exchange_type"`
	RoutingKey   string `json:"routing_key"`
	Payload      string `json:"payload"`
	ContentType  string `json:"content_type"`
	Instance     string `json:"instance"`
	Task         *Task  `json:"-"`
}

func (Amqp) Run

func (a Amqp) Run()

type Cartel

type Cartel struct {
	Command  string `json:"command"`
	Name     string `json:"name"`
	Tags     string `json:"tags"`
	Instance string `json:"instance"`
	Action   string `json:"action"`
	Task     *Task  `json:"-"`
}

func (Cartel) Run

func (c Cartel) Run()

type Http

type Http struct {
	Method  string            `json:"method"`
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
	Body    string            `json:"body"`
	Task    *Task             `json:"-"`
}

func (Http) Run

func (h Http) Run()

type Iron

type Iron struct {
	Command  string `json:"command"`
	CodeName string `json:"code_name"`
	Cluster  string `json:"cluster"`
	Timeout  int    `json:"timeout"`
	Payload  string `json:"payload"`
	Task     *Task  `json:"-"`
}

func (Iron) Run

func (i Iron) Run()

type Job

type Job struct {
	Type    string          `json:"type"`
	Command json.RawMessage `json:"command,omitempty"`
}

Job describes a job

func (Job) String

func (j Job) String() string

type State

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

func NewState

func NewState() *State

func (*State) AddEntries

func (e *State) AddEntries(newEntries []Task) (*[]Task, error)

func (*State) DeleteEntry

func (e *State) DeleteEntry(id int) error

func (*State) Entries

func (e *State) Entries() []*Task

func (*State) StartCron

func (e *State) StartCron()

type Task

type Task struct {
	Schedule string       `json:"schedule"`
	Job      Job          `json:"job"`
	EntryID  cron.EntryID `json:"entryID,omitempty"`
}

func LoadFromEnv

func LoadFromEnv() ([]Task, error)

func (*Task) Add

func (t *Task) Add(cr *cron.Cron) error

func (*Task) String

func (t *Task) String() string

Jump to

Keyboard shortcuts

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