presenters

package
v0.0.0-...-537fcec Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package presenters allow for the specification and result of a Job, its associated TaskSpecs, and every JobRun and TaskRun to be returned in a user friendly human readable format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogListeningAddress

func LogListeningAddress(address common.Address) string

func ShowEthBalance

func ShowEthBalance(store *store.Store) (string, error)

Types

type Initiator

type Initiator struct {
	models.Initiator
}

Initiator holds the Job definition's Initiator.

func (Initiator) FriendlyAddress

func (i Initiator) FriendlyAddress() string

FriendlyAddress returns the Ethereum address if present, and a blank string if not.

func (Initiator) FriendlyRunAt

func (i Initiator) FriendlyRunAt() string

FriendlyRunAt returns a human-readable string for Cron Initiator types.

func (Initiator) MarshalJSON

func (i Initiator) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON data of the Initiator based on its Initiator Type.

type JobSpec

type JobSpec struct {
	models.JobSpec
	Runs []models.JobRun `json:"runs,omitempty"`
}

JobSpec holds the JobSpec definition and each run associated with that Job.

func (JobSpec) FriendlyCreatedAt

func (job JobSpec) FriendlyCreatedAt() string

FriendlyCreatedAt returns a human-readable string of the Job's CreatedAt field.

func (JobSpec) FriendlyEndAt

func (job JobSpec) FriendlyEndAt() string

FriendlyEndAt returns a human-readable string of the Job's EndAt field.

func (JobSpec) FriendlyInitiators

func (job JobSpec) FriendlyInitiators() string

FriendlyInitiators returns the list of Initiator types as a comma separated string.

func (JobSpec) FriendlyStartAt

func (job JobSpec) FriendlyStartAt() string

FriendlyStartAt returns a human-readable string of the Job's StartAt field.

func (JobSpec) FriendlyTasks

func (job JobSpec) FriendlyTasks() string

FriendlyTasks returns the list of Task types as a comma separated string.

func (JobSpec) MarshalJSON

func (j JobSpec) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON data of the Job and its Initiators.

type TaskSpec

type TaskSpec struct {
	models.TaskSpec
}

TaskSpec holds a task specified in the Job definition.

func (TaskSpec) FriendlyParams

func (t TaskSpec) FriendlyParams() (string, string)

FriendlyParams returns a map of the TaskSpec's parameters.

Jump to

Keyboard shortcuts

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