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 ¶
- func FriendlyBigInt(n *big.Int) string
- type ConfigPrinter
- type EnvPrinter
- type ExternalInitiatorAuthentication
- type Initiator
- type JobRun
- type JobSpec
- func (job JobSpec) FriendlyCreatedAt() string
- func (job JobSpec) FriendlyEndAt() string
- func (job JobSpec) FriendlyInitiators() string
- func (job JobSpec) FriendlyMinPayment() string
- func (job JobSpec) FriendlyStartAt() string
- func (job JobSpec) FriendlyTasks() string
- func (job JobSpec) MarshalJSON() ([]byte, error)
- type ServiceAgreement
- func (sa ServiceAgreement) FriendlyAggregator() string
- func (sa ServiceAgreement) FriendlyAggregatorFulfillMethod() string
- func (sa ServiceAgreement) FriendlyAggregatorInitMethod() string
- func (sa ServiceAgreement) FriendlyCreatedAt() string
- func (sa ServiceAgreement) FriendlyExpiration() string
- func (sa ServiceAgreement) FriendlyPayment() string
- func (sa ServiceAgreement) MarshalJSON() ([]byte, error)
- type ServiceAgreementPresentation
- type TaskSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FriendlyBigInt ¶
FriendlyBigInt returns a string printing the integer in both decimal and hexadecimal formats.
Types ¶
type ConfigPrinter ¶ added in v0.8.17
type ConfigPrinter struct {
EnvPrinter
}
ConfigPrinter are the non-secret values of the node
If you add an entry here, you should update NewConfigPrinter and ConfigPrinter#String accordingly.
func NewConfigPrinter ¶ added in v0.8.17
func NewConfigPrinter(store *store.Store) (ConfigPrinter, error)
NewConfigPrinter creates an instance of ConfigPrinter
func (ConfigPrinter) GetID ¶ added in v0.8.17
func (c ConfigPrinter) GetID() string
GetID generates a new ID for jsonapi serialization.
func (*ConfigPrinter) SetID ¶ added in v0.8.17
func (c *ConfigPrinter) SetID(value string) error
SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.
func (ConfigPrinter) String ¶ added in v0.8.17
func (c ConfigPrinter) String() string
String returns the values as a newline delimited string
type EnvPrinter ¶ added in v0.8.17
type EnvPrinter struct { AllowOrigins string `json:"ALLOW_ORIGINS"` BalanceMonitorEnabled bool `json:"BALANCE_MONITOR_ENABLED"` BlockBackfillDepth uint64 `json:"BLOCK_BACKFILL_DEPTH"` BridgeResponseURL string `json:"BRIDGE_RESPONSE_URL,omitempty"` ChainID *big.Int `json:"ETH_CHAIN_ID"` ClientNodeURL string `json:"CLIENT_NODE_URL"` DatabaseBackupFrequency time.Duration `json:"DATABASE_BACKUP_FREQUENCY"` DatabaseBackupMode string `json:"DATABASE_BACKUP_MODE"` DatabaseTimeout models.Duration `json:"DATABASE_TIMEOUT"` DatabaseMaximumTxDuration time.Duration `json:"DATABASE_MAXIMUM_TX_DURATION"` DefaultHTTPLimit int64 `json:"DEFAULT_HTTP_LIMIT"` DefaultHTTPTimeout models.Duration `json:"DEFAULT_HTTP_TIMEOUT"` Dev bool `json:"CHAINLINK_DEV"` EnableExperimentalAdapters bool `json:"ENABLE_EXPERIMENTAL_ADAPTERS"` EnableLegacyJobPipeline bool `json:"ENABLE_LEGACY_JOB_PIPELINE"` EthBalanceMonitorBlockDelay uint16 `json:"ETH_BALANCE_MONITOR_BLOCK_DELAY"` EthereumDisabled bool `json:"ETH_DISABLED"` EthFinalityDepth uint `json:"ETH_FINALITY_DEPTH"` EthGasBumpThreshold uint64 `json:"ETH_GAS_BUMP_THRESHOLD"` EthGasBumpTxDepth uint16 `json:"ETH_GAS_BUMP_TX_DEPTH"` EthGasBumpWei *big.Int `json:"ETH_GAS_BUMP_WEI"` EthGasLimitDefault uint64 `json:"ETH_GAS_LIMIT_DEFAULT"` EthGasLimitTransfer uint64 `json:"ETH_GAS_LIMIT_TRANSFER"` EthGasPriceDefault *big.Int `json:"ETH_GAS_PRICE_DEFAULT"` EthHeadTrackerHistoryDepth uint `json:"ETH_HEAD_TRACKER_HISTORY_DEPTH"` EthHeadTrackerMaxBufferSize uint `json:"ETH_HEAD_TRACKER_MAX_BUFFER_SIZE"` EthMaxGasPriceWei *big.Int `json:"ETH_MAX_GAS_PRICE_WEI"` EthereumURL string `json:"ETH_URL"` EthereumHTTPURL string `json:"ETH_HTTP_URL"` EthereumSecondaryURLs []string `json:"ETH_SECONDARY_URLS"` ExplorerURL string `json:"EXPLORER_URL"` FeatureExternalInitiators bool `json:"FEATURE_EXTERNAL_INITIATORS"` FeatureFluxMonitor bool `json:"FEATURE_FLUX_MONITOR"` FeatureOffchainReporting bool `json:"FEATURE_OFFCHAIN_REPORTING"` FlagsContractAddress string `json:"FLAGS_CONTRACT_ADDRESS"` GasUpdaterBlockDelay uint16 `json:"GAS_UPDATER_BLOCK_DELAY"` GasUpdaterBlockHistorySize uint16 `json:"GAS_UPDATER_BLOCK_HISTORY_SIZE"` GasUpdaterEnabled bool `json:"GAS_UPDATER_ENABLED"` GasUpdaterTransactionPercentile uint16 `json:"GAS_UPDATER_TRANSACTION_PERCENTILE"` InsecureFastScrypt bool `json:"INSECURE_FAST_SCRYPT"` TriggerFallbackDBPollInterval time.Duration `json:"JOB_PIPELINE_DB_POLL_INTERVAL"` JobPipelineReaperInterval time.Duration `json:"JOB_PIPELINE_REAPER_INTERVAL"` JobPipelineReaperThreshold time.Duration `json:"JOB_PIPELINE_REAPER_THRESHOLD"` JSONConsole bool `json:"JSON_CONSOLE"` LinkContractAddress string `json:"LINK_CONTRACT_ADDRESS"` LogLevel orm.LogLevel `json:"LOG_LEVEL"` LogSQLMigrations bool `json:"LOG_SQL_MIGRATIONS"` LogSQLStatements bool `json:"LOG_SQL"` LogToDisk bool `json:"LOG_TO_DISK"` MaximumServiceDuration models.Duration `json:"MAXIMUM_SERVICE_DURATION"` MinIncomingConfirmations uint32 `json:"MIN_INCOMING_CONFIRMATIONS"` MinRequiredOutgoingConfirmations uint64 `json:"MIN_OUTGOING_CONFIRMATIONS"` MinimumServiceDuration models.Duration `json:"MINIMUM_SERVICE_DURATION"` MinimumContractPayment *assets.Link `json:"MINIMUM_CONTRACT_PAYMENT"` MinimumRequestExpiration uint64 `json:"MINIMUM_REQUEST_EXPIRATION"` OCRBootstrapCheckInterval time.Duration `json:"OCR_BOOTSTRAP_CHECK_INTERVAL"` OCRContractTransmitterTransmitTimeout time.Duration `json:"OCR_CONTRACT_TRANSMITTER_TRANSMIT_TIMEOUT"` OCRDatabaseTimeout time.Duration `json:"OCR_DATABASE_TIMEOUT"` P2PListenIP string `json:"P2P_LISTEN_IP"` P2PListenPort string `json:"P2P_LISTEN_PORT"` P2PPeerID string `json:"P2P_PEER_ID"` P2PBootstrapPeers []string `json:"P2P_BOOTSTRAP_PEERS"` OCRIncomingMessageBufferSize int `json:"OCR_INCOMING_MESSAGE_BUFFER_SIZE"` OCROutgoingMessageBufferSize int `json:"OCR_OUTGOING_MESSAGE_BUFFER_SIZE"` OCRNewStreamTimeout time.Duration `json:"OCR_NEW_STREAM_TIMEOUT"` OCRDHTLookupInterval int `json:"OCR_DHT_LOOKUP_INTERVAL"` OCRTraceLogging bool `json:"OCR_TRACE_LOGGING"` OperatorContractAddress common.Address `json:"OPERATOR_CONTRACT_ADDRESS"` OptimismGasFees bool `json:"OPTIMISM_GAS_FEES"` Port uint16 `json:"CHAINLINK_PORT"` ReaperExpiration models.Duration `json:"REAPER_EXPIRATION"` ReplayFromBlock int64 `json:"REPLAY_FROM_BLOCK"` RootDir string `json:"ROOT"` SecureCookies bool `json:"SECURE_COOKIES"` SessionTimeout models.Duration `json:"SESSION_TIMEOUT"` TLSHost string `json:"CHAINLINK_TLS_HOST"` TLSPort uint16 `json:"CHAINLINK_TLS_PORT"` TLSRedirect bool `json:"CHAINLINK_TLS_REDIRECT"` }
EnvPrinter contains the supported environment variables
type ExternalInitiatorAuthentication ¶ added in v0.6.6
type ExternalInitiatorAuthentication struct { Name string `json:"name,omitempty"` URL models.WebURL `json:"url,omitempty"` AccessKey string `json:"incomingAccessKey,omitempty"` Secret string `json:"incomingSecret,omitempty"` OutgoingToken string `json:"outgoingToken,omitempty"` OutgoingSecret string `json:"outgoingSecret,omitempty"` }
ExternalInitiatorAuthentication includes initiator and authentication details.
func NewExternalInitiatorAuthentication ¶ added in v0.6.6
func NewExternalInitiatorAuthentication( ei models.ExternalInitiator, eia auth.Token, ) *ExternalInitiatorAuthentication
NewExternalInitiatorAuthentication creates an instance of ExternalInitiatorAuthentication.
func (*ExternalInitiatorAuthentication) GetID ¶ added in v0.6.6
func (ei *ExternalInitiatorAuthentication) GetID() string
GetID returns the jsonapi ID.
func (*ExternalInitiatorAuthentication) GetName ¶ added in v0.6.6
func (*ExternalInitiatorAuthentication) GetName() string
GetName returns the collection name for jsonapi.
func (*ExternalInitiatorAuthentication) SetID ¶ added in v0.6.6
func (ei *ExternalInitiatorAuthentication) SetID(name string) error
SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.
type Initiator ¶
Initiator holds the Job definition's Initiator.
func (Initiator) FriendlyAddress ¶
FriendlyAddress returns the Ethereum address if present, and a blank string if not.
func (Initiator) FriendlyRunAt ¶
FriendlyRunAt returns a human-readable string for Cron Initiator types.
func (Initiator) MarshalJSON ¶
MarshalJSON returns the JSON data of the Initiator based on its Initiator Type.
type JobRun ¶
JobRun presents an API friendly version of the data.
func (JobRun) MarshalJSON ¶
MarshalJSON returns the JSON data of the JobRun and its Initiator.
type JobSpec ¶
type JobSpec struct { models.JobSpec Errors []models.JobSpecError `json:"errors"` Earnings *assets.Link `json:"earnings"` }
JobSpec holds the JobSpec definition together with the total link earned from that job
func (JobSpec) FriendlyCreatedAt ¶
FriendlyCreatedAt returns a human-readable string of the Job's CreatedAt field.
func (JobSpec) FriendlyEndAt ¶
FriendlyEndAt returns a human-readable string of the Job's EndAt field.
func (JobSpec) FriendlyInitiators ¶
FriendlyInitiators returns the list of Initiator types as a comma separated string.
func (JobSpec) FriendlyMinPayment ¶ added in v0.6.6
FriendlyMinPayment returns a formatted string of the Job's Minimum Link Payment threshold
func (JobSpec) FriendlyStartAt ¶
FriendlyStartAt returns a human-readable string of the Job's StartAt field.
func (JobSpec) FriendlyTasks ¶
FriendlyTasks returns the list of Task types as a comma separated string.
func (JobSpec) MarshalJSON ¶
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) FriendlyAggregator ¶ added in v0.6.8
func (sa ServiceAgreement) FriendlyAggregator() string
FriendlyAggregator returns the ServiceAgreement's aggregator address, in a human readable format.
func (ServiceAgreement) FriendlyAggregatorFulfillMethod ¶ added in v0.6.8
func (sa ServiceAgreement) FriendlyAggregatorFulfillMethod() string
FriendlyAggregatorFulfillMethod returns the ServiceAgreement's aggregator fulfillment (orcale reporting) method's function selector, in a human readable format.
func (ServiceAgreement) FriendlyAggregatorInitMethod ¶ added in v0.6.8
func (sa ServiceAgreement) FriendlyAggregatorInitMethod() string
FriendlyAggregator returns the ServiceAgreement's aggregator initialization method's function selector, in a human readable format.
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 presents the ServiceAgreement as public JSON data
type ServiceAgreementPresentation ¶ added in v0.6.10
type ServiceAgreementPresentation struct { ID string `json:"id"` CreatedAt string `json:"createdAt"` Encumbrance models.Encumbrance `json:"encumbrance"` EncumbranceID int64 `json:"encumbranceID"` RequestBody string `json:"requestBody"` Signature string `json:"signature"` JobSpec models.JobSpec `json:"jobSpec"` JobSpecID string `json:"jobSpecId"` }