presenters

package
v0.0.0-...-5cb58b4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2018 License: MIT Imports: 12 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 FriendlyBigInt

func FriendlyBigInt(n *big.Int) string

FriendlyBigInt returns a string printing the integer in both decimal and hexidecimal formats.

func LogListeningAddress

func LogListeningAddress(address common.Address) string

LogListeningAddress returns the LogListeningAddress

func ShowEthBalance

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

ShowEthBalance returns the current Eth Balance for current Account

func ShowLinkBalance

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

ShowLinkBalance returns the current Link Balance for current Account

Types

type AccountBalance

type AccountBalance struct {
	Address     string       `json:"address"`
	EthBalance  *assets.Eth  `json:"eth_balance"`
	LinkBalance *assets.Link `json:"link_balance"`
}

AccountBalance holds the hex representation of the address plus it's ETH & LINK balances

func (AccountBalance) GetID

func (a AccountBalance) GetID() string

GetID returns the ID of this structure for jsonapi serialization.

func (*AccountBalance) SetID

func (a *AccountBalance) SetID(value string) error

SetID is used to set the ID of this structure when deserializing from jsonapi documents.

type BridgeType

type BridgeType struct {
	models.BridgeType
}

BridgeType holds a bridge.

func (BridgeType) MarshalJSON

func (bt BridgeType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON data of the Bridge.

type ConfigWhitelist

type ConfigWhitelist struct {
	AllowOrigins             string          `json:"allowOrigins"`
	ChainID                  uint64          `json:"ethChainId"`
	ChainlinkDev             bool            `json:"chainlinkDev"`
	ClientNodeURL            string          `json:"clientNodeUrl"`
	DatabaseTimeout          store.Duration  `json:"databaseTimeout"`
	EthGasBumpThreshold      uint64          `json:"ethGasBumpThreshold"`
	EthGasBumpWei            *big.Int        `json:"ethGasBumpWei"`
	EthGasPriceDefault       *big.Int        `json:"ethGasPriceDefault"`
	EthereumURL              string          `json:"ethUrl"`
	LinkContractAddress      string          `json:"linkContractAddress"`
	LogLevel                 store.LogLevel  `json:"logLevel"`
	MinIncomingConfirmations uint64          `json:"minIncomingConfirmations"`
	MinOutgoingConfirmations uint64          `json:"minOutgoingConfirmations"`
	MinimumContractPayment   *assets.Link    `json:"minimumContractPayment"`
	MinimumRequestExpiration uint64          `json:"minimumRequestExpiration"`
	OracleContractAddress    *common.Address `json:"oracleContractAddress"`
	Port                     uint16          `json:"chainlinkPort"`
	TLSPort                  uint16          `json:"chainlinkTLSPort"`
	TLSHost                  string          `json:"chainlinkTLSHost"`
	RootDir                  string          `json:"root"`
	SessionTimeout           store.Duration  `json:"sessionTimeout"`
	ReaperExpiration         store.Duration  `json:"reaperExpiration"`
}

ConfigWhitelist are the non-secret values of the node

func NewConfigWhitelist

func NewConfigWhitelist(config store.Config) ConfigWhitelist

NewConfigWhitelist creates an instance of ConfigWhitelist

func (ConfigWhitelist) GetID

func (c ConfigWhitelist) GetID() string

GetID generates a new ID for jsonapi serialization.

func (*ConfigWhitelist) SetID

func (c *ConfigWhitelist) SetID(value string) error

SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.

func (ConfigWhitelist) String

func (c ConfigWhitelist) String() string

String returns the values as a newline delimited string

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 JobRun

type JobRun struct {
	models.JobRun
}

JobRun presents an API friendly version of the data.

func (JobRun) MarshalJSON

func (jr JobRun) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON data of the JobRun and its Initiator.

type JobSpec

type JobSpec struct {
	models.JobSpec
	Runs []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 (job JobSpec) MarshalJSON() ([]byte, error)

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

type ServiceAgreement

type ServiceAgreement struct {
	models.ServiceAgreement
}

ServiceAgreement presents an API friendly version of the data.

func (ServiceAgreement) FriendlyCreatedAt

func (sa ServiceAgreement) FriendlyCreatedAt() string

FriendlyCreatedAt returns the ServiceAgreement's created at time in a human readable format.

func (ServiceAgreement) FriendlyExpiration

func (sa ServiceAgreement) FriendlyExpiration() string

FriendlyExpiration returns the ServiceAgreement's Encumbrance expiration time in a human readable format.

func (ServiceAgreement) FriendlyPayment

func (sa ServiceAgreement) FriendlyPayment() string

FriendlyPayment returns the ServiceAgreement's Encumbrance payment amount in a human readable format.

func (ServiceAgreement) MarshalJSON

func (sa ServiceAgreement) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON data of the ServiceAgreement.

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